How can I partition /dev/sdb into /dev/sdb1 and /dev/sdb2, and then format /dev/sdb1 to exFAT ( or FAT32 ) from LBA=1 to 2097152 by commands? ( LBA=0 is reserved for MBR )
-
1You want to create a 1 MiB partition (2048 times 512 byte)?Hauke Laging– Hauke Laging2014-05-19 03:27:02 +00:00Commented May 19, 2014 at 3:27
Add a comment
|
1 Answer
I have created a loop device for testing:
dd if=/dev/zero of=tmp.img bs=1M count=100
modprobe loop
dd if=/dev/zero of=tmp.img bs=1M count=100
losetup /dev/loop0 tmp.img
And then:
# parted --script /dev/loop0 unit s mklabel msdos \
mkpart primary fat32 1 2048 mkpart primary fat32 2049 4096 print
Warning: The resulting partition is not properly aligned for best performance.
Warning: The resulting partition is not properly aligned for best performance.
Model: Loopback device (loopback)
Disk /dev/loop0: 204800s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1s 2048s 2048s primary lba, type=0c
2 2049s 4096s 2048s primary lba, type=0c
formatting
mkfs.vfat -F 32 /dev/sdb1
-
Oh, sorry, my fault. I edited my question. It should be LBA=2097152. (1GiB)Kevin Dong– Kevin Dong2014-05-19 03:50:08 +00:00Commented May 19, 2014 at 3:50