|  About Me  |  Blogs  |  Photos  |  Publications  |  Resume  | 

Hard Disk Failure

Today my laptop hard disk started making very loud clicking noises.
The unanimous opinion is it’s just the matter of time before it
dies, apparently many people has gone through the same agony.
The only question left is: can I backup the disk drive before it
retires for good?

Backup

I have 3 partitions: Linux (5G), VFAT (3GB of shared data) windows NTFS (10GB).

I was told that the fastest way to backup the linux partion is to make a dump of the whole partition to a server, i.e.

$ dump -0f - / | ssh anniec@server "cat > /tmp/backup-suvereto-root.dump"

It was too unnerving to site there and watch it click away, actually
it was more scary when it suddenly became quite for a while. I took a
book to another room and came back several times to check, finally
after three hours it finished dumping my 5GB linux partition to a local
server.

VFAT partition contains only data files so just need to tar it up and upload on server:

$ tar cvf - /mnt/shared | ssh anniec@server "cat > /tmp/backup-suvereto-vfat.tar

I dont’ have much data on my windows partition so I’d rather get a fresh installation.

Restore

IS replaced me with a new 60GB hard disk (I had 20GB before)! I always believed something good could come out of this misfortune. The disk came with windows preinstalled so I need to restore linux myself.

First I need to boot of linux from the old disk and have the new disk as secondary drive. Then partition the new disk (/dev/hdc) with fdisk. The new partition table looks like:

$ fdisk -l /dev/hdc

Disk /dev/hdc: 60.0 GB, 60011642880 bytes
240 heads, 63 sectors/track, 7752 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1   *           1        2709    20480008+   7  HPFS/NTFS
/dev/hdc2            2710        4064    10243800    f  W95 Ext'd (LBA)
/dev/hdc3            4065        4130      498960   82  Linux swap
/dev/hdc4            4131        7752    27382320   83  Linux
/dev/hdc5            2710        4064    10243768+   b  W95 FAT32

I don’t know why IS put my FAT32 partition in an extended partition of the same size, this would make resizing the partition more difficult later I think. I’ll get rid of it later.

Then restore the linux partition from the dump, need to mount the partition first i.e.

$ mount /dev/hdc4 /mnt/tmp
$ cd /mnt/tmp
$ ssh anniec@server "cat /tmp/backup-suvereto-root.dump" | restore -rf -

This will take a while, went for dinner… done. Check if all the files are there, check size with df -H.

Now put the new disk in the main drive. Lilo’s not written yet, so we need to boot into linux with a debian CD. Insert CD, boot from CD, at CD boot prompt use rescue option and specify root partition, e.g. rescbf24 root=/dev/hda4. This should boot into your old linux on the new disk. Change lilo and fstab to reflect new device structure, e.g.

root=/dev/hda4

Run lilo.

# <file system> <mount point>   <type>  <options>       <dump>  <pass>

/dev/hda4	/		ext3	errors=remount-ro	0	1
/dev/hda3	none		swap	sw			0	0
proc		/proc		proc	defaults		0	0
/dev/fd0	/floppy		auto	user,noauto		0	0
/dev/cdrom	/cdrom		iso9660	ro,user,noauto		0	0
/dev/hda5	/mnt/shared	vfat	rw,user,exec,umask=0000	0	0
/dev/hda1	/mnt/ntfs	ntfs	ro,user,umask=0222		0	0
/dev/hde1	/mnt/cf		vfat	rw,user,noauto,umask=0000	0	0

Reboot… got lilo boot prompt, horray!

Disk Monitoring Tools

There a package called smartmontools that controls and
monitors the health of storage systems using S.M.A.R.T. I heard it can give you warning bofore your harddisk is about to die. Actually when I
ran it on my old hard disk the diagnose was healthy. Go figure.

Leave a Reply

You must be logged in to post a comment.