Skip to main content

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.

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.

Popular posts from this blog

Fixing sendmail take a long time to start

I notice that my database box[FC6+Oracle10.2] take along time to startup. Sendmail and sm-client very very slow to start[ about 5 minutes ]. There's something wrong in /etc/hosts file. 'newalises' command take long time to update and finish with error below. [root@ora10g ~]# newaliases WARNING: local host name (ora10g) is not qualified; see cf/README: WHO AM I? /etc/aliases: 76 aliases, longest 10 bytes, 765 bytes total [root@ora10g ~]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost 192.168.1.55 ora10g [root@ora10g ~]# To fix this, custom hostname[ora10g] need to append to localhost line in /etc/hosts. [root@ora10g ~]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost ora10g 192.168.1.55 ora10g [root@ora10g ~]# newaliases /etc/alia...

Too many open files

Last week tomcat log file report many error about "Too many open files" when it has high traffic. Some in catalina_log say 2007-04-07 16:13:40 HttpProcessor[80][272] Starting background thread 2007-04-07 16:13:40 HttpConnector[80] accept: java.net.SocketException: Too many open files and here is from localhost_log 2007-04-07 16:13:40 StandardWrapperValve[myservlet]: Servlet.service() for servlet myservlet threw exception java.io.FileNotFoundException: /home/log/mylog_070407.log (Too many open files) This is because too many file descriptors're opened by tomcat. File descriptor can be limited in both system level and shell level. To check maximum number of fd in system type 'cat /proc/sys/fs/file-max'. In my case it is 65536(someone said it should set to 200000). Tomcat error when try to open socket number 272 so I think 65536 is ok for me for now. Anyway if u want to set it add 'fs.file-max = 200000' to /etc/sysctl.conf pnix@pnix-a7:~$ cat /proc/sys/fs/fil...

Setup MySQL with Ofbiz

Download ofbiz weekily build and extract it somewhere you want. From your ofbiz directory, edit file entityengine.xml in framework/entity/config add new datasources below localmysql datasource part <datasource name="custommysql" helper-class="org.ofbiz.entity.datasource.GenericHelperDAO" field-type-name="mysql" check-on-start="true" add-missing-on-start="true" check-pks-on-start="false" use-foreign-keys="true" join-style="ansi-no-parenthesis" alias-view-columns="false" drop-fk-use-foreign-key-keyword="true" table-type="InnoDB" character-set="latin1" collate="latin1_general_cs"> <read-data reader-name="seed"/> <read-data reader-name="seed-initial"/> ...