Bare Metal Linux Restore

Several weeks ago we started seeing some pretty scary errors showing up on the main system disk for our Blackboard server. We had an extra server hanging around, so we decided to move all the data off the failing disk and onto our spare server. The only question was how to make the new server as close to a perfect copy of the old one as possible. Simply restoring all the filesystems failed for a variety of reasons, mostly related to GRUB and the kernel, so I had to find a way of excluding only the files and directories that were tied to the specific model of server.

To do this, I started by installing a minimal copy of RHEL 4, making sure to lay the filesystems out in exactly the same way as they were on the old server. I then went through several experiments, leaving just the bare minimum files and directories required for the hardware and booting, but formatting all other filesystems and restoring the data from our old server. In the end, the below process resulted in system that worked perfectly, and very closely mirrored the original server.
Continue reading

RHEL3 Upgrade to RHEL4 Breaks up2date

Last week I had to upgrade one of our old RHEL3 servers in order to get it to address disks larger than 2TB. I did the upgrade from CD, and it went fairly smoothly, except up2date would not run after the box came back up.

It gave me the following error:

[root@x up2date]# Traceback (most recent call last):
  File "/usr/sbin/up2date", line 27, in ?
    from up2date_client import repoDirector
  File "/usr/share/rhn/up2date_client/repoDirector.py", line 5, in ?
    import rhnChannel
  File "/usr/share/rhn/up2date_client/rhnChannel.py", line 10, in ?
    import up2dateAuth
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 5, in ?
    import rpcServer
  File "/usr/share/rhn/up2date_client/rpcServer.py", line 23, in ?
    from rhn import rpclib
ImportError: No module named rhn

It turns out that there is no “really easy” way to fix it, but these directions on spaceblog do work. Basically it involves removing a lot of packages and re-adding them. The problem is related to python, so rather than remove the entire list of packages, I focused only on those relating to python and up2date:


libxml2-python
popt
pyOpenSSL
python
rhnlib
rhpl
up2date

Make sure not to remove these packages:


rpm
rpm-libs
rpm-python

Or you will break rpm and not be able to add the packages back after you remove them. All told, this is a grisly process, and you will have to use rpm -e --nodeps in order to get it done. This sucks, but up2date will work everything out once you can get it running again.