2

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 )

  • 1
    You want to create a 1 MiB partition (2048 times 512 byte)? – Hauke Laging May 19 '14 at 3:27
1

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 May 19 '14 at 3:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.