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
  • 1
    You want to create a 1 MiB partition (2048 times 512 byte)? Commented May 19, 2014 at 3:27

1 Answer 1

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
1
  • Oh, sorry, my fault. I edited my question. It should be LBA=2097152. (1GiB) Commented May 19, 2014 at 3:50

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.