-   Linux - Hardware (
-   -   Recovering damaged flash drive (

Avatar33 03-06-2005 03:28 PM

Recovering damaged flash drive
Hi all.

A friend of mine gave me his flash drive and asked me to take a look at it. It's giving I/O errors on Windows so I though I'd give it a format using linux.

Unfortunetly the problem on linux is more severe. I can not even mount the device.

mount -t vfat /dev/sda1 /mnt/flash

mount: special device /dev/sda1 does not exist
I've also tried mounting read-only but this does not help.

fdisk /dev/sda

Unable to read /dev/sda
I know the drive is mounted on /dev/sda because that is what harddrake reports :-)

Does anyone have any suggestions for formatting this disk? Or how can I find out if the device is even supported under linux. Using lsusb reports that the device is at least detected.

Thanks in Advance.

Avatar33 03-06-2005 03:43 PM

Sorry about that the device is a Jetflash 128MB
lsusb reports this info:

idVendor          0x066f SigmaTel, Inc.
iProduct                2 JetFlashM Audio Player

Any other info needed?

Electro 03-07-2005 01:52 AM

First of all, you need to make sure /dev/sda.../dev/sdz is there. If it is not there, you have to load a few modules. As root or su or sudo, load up sd_mod and usb-storage. Probably you do need to load up usb-storage.

Use dd to clean up any mess it has. Then disconnect it. Next reconnect it. Fourth, use fdisk or cfdisk to make a partition. Use type b for the partition type if you want to put a FAT filesystem on it. Next disconnect it and reconnect it. Finally format it.

Flash mediums has limited writes which means it wears out after so many times you can write data to it. The FAT filesystem is not very helpful on the lifespan of flash mediums because it writes multiple times per file and per directory (around 20 to 50 times). Cheap brands can only do about hundred-thousand (100000) writes. More expensive brands can reach near a million (1000000) writes. You can not bring back flash mediums from the dead like magnetic mediums, so do not bother. However there is another medium called FRAM that has unlimited writes and it is much faster, but it has limited capacity at this time.

Avatar33 03-09-2005 02:20 PM

Thanks for the reply and sorry for the delay.

I'm not sure exactly what commands I'm supposed to try.
This is what I did:

dd if=/dev/zero of=/dev/sda1
dd: writing to `/dev/sda1': No space left on device
1697+0 records in
1696+0 records out

fdisk /dev/sda1
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

You must set cylinders.
You can do this from the extra functions menu.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Do flash drives use cylinders??
If looked on the specs page for the device on the web, but it does not say anything about cylinders.
How do I proceed from here?


Electro 03-09-2005 09:51 PM

You should have done dd if=/dev/zero of=/dev/sda instead of dd if=/dev/zero of=/dev/sda1 because it will give you a clean start. /dev/sda1 is the partition not the real drive. The real device is /dev/sda. For fdisk to work you have to specify /dev/sda. I suggest using cfdisk because it is a lot easier to use and you do not have to remember a lot of syntax.

Flash mediums do not have heads, sectors, and cylinders. They have rows and columns of memory banks. The software in Flash based drives virtualizes the heads, sectors, and cylinders.

Avatar33 03-12-2005 07:50 AM

Thanks again for your reply Electro

Here is the output of the commands that you gave me:

dd if=/dev/zero of=/dev/sda
dd: writing to `/dev/sda': Input/output error
1+0 records in
0+0 records out


cfdisk /dev/sda
FATAL ERROR: Cannot read disk drive

Does this confirm that the device is truly dead?


All times are GMT -5. The time now is 11:57 AM.