My 16 gigs Corsair Flash Voyager GT has died. No biggie. I am not writing this to complain or cry out. This story's going to have a happy ending.
Sometime ago, my other 16 gigs pendrive died on me, too. It was a long time after its warranty had expired. It was old. I had a spare one. No biggie. Why am I even mentioning it? I am mentioning it simply because I want to describe the behavioral pattern.
So the story goes like this. It started a few weeks before the thumbdrive died completely. I had a video from a friend's wedding copied onto the pendrive. I was watching it. All of a sudden, SMPlayer closed -- no errors -- clean exit. I thought "What the hell?" and tried to play the video again. Well ... no video to be played. Then I noticed something far worse than the missing video. "Holy crap! Where's my pendrive?" Yes. The dongle was not recognized by the system. I unplugged it, plugged it back in, and everything worked fine again. I thought it was a USB port that was to blame. Maybe a software glitch. I remember thinking that maybe the motherboard of that lappy was going bad.
A few days later, I was watching a different video from this pendrive on another machine. Smplayer died again -- twice -- within 10 minutes. "Uhuh! This is not a USB/mobo problem" I thought, and I copied all the data from the memory stick to the HDD on my main machine. I sensed the reaper coming after my old friend. After a while, the system was "losing" the drive way too often. It became unreliable. I tried many things to recover it, but nothing worked.
One night, I was watching a Ted.com talk from the Voyager and SMPlayer closed. It closed again 20 minutes later. I knew what was going on and had just finished copying data from the flash drive. I heard that Corsair has great confidence in their products, and they give a long term warranty -- 5 years, or sometimes even a lifetime warranty. This pendrive has been with me for a shorter period than that. I went to the manufacturers site and reported a dying pendrive. I was told to send the Voyager to the Netherlands to be replaced. BUT... but... but... what about all my pron documents? I don't want some curious dude at Corsair to be able to recover all my notes and photos and so on. How would I overwrite the drive with some useless random data that would make it harder or almost impossible to recover?
After some searching, I have combined a few commands for my convenience. They are listed below. Run these commands:
su (and provide the root password when prompted)
fdisk -l (that's fdisk space dash lower case L)
This command will list all the hard drives available in your system.
[root@icsserver andrzejl]# fdisk -l
Disk /dev/sda: 40.0 GB, 40007761920 bytes
240 heads, 63 sectors/track, 5168 cylinders, total 78140160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xef08263a
Device Boot Start End Blocks Id System
/dev/sda1 * 63 73392479 36696208+ 83 Linux
/dev/sda2 73392480 78140159 2373840 5 Extended
/dev/sda5 73392543 75479039 1043248+ 82 Linux swap / Solaris
/dev/sda6 75479103 78140159 1330528+ 83 Linux
This machine for example has only one HDD /dev/sda and it's 40 gigs.
Once you have found the correct drive, run this:
dd if=/dev/urandom of=/dev/sdx & pid=$!
Remember to replace x with the correct drive letter... DO NOT MAKE A MISTAKE. DD does not ask. DD writes. If you make the mistake of writing random strings to a wrong drive you are the only one to blame.
In my case it's /dev/sde drive that I want to "randomize".
[root@wishmacer andrzejl]# dd if=/dev/urandom of=/dev/sde & pid=$!
It gives me a process id and then runs in a background. you can then check the progress by issuing command:
kill -USR1 $pid
The result will look something like this:
[root@wishmacer andrzejl]# kill -USR1 $pid
[root@wishmacer andrzejl]# 10171578+0 records in
10171577+0 records out
5207847424 bytes (5.2 GB) copied, 2710.78 s, 1.9 MB/s
It spits out some pretty useful info.
Sometimes it may not give you a prompt. It will look like the process froze. Don't worry. Punch enter, and the prompt is back.
It will take longer, but once it's done you will see something like this:
[root@wishmacer andrzejl]# dd: writing to '/dev/sde': No space left on device
31719425+0 records in
31719424+0 records out
16240345088 bytes (16 GB) copied, 8522.4 s, 1.9 MB/s
This means that the process has finished. This should be sufficient -- data on your HDD has been overwritten with "random" gibberish. If you are paranoid and you want to make the recovery process even more difficult, run the dd command a few times. You don't have to format the disk or anything. Just re-run the command in the terminal. Five to ten times should do it.