My USB stick looks dead :
victor@X301A1:~$ umount /dev/sdc1
victor@X301A1:~$ sudo mkfs -t vfat /dev/sdc1
mkfs.vfat 3.0.12 (29 Oct 2011)
mkfs.vfat: unable to open /dev/sdc1: Read-only file system
victor@X301A1:~$ sudo hdparm -r0 /dev/sdc1
/dev/sdc1:
setting readonly to 0 (off)
readonly = 0 (off)
victor@X301A1:~$ sudo fsck -n /dev/sdc1
fsck de util-linux 2.20.1
dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN
/.Trash-1000/files/sans_titre
Start does point to root directory. Deleting dir.
/.Trash-1000/files/Bus CAN
Start does point to root directory. Deleting dir.
Reclaimed 190903 unused clusters (781938688 bytes).
Free cluster summary wrong (1001897 vs. really 1383698)
Auto-correcting.
Leaving file system unchanged.
/dev/sdc1: 8052 files, 566660/1950358 clusters
Is there anyway for me to recover my USB stick ? Thank
Best Answer
Well, one could try zero'ing the raw block device to see if that can work. If you can write to that then you may be able to create a clean partition table, create a new partition and format that.
Suppose the USB stick is on /dev/sdc, first make sure /dev/sdc1 is unmounted:
See if you can then clear the partition table, say by copying a bunch of zeros over the first few K
If that works, see if you can write zeros to the whole device without it failing. To easily see if the kernel can't write to the device, first clear the current kernel messages and throw them away using:
..then zero the entire device:
..this will take a while. dd will complete when the raw block device is completely written to, or an error has occurred.
Then, check to see if the kernel has complained about the device, using:
..if you see a load of error messages then you know that the USB stick is probably not in good condition.
However, if this works fine run fdisk or parted to create the partitions from clean, e.g. with fdisk I use:
..note just press return for the First and Last sector questions, fdisk will chose the correct defaults (which will be different to my example above). And then format the partition with VFAT:
and then remove and re-insert the drive. It should be cleanly formatted.