Upgrading your Debian VPS from lenny to squeeze
Below are my notes recorded when migrating from Debian 5.0 (lenny) to 6.0 (squeeze) on my BitFolk VPS; hopefully others will expand upon it with their own notes.
- Recommended: Move to UUIDs or LABELs in /etc/fstab and /boot/grub/menu.list (kernel and kopt lines) if that isn't already the case.
- Remove clocksource=jiffies from your kopt line if you have it in /boot/grub/menu.list.
- Is your root partition on /dev/xvda1 (as opposed to /dev/xvda)? If so, make sure that fdisk -l /dev/xvda (as root) works. If it doesn't you need to have your /dev/xvda1 device renamed to /dev/xvda. Contact support if that's the case.
- Check if you have xen.independent_wallclock in /etc/sysctl.conf; remove it if you do.
- Ensure you have working console access in case networking doesn't come up
- Recommended: Contact support and request a snapshot of the VPS before upgrading in case it goes wrong
Perform the upgrade
- Add the following to /etc/apt/sources.list for stable (non-security) updates:
deb http://apt-cacher.lon.bitfolk.com/debian/ftp.uk.debian.org/debian/ squeeze-updates main non-free
- The above replaces Debian Volatile, so remove any references to volatile.
- Follow the upgrade instructions at http://www.debian.org/releases/squeeze/i386/release-notes/ch-upgrading.en.html
Before shutting down
The final thing you will want to do to complete your upgrade after upgrading the user land is to shut down and boot into the new squeeze kernel. Before this you'll want to:
- Make sure you have grub-legacy installed.
- Run update-grub as root to see which kernels it finds.
- Make sure that your /boot/grub/menu.lst is actually going to boot into the right kernel. For squeeze this is usually linux-image-686-bigmem.
You're now ready to shut down and boot your VPS again.
|Warning:||DO NOT REBOOT! You need to shut down (using shutdown -h from the VPS, or shutdown from Xen Shell) and boot again from your Xen Shell. If you reboot then the virtual machine will not be restarted; you'll end up booting into the old kernel again.|
Why linux-image-686-bigmem and not -xen?
In earlier releases of Debian, the Debian kernel team were taking the upstream kernel and backporting Xensource patches into it to make Xen work. Thus the -xen flavour of kernels. Since Debian lenny, Xen has been supported by the upstream kernel itself ("pvops") so if you are still using the -xen kernel flavour it is recommended that you instead change to the upstream one.
A straight upgrade will not switch you to this kernel! That's because the -xen kernel is considered a different flavour, so you'll just end up on the most recent -xen kernel package.
Why -bigmem when I only have 480M of RAM?
32-bit Xen guests require a kernel that supports PAE mode even if they don't need to make use of it. That's what the -bigmem in that package name means.
After booting into squeeze
- Make sure all of your services are working properly
After a successful upgrade
- Remember to let support know they can release your VPS snapshot, but make sure everything is okay first.
Alternatives to upgrading in-place
If you can't afford the down time then you might like to take advantage of BitFolk's free offer of a new VPS to migrate to over a period of two weeks.
You can also completely reinstall your VPS yourself to a range of distributions. Upgrading Debian distributions in-place usually works well, however.