[plug] Formatting a USB Flash Disk in Linux

Steve Grasso steveg at calm.wa.gov.au
Mon Jan 5 17:37:55 WST 2004


Hi Margo,

In this case, I suspect that XP has kindly formatted the device as FAT32, not 
FAT, hence it is not a vfat (ie. FAT16) device.

Try this (since if the lights flashed, we've probably correctly identified 
the device)
* * * * * * * IMPORTANT NOTE * * * * * * *
This will destroy any data on the /dev/sda1 device

dd if=/dev/zero of=/dev/sda1

What this will do is write zero's to the flash device, obliterating any 
existing file system on the device (assuming it's not write protected - see 
my note concerning the 'key' switch on the device)

Then try formatting it using

mkfs -t vfat -v /dev/sda1

ANOTHER NOTE:

You must use the root (superuser) account on the machine to access the raw 
device.

Give that a whirl and let me know how you go

Cheers,
STeve

On Fri, 2 Jan 2004 17:39, Margo wrote:
>  Steve Grasso wrote:
>
>
> OK, I'll bite. (but not hard!)
> Happy New Year BTW!
>
> On Thu, 1 Jan 2004 21:06, Ady Gould wrote:
>
>
> Ok gentlemen and ladies
>
> I have been asked how to do some things with a Flash Disk...
>
> 1.      unmount a flash disk
>
>
> Assuming it's mounted as in 3. below:
>
> umount /dev/sda1
>
>
>
> 2.      format a flash disk to vFAT or such
>
>
> mkfs -t vfat -v /dev/sda1
> NOTE: This assumes that the device is not mounted - you can't format a
> mounted device.
>
>
>
> 3.      mount the flash disk to read/write with the FAT FS
>
>
> mkdir /mnt/flash
> mount -t vfat /dev/sda1 /mnt/flash
>
> NOTES:
>
> 1. Perform 1, 2 or 3 as the root or superuser
> 2. Flash drives identify on a few of my Red Hat systems (2.4.7-10 and
> 2.4.20-24.9 kernels) as SCSI devices
> 3. If the drive mounts readonly, move the write-protect switch to unlock
> (key symbol, as opposed to the closed lock symbol or something similar)
>
>
>
> The lady in question, Margo, can mount her partner's Flash disk without a
> problem in (Red Hat) Fedora, yet her disk will not.
>
> As she said to me online: "when I plug it in, fedora inserts the correct
> line in the fstab to mount the disk with auto to pick up the fs"
>
> Make of Flash Disks: a-data
> Flash disk that works is: 32mg usb1.0 - never formatted
> Flash disk that will not: a new 256mg usb2.0 - formatted in XP to FAT /
> FAT32 with and without the utilities for the drive
>
>
> Try formatting the drive under Linux
>
>
>
> Can anyone help me with this one - I'm lost anyhow :)
>
>
> Hopefully I've helped a little
>
>
>
>
> I've CC-ed Margo this question so if you reply can you send to her as well?
>
>
> Just did!
>
> Cheers,
> Steve
>
>    Hi
>
>  I tried formatting the disk and certainly the lights flashed etc, however,
> the disk didn't format. ie I got the same msg (unknown fs) and when I
> checked it in WinXP the original files were still on it.
>
>  I used:
>  mkfs -t vfat /dev/sda1
>
>  What is the -v?



More information about the plug mailing list