|For a couple of years, I’ve been running a Debian GNU/Linux server in-house. The system is small, a 233 MHz Pentium MMX with 128 MB RAM. Initially, it only ran Majordomo with a couple of very small e-mail lists. As new needs arose, I began adding additional services: Samba, mgetty for two incoming fax lines, CVS, Jabber, Bugzilla, etc.
Eventually, with the increasing demands placed on the system, performance became a concern — an upgrade was in order.
A Dell PowerEdge 1400SC with 1.4 GHz Pentium III, 512 MB RAM, and a 4 x 36 GB RAID array using a PERC 3/DCL controller was ordered to replace the old system.
The new server was ordered via 2-day air shipping to arrive in time to potentially spoil my Thanksgiving weekend. It Wednesday, the day before the holiday. We typically take a 4 day weekend. It was clear I was expected to have the new server up and running by Monday morning to avoid any down-time. The company’s experience has typically been with Windows server upgrades. The last one took nearly two weeks before it was 100% complete (a hardware upgrade coupled with an Exchange Server 5.5 to Exchange Server 2000 upgrade).
I found an excellent resource for Linux and Dell PowerEdge servers at Matt Domsch’s Linux page. In particular, the netinst image provided by Steve Mickeler was invaluable.
What follows, is the step-by-step process I went through to upgrade the system. Perhaps my searching skills have failed me, but I have not found HOW-TO style documentation for this type of upgrade. The method I used may, therefore, not be optimal (or even correct). It was surprisingly simple, though — so easy, in fact, that I must have missed something. More experienced Debian admins may be able to point out the shortcomings. If this technique proves to be sufficient, perhaps it will benefit others.
The upgrade process:
- Download the netinst image
- Download Steve Mickeler’s netinst image and create a bootable CD.
- Install a base Debian system
- Use the netinst CD to install a base Debian system on the PowerEdge server.
- Edit /etc/apt/sources.list
- Edit /etc/apt/sources.list to provide access to an appropriate archive (CD, FTP, or HTTP) to obtain the two additional Debian packages required to complete the upgrade.
- Install netcat and pax
- apt-get install netcat pax
- Create a directory
- Create a directory to contain the old server contents and make it the current directory. I used the name of the old server:
- mkdir /minneola; cd /minneola
- Prepare to receive
- Pick an arbitrary port to listen on and prepare to receive the contents of the old server:
- nc -l 2666 | pax -rvp e
- Prepare to send
- Prepare the old server to transfer data. First enter single user mode to stop services and prevent changes to the file system during the transfer:
- telinit 1
- Un-mount foreign devices
- umount any all nfs, smb, cdrom, and other devices that are not part of the file system you wish transferred.
- Transfer top-level directories
- Transfer selected top lever directories to the new system:
- cd /
pax -wv bin etc home lib root sbin usr var | nc -w 3 172.16.1.20 2666
- In my case, this set of top level directories contained all of the data I needed. The new server had been configured with a static address in the private addressing range we use in-house. I relied on the new system’s existing mnt, boot, dev, and tmp directories and the cdrom and floppy mount points. My case was also simplified by the fact that I used a single, large partition on both the old an new systems.
- The transfer time depends upon the amount of data to transfer and the speed of your network connection. In my case, it took about 2.5 hours to complete the transfer. The -v option used on the pax command will provide enough output to help you gauge the progress.
- Reboot from CD
- Reboot the new system using the netinst CD. When booted, start a shell and mount the the appropriate hard disk volume. In my case, that was /dev/sda5. I used the existing /mnt directory as a mount point. Make the mounted directory current.
- mount /dev/sda5 /mnt
- Copy hardware specific files
- Copy the three files with hardware specific configuration from the root directory into the old server tree:
- cp /etc/modules minneola/etc/modules
cp /etc/fstab minneola/fstab
cp /etc/lilo.conf minneola/lilo.conf
- Move kernel modules
- Move the kernel modules to the old server tree:
- mv /lib/modules/2.4.19-ac4 minneola/lib/modules
- Replace top-level directories
- Replace the top-level directories with the old server copies and remove the empty directory that held the old server tree.
- for i in bin etc home lib root sbin usr var; do
rm -fr $i
mv minneola/$i .
- Reboot the new server and you’re done!
This procedure work well for me. I started the process at 7 PM and was
completely finished by 10 PM preserving my 4-day, holiday weekend. All the services came up without a problem and everything seems to be running well. I wonder, however, if I’ve missed anything important. Are there other hardware specific files I should copy from the old server or edit on the new server other than the three listed above?
I suspect I re-invented the wheel and documentation exists describing how to migrate from one system to another with dramatically different hardware. Where is that documentation?
Comments are welcome.