Weblog entry #177 for ajt
At work we have a set of servers running Red Hat Linux 7.x on elderly Compaq hardware. A few weeks ago the production machine stopped without warning or explanation. I still don't know why it failed but a very serious worry is that if any of them fail because of mechanical problems we could be in trouble...
In theory as they are x86 boxes the Windows team can host them on their VMware farm (yes it's ironic that it's based on Linux but there you go...). The problem is that there isn't a simple point-and-drool solution for this and the Windows guys don't do Linux anyway. After the failure, the plan to migrate the boxes off old physical systems and onto new virtual systems received extra impetus.
Most of this week I've been trying to peel the data off a Red Hat Linux 7.1 system (2.4 kernel and lilo boot) and paste it into a VMware container (different SCSI system). There have been many false dawns and errors on my part, but in the end it wasn't actually that bad.
The first stage was to boot the VMware container up with a Debian GNU/Linux live system. I did consider something based on a 2.4 kernel, but they were missing the LSI SCSI drivers and so I just used what I knew best. I then used QtParted to lay out a file system that would work - and made sure I'd introduced no ext2 features that the 2.4 kernel's filesystem couldn't cope with.
Next I mounted the filesystems onto Debian and used rsync and ssh to copy the data, links, and /dev/ nodes from the old system to the new one. It's not pretty or elegant but it does actually work.
I then chroot'd into the new root file system, installed grub and ran grub-install. I had to rebuild the initrd to remove the Compaq SCSI controller card and add the LSI one. The /etc/fstab and a few other files were tweaked and I was done.
Reboot and hey presto it all works.
Well actually it didn't work the first time at all, I made lots of errors on the way, but in principle when I'd done all the right bits in the right order it did work first time. Deleting the /initrd directory was my daftest trick - Red Hat 7 needs it to pivot the root filesystem over at boot...!
It was frustrating at times, but with Google's help and a lot of patience (VMware is very slow) I got it all working. Now all we have to do is pivot the old and new system and we're done...
Comments on this Entry
For what? You're migrating from hardware so old it runs RH7. What is slow?
[ Parent | Reply to this comment ]
Relative to VirtualBox on my desktop system at home, VMware seems very slow to boot. The virtual RH system seems to run slower under VM than it did on it's own antique hardware. I have no figures to back this up, it's propbably just unfamiliartity with the tool and the stress of trying to get things done in a rush.
--
"It's Not Magic, It's Work"
Adam
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
I'm glad you found it useful. It's actually surprisingly easy to move a running Linux system around, even on to different hardware...
--
"It's Not Magic, It's Work"
Adam
[ Parent | Reply to this comment ]