I’ve been sitting on this post for quite some time. I recently bought (and later sold, long before this post was typed) a Pico-ITX motherboard, an x86 motherboard smaller than my hand.
I named it Marcus and crafted a custom installation of Gentoo (as I do for every new computer) for it. I also decided to slipstream a gPXE (Enhanced PXE Network Boot) image into the BIOS. All seemed well, and I flashed it.
Reboot time came. I tried to enter the setup screen to configure my new toy!
- How now! An external hard drive?
- Clatters to the floor
- [Within enclosure] O, I am slain!
Well, it happened something like that…
I was about to attach my external enclosure (containing a Seagate 120GB 2.5″ SATA hard drive) to my other laptop, when the cord came up short and the drive slid off my desk.
To the floor three feet below…
While it was running.
Hard Drives are rated to withstand falls from a few feet, but only when they’re not running. When they are running, however, the heads smash into the platters, spinning at 5,400 RPM.
So I’m running a fsck on the drive, and it finds a bad block (about 2.3 million 4096-byte blocks into the disk). As I went to pull my laptop and hard drive into my lap, and the hard drive slides off the desk again. In the same place, and landing the same way.
By this point, I’ve started to give up. Fsck tells me that there is a bad block in the same place, and I check the SMART statistics: 0 Reallocated Sectors.
I write data to the bad sectors to force them to reallocate. This goes on for quite a while (with the badblocks tool, among other things such as creating as many 10GB files filled with zeroes as I could (I got to 6 files of various sizes before the drive began buzzing) and I get up to about 150 reallocated sectors (Or around 90 as a calibrated hard drive value; for the record, the failure threshold is 36. The drive started at 100.).
I decide to back up the data (only one of the actual files on the drive is corrupt; all the damage is in unallocated space) and delete some things I have elsewhere. 156 reallocated sectors.
After backing up the data I decided that it would be best to do a destructive write test. Writing to bad blocks causes the drive’s firmware to reallocate them on a different section of the physical disk.
By the middle of the test (700,000 4096-byte blocks, starting at the first corrupted region), the drive began buzzing again, and when I finally gave up, it had reallocated about 2,100 sectors, and the calibrated value was down to 44.
At this point, I gave up.
Rest in peace, Seagate. You have been with me since I got my laptop. Thanks for all the fish.
On another note, I’m now in the market for a new 2.5″ SATA drive.
UPDATE: The drive is a lost cause. I’m not writing anything to it, and it’s reallocating sectors on its own.
Powered-on time: 305 days, 6 hours. Rest in Peace.
I’d just like to put this out there for everybody…
- Make frequent backups. Maybe every month.
- Do not, under ANY circumstances, accidentally try to install Haiku to /dev/sda. Ever.
Now that the advice is out of the way, it’s story time!
Yesterday, I was trying to install Haiku to my 512MB flash drive, which, when I plugged it in, got assigned /dev/sdb. The Haiku build system was, at the time set to write to /dev/sda2 (my 3GiB Haiku partition). I deleted the “2” and went on with my business. I ran jam -q haiku-image to build it.
“Hmm, this is taking a while.”
“dd, wrote 134 MB to /dev/sda”
“OH MY GOD!”
It wrote 134 MB of 0x00s to the beginning of my hard drive, clobbering the bootloader, partition table, and the root filesystem of my Linux installation (/dev/sda1).
It also got to the “Populating Image” step, so it was happily chugging along writing a Be File System over my entire hard drive and filling it with Haiku data.
Programs still ran, not all the files on / were lost, and I was in a state of panic.
One reboot later confirmed the obvious – no more system. Also, no more files in /. The filesystem layout was in memory, and I should have taken the time to recover some of the data before I reformatted.
fsck told me that /usr was trashed.. /usr is like “Program Files” and more for Linux… Random data written in random places on a volume is… bad 😉
/ was definitely a goner…
/home somehow survived, guaranteeing that my 8 years-worth of data would stick around for a while longer!
Fortunately, I had backups from August 15th!
Unfortunately, they were from August 15th. That means 3 months worth of upgrades to do…
Restored / and /usr, some of /var (installed package database only), and went to work upgrading.
500 compiled and installed packages later (the last of which are still going) and Jesus is… Well, for the situation, I have to say he’s done pretty darn well. Kudos, me.
Once this is all done?
I think I need a NOS.