Apostolos\’ Daily Plate

How to format USB flash drives with FAT32

Posted in OpenIndiana, OpenSolaris by asyropoulos on Δεκέμβριος 20, 2010

First find the device name that corresponds to the USB flash drive:

# rmformat
Looking for devices...
1. Logical Node: /dev/rdsk/c0t0d0p0
Physical Node: /pci@0,0/pci1458,5004@13,2/storage@1/disk@0,0
Connected Device: Kingston DataTraveler 2.0 6.16
Device Type: Removable
Bus: USB
Size: 979,0 MB
Label: <None>
Access permissions: Medium is not write protected.
2. Logical Node: /dev/rdsk/c13t1d0p0
Physical Node: /pci@0,0/pci1458,b002@11/cdrom@1,0
Connected Device: TSSTcorp CDDVDW SH-S203D  SB01
Device Type: DVD Reader/Writer
Bus: <Unknown>
Size: <Unknown>
Label: <Unknown>
Access permissions: <Unknown>

Second create a FAT32 partition using the following command:

fdisk /dev/rdsk/c0t0d0p0

Finally, construct the file system using the following command:

mkfs -F pcfs -o fat=32,b=apostolos /dev/rdsk/c0t0d0p0:c

Here what follows the b= part will become the name of the disk.