9/15/07

Ubuntu kill your hard drive???

I've got a problem with my desktop box again and look like it's happen periodically [every 5 months I think]. In the box, I have two hard drives. The new one, sata, is installed as dual boot disk, feisty and xp and another is 5 years old ide. I use it to store some unimportance files. Yesterday I start up ubuntu and can't mount the old one. It made some noise at boot time but this is nothing weird, It's sound terrible like this every day. The difference is this time it can't mount.

Until now I still not sure my old ide is bad. Almost parts in the box are almost 5 years old, it can die at anytime. Maybe it's power supply, I don't know, it run at least 5 hours a day everyday for almost five years. Anyway my main SATA still healthy.

I found this thread on ubuntuforums, he said ubuntu kill his laptop drive.

This is because upon power off, the kernel sends the FLUSH CACHE message to the disk to flush the disk write cache, which cause it to spin up. Then it suddenly shuts down making no call to the STANDBY signal to make the disk stop. The result is that the hdd keeps spinning as the power is off. Modern hdd's (yours, if it works after rebooting), can prevent such damage by taking the head off the disk surface just after power down so it does not hurt the disk in such situation. This is called an emergency unload. Technical specifications say doing this instead of the regular standby can reduce the drive's life time by about a rate of thrity (30) times. The symptoms of this is a weird noise upon shutdown (power off). It is like a "pop"!


It's sound like it's laptop only bug and thanks for Martin Ko├čler for his shutdown disk scripts.
Simply write a file at "/etc/rc0.d/S00hdd-shutdown-workaround" which includes this two lines:

#!/bin/sh
echo 1 > /sys/class/scsi_disk/0\:0\:0\:0/stop_on_shutdown

If you have more than one directory at "/sys/class/scsi_disk/" try to find out which of it is your internal harddisk (e.g. "cat /sys/class/scsi_disk/a:b:c:d/device/model") If you have more than one harddisk add another line for each of them.

Then make it executable ("chmod +x filename")
At the next shutdown it should park the hd heads.

1 comments:

Joao said...

Thanks!
I had this problem on my netbook with Ubuntu back in 2010. The only way to fix it was to change to Fedora 14. Now I'm getting the same problem with Fedora 18 and Xubuntu 12.04 but all was fixed with this tip. You saved my hard drive.