A Moodle Diary

Wednesday, July 13, 2005

Moving Moodle: Cloning a Unix System

A while back I got my hands on an old Dell Poweredge 2200 server, that the IT department were getting rid of. It isn't the fastest, or most powerful machine around (and it didn't have a hard drive) but I figured It would probably be a better home for my plodding Moodle demo system that was still running on the old FreeBSD PII desktop machine.

I got a new 18gb, 10,000rpm SCSI HD for the 2200 off eBay and figured I would just clone the HD in the desktop machine onto the new drive. Unfotunately the desktop only had an IDE/ATA drive and an IDE/ATA bus and no SCSI. The 2200 only had SCSI, no ATA. Fortunately the 2200 had a SCSI PCI card that gave an extra internal SCSI bus, as well as an external one. I took this card out the 2200 and stuck it in the desktop, and connected the new HD to it with the ribbon cable out the 2200.

All I had to do now was clone the IDE drive to the SCSI drive, only problem was I didn't have the first idea how to do this :-/ After a lot of googling (these pages were helpful: Cloning a Computer With Free Software, Using DD to clone a HD) and a lot of rummaging around with apropos and man pages on the FreeBSD system, I figured out that using dd was probably the way to go.

dd will carry out a block by block copy of a file to another, and seems to be used a lot for disc level stuff. In Unix systems, all hardware devices appear as files in the file system, eg the SCSI disk driver is the file /dev/da, the 1st SCSI disk is represented by the file /dev/da0, likewise /dev/ad, /dev/ad0 for ATA. This means that doing a dd copy from ad0 to da0 would copy exactly what's on the IDE drive to the SCSI drive, file systems, partition table and all. The command goes:

     dd if=/dev/ad0 of=/dev/ad0


'if' is the input file, 'of' the output file. Unfortunately dd doesn't give any kind of progress indicator, so when I ran the command, I just had to wait for about 90 mins with my fingers crossed :-/

After the dd copy was complete, I tried booting from the SCSI drive and everything seemed OK The system would boot to an sh shell, but not be able to mount partitions listed in fstab, as the entries in this file were hard-coded to point to the ATA drive. Sorting this was simply a case of changing any ad's to da's in the fstab file.

I stuck the SCSI drive into the 2200 and it booted there OK. This system was a good bit faster agian, but the fans in that machine are *really* loud, not an ideal candidate for keeping under your desk ;-)

3 Comments:

Post a Comment

<< Home