Saturday, March 14, 2009

How to format USB drive into Fat32 format?

Problem Background:

Some of the files created in Linux will not be able to format in Windows, it keep prompting you error said that the device was on use by some other else. When bringing back the USB drive to Linux, the files was locked. there is no way for you to delete it. Thus I am force to format the USB drive under Linux.

Solution:
  1. umount the USB drive.
  2. log in as root.
  3. delete the existing partition using fdisk.
  4. mkfs.vfat /dev/sdb1
But when I was trying to format it (in step 3), it prompt an error:

Could not stat /dev/sdb1 --- no such file or directory.
The device apparently does not exist; did you specify it correctly?

To solve that problem, here is the solution:
  1. cat /proc/partitions. (this will show the minor and major number of each partitions drive)
  2. mknod /dev/sdb1 b <major> <minor> .
  3. retry the format again.
  4. type fdisk -l to verify the partition again. (optional step)
[Reference]
1. Ubuntu Linux format USB pen drive.
2. Could not stat /dev/sdb1, although partition exists.
3. Partitioning with fdisk.

No comments: