Fixing a whine by replacing a drive

Tuesday, January 29th, 2008 at 10:47pm

For the past few months the primary 120GB drive in Preston has been making a whining sound. It was gradually getting louder and even getting really annoying for short periods.

Back when I last refreshed the storage drives in Preston I was left with a pair of 160GB drives. One went into my windows box while the other went into an external case that I intended to use for backups. Even though I did find an external case with an internal power supply, I have yet to get one. Which means the the 160GB in the external case has had very little use in the past 15 months.

At the end of last year I refreshed the drives in Shaun, my windows box. From this I ended up with a 250GB drive that I put into the external case, freeing up the 160GB again.

Tonight I finally got fed up with the whine and I decided to swap out the whining 120GB drive by following one of many sets of instructions that I found after a search. Specifically the second response to this question, modified as appropriate.

For my future reference I entered the following after adding the new drive (as /dev/hdb) and booting into single user via one of the ‘Recovery’ boot options:

(three data partitions: /, /home, /backup)

$ fdisk -l
$ cfdisk /dev/hdb
$ mke2fs -j /dev/hdb1
$ mke2fs -j /dev/hdb3
$ mke2fs -j /dev/hdb4
$ mkswap /dev/hdb2
$ cd /
$ mount /dev/hdb1 /mnt
$ find . -xdev | cpio -padm /mnt
$ mount /dev/hdb3 /mnt/home
$ cd /home
$ find . -xdev | cpio -padm /mnt/home
$ cp -a /dev/* /mnt/dev/
$ cd /
$ chroot /mnt
$ mount -t proc none /proc

At this point I followed the instructions for installing GRUB on the new drive. Once I pulled out the old drive I found that the new one wouldn’t boot. Putting the old drive back in (now as /dev/hdb) I told the BIOS to boot from it which got me back into single user mode (boot loader from old drive, but new drive for partitions). I then found another set of instructions which told me to use the following which worked:

$ grub-install /dev/hda

I purposely didn’t copy the 60GB of backups from other computers in the house (mostly photos) between drives as their regular processes will copy it back if I leave them on overnight.

Despite warnings to the contrary, I didn’t have an issue with GRUB and the UUID of the drive as I am still running Ubuntu 6.06 LTS, If I was running 6.10 or later I believe I would have had an extra step to perform.

Tagged with: ,