Jeb Wilkins

Coding and climbing in Cumbria.

Fun With Servers

A couple of weeks back the hard disk in our office server died, like many offices this is an old computer in the corner with just a single disk running debian. At the time I got it back up quite quickly, and just pulled all data from the previous nights backup. At the time I vowed to get it running with a proper RAID 1 setup, but instead had to rebuild it quickly with the single working spare disk we had lying round the office. So yesterday I set about migrating from an old PATA disk to a pair of shiny 500Gb SATA drives plus new controller, since I’ve not setup RAID by hand before this was a good challenge.

Initially I just took the server down, added the new disks and rebooted to minimise disruption in the office. Getting moving the system across proved surprisingly simple, if slightly scary, my recipe is still in work so I’ll post that in an update tomorrow. Short form is get all the raid arrays setup, go to run level 1, copy data across, install grub into the boot sector of each new disk (that way either disk can boot the system if the other fails), cross fingers, reboot. Editing /etc/fstab and /boot/grub/menu.lst as you go. Last night I left it copying a couple of hundred gigs of data across and rebooted this morning and thankfully it all went to plan. The only down time was overnight whilst it copied files across and few minutes yesterday to put the disks in.