After upgrading my new server from Lenny to Squeeze, I noticed that the iWeb default install on this machine had the swap partition on a mirror. Not that I expect this machine to be doing much swapping, but I figured I should fix it anyways. To destroy the array and make those partitions “plain” swap partitions, follow these steps:
### find out which array is the swap partition and see who the members are
### fstab told us md1 is the swap partition and xvda5 and xvdb5 are the member partitions in that array
### turn off swap
### stop the array and delete the superblocks. without zeroing the superblocks the array will still be auto-assembled at boot and we'll get no swap
mdadm --stop /dev/md1
mdadm --zero-superblock /dev/xvda5
mdadm --zero-superblock /dev/xvdb5
### use fdisk to change the partition types for xvda5 and xvdb5 to "82 Linux swap / Solaris"
fdisk /dev/xvda #(t, 5, 82, w)
fdisk /dev/xvdb #(t, 5, 82, w)
### take the reference to /dev/md1 out of mdadm.conf (1 less error message at boot)
### modify fstab - change the reference to /dev/md1 to /dev/xvda5, then add another line for /dev/xvdb5
### reboot if you want to make sure it's all happy at boot time
I mainly wanted to do this so that if the swap space is ever actually being used, the system won’t have to mirror every write to the other drive. I’ve also read that linux is smart enough to distribute writes to swap space between partitions if more than one are available, which makes sense to me but I’d have to confirm that rumor. This change will potentially cut down on a bunch of CPU usage and IO at some point in the future, and a side benefit to doing this is that we have increased the amount of swap space from 2GB on this system to 4GB.
Still don’t want to ever use it though…
iWeb currently only offers Debian Lenny as a pre-install option on these servers, but since Lenny is dead as of February 2012 I wanted to start with Squeeze. I tried the upgrade process from the debian.org site linked below first, but my server didn’t reboot properly after the GRUB2 install and I couldn’t even connect to the VNC console of my VM. Since the hardware is about a bazillion miles away I don’t know if there’s anything I could have done from the console to fix grub and rescue the install; my only option was the auto re-image in the iWeb control panel. I re-imaged the server with Lenny and while that was happening I did a bunch of reading about other people having fun with the new grub.
This is just a quick step-by-step. Basically the standard instructions break grub-pc (GRUB2) on this Xen-based system. Follow along until the end, then remove grub-pc and re-install grub-legacy. Your system will then be ready to go!
All of this information is here: http://www.debian.org/releases/stable/amd64/release-notes/ch-upgrading.en.html but this page is far less reading.
Also, if your system is not a “stock” Lenny install, i.e. with 3rd party deb sources and a bunch of custom stuff, your mileage may vary. I did this to a fresh, new server before anything else.
apt-get purge splashy
### Change all references of "lenny" to "squeeze"
### Need to find our architecture which turns out to be "xen-amd64"
apt-get install linux-image-2.6-xen-amd64
apt-get install udev
### When asked if you want to chainload GRUB2, say "NO"*
apt-get install grub-legacy
### enjoy Debian Squeeze!
*Answering “NO” here tells the installation script to just go ahead and fully install GRUB2 and not mess with the legacy grub .conf file and fart around with chainloading and stuff. I just felt better uninstalling a “complete” GRUB2 install rather than a half-assed hodge-podge of grubbery.