117684 fools suffered gladly since April 4, 1999...

links

rss icon syndication

headlines

Search Past Headlines:

 
contact
legal

All content copyright 1999, 2000, 2001, 2002, 2003, and 2004 Brent Blood. Unless of course it is somebody else's. Or unless I note otherwise for the particular content.

On Disk Migration

Sun, December 2, 2007 - 11:58 AM PST

I slightly impressed myself this morning - I set out to migrate everything from the dying drive in my fileserver to another disk and then to get the system back up and running. For the most part, this seems to be a success. Roughly speaking, here was the process:

First, I had to compile support for the on-board serial ATA controller that my motherboard includes. I hadn't used it before as the original drive was IDE. Next, I had to enable the controller in the BIOS. Then, after a reboot, I was able to partition the new drive and create the filesystems. I copied the existing layout almost down to the block as the old and new disks had the same size (only a few blocks off) and used the same size for the sectors/cylinders/tracks. Then I copied over all the data between the disks using tar piped back into tar with some flags for preserving everything that mattered. I updated the new copies of /etc/fstab and /boot/grub/menu.lst so that they would use /dev/sda rather than /dev/hda. Finally, I installed grub onto the new disk and halted the system.

I unplugged the old disk rather than yanking it just in case I had to boot off of it again, but as luck would have it, the system came up and everything seems to be working. It's not supposed to be this easy... So now the old drive is out and I'll be able to RMA it and my data is all safe and hopefully the server can be stable for a while now.