Friday, September 4, 2015

Create a USB bootable stick manually...

Partition
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
nobody@nowhere:/$ sudo fdisk /dev/sde

Command (m for help): p

Disk /dev/sde: 15.6 GB, 15610576896 bytes
64 heads, 32 sectors/track, 14887 cylinders, total 30489408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x196065d9

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 
Using default value 1
First sector (2048-30489407, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-30489407, default 30489407): 616447

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (1-4, default 2): 
Using default value 2
First sector (616448-30489407, default 616448): 
Using default value 616448
Last sector, +sectors or +size{K,M,G} (616448-30489407, default 30489407): 2013183

Command (m for help): p

Disk /dev/sde: 15.6 GB, 15610576896 bytes
64 heads, 32 sectors/track, 14887 cylinders, total 30489408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x196065d9

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1            2048      616447      307200   83  Linux
/dev/sde2          616448     2013183      698368   83  Linux

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)

Command (m for help): p

Disk /dev/sde: 15.6 GB, 15610576896 bytes
64 heads, 32 sectors/track, 14887 cylinders, total 30489408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x196065d9

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1            2048      616447      307200    b  W95 FAT32
/dev/sde2          616448     2013183      698368   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
nobody@nowhere:/$ 

Format
EXT4:
1
nobody@nowhere:~$ sudo mkfs.ext4 -L stickroot /dev/sdf2

FAT32:
1
nobody@nowhere:~$ sudo mkfs.msdos -n STORAGE -F 32 /dev/sdf1

Staging
Make a staging tar ball by removing content in the following directories
1
2
3
/boot
/boot/grub 
/lib/modules/

Grub
Install Grub:
1
2
3
nobody@nowhere:~$ sudo grub-install --root-directory=/media/stickroot/ /dev/sde
Installation finished. No error reported.

Get UUID:
1
2
3
nobody@nowhere:/media/stickroot/boot/grub$ sudo blkid /dev/sde2
/dev/sde2: LABEL="stickroot" UUID="714de0e8-738b-4823-9019-3b0344153050" TYPE="ext4" 

No comments:

Post a Comment