Operating system upgrades are a pain in the ass. It's a natural law, right? You have to bring the system down, reboot off a newer install system, upgrade, pray it goes right, then spend days reinstalling things the upgrade broke, migrating applications the upgrade missed, and reconfiguring all your preferences that the upgrade reset back to their defaults. Right?
Well, not always. Sun^WOracle recently issued Solaris 10 u9 09/2010 (not for general use; it's an unsupported developer release), and I took the opportunity to try out the Solaris LiveUpgrade tool. LiveUpgrade makes a complete OS upgrade almost a no-brainer — and as the name implies, you can do it on a running system while continuing to use the system you're upgrading. If you're running on ZFS, you don't even need to mess with any disk filesystems; all necessary changes are done for you automagically.
Here's a capsule summary of the process:
- Mount the OS upgrade DVD image via loopback (yes, you can do this without even burning a physical disc).
- Install the current live-upgrade package from the DVD image.
- Run lucreate to create a duplicate copy of your boot environment.
- Run luupdate to update the duplicate boot environment to the new release. Wait 20-30 minutes while it works.
- Mount the new boot environment at an alternate mountpoint and check the upgrade log to see if it needs any post-upgrade cleanup. Do whatever is necessary. You shouldn't have to touch more than a handful of files. (Unmount it again when you're done.)
- Run luactivate to activate the new boot environment. Wait a couple of minutes while it prepares files and updates the bootloader.
- Reboot the machine via either shutdown -r now or init 6.
- Check that all services restarted cleanly after reboot.
Shazam! That's it. You're DONE. All of your OS packages are upgraded. All of your third-party software is copied over, untouched, exactly as it was. Almost all of your settings are preserved, and anything LiveUpgrade reverted, it told you about and you've already had the opportunity to re-customize it before rebooting. And you still have your original, pre-upgrade OS image to fall back to in the event you run into a problem. (In fact, if you're running on ZFS, you have the original un-upgraded OS, and a snapshot of the original OS at the moment you started lucreate, and a snapshot of the new boot environment right before you ran luupgrade. If you ran into a problem with luupgrade, you can roll the new environment back to that snapshot and re-run luupgrade.)
This is how all OS upgrades should work.