Thursday, April 17, 2014

How to format USB flash drive from terminal

Steps:

1) check the partitions using the command:
$df

2) Take the usb partition name from the list after you run the above command, e.g. /dev/sdb1

3) Un mount the device:
$ sudo umount /dev/sdb1

4) Verify with df whether the device has gone or not

5) Format the USB using the following:

 a) for FAT32(used on Windows systems) use:
    sudo mkfs.vfat -n usbNameWhatEverYouWantToGive /dev/sdb1

 b) For ext3 (used on linux) use:
   sudo mkfs.ext3 -L usbNameWhatEverYouWantToGive /dev/sdb1

No comments:

Post a Comment