Known, but underused Solaris Features: Live Upgrade
How to change the world ?
Once in a while root saw some imperfections in his world. He had change some things. But root couldn´t stop the turning of the world for hours as people lived in this world. Because of root´s special powers, root was able to create a second world without people. Thus root created a second world as an exact copy of the old world. And now root was able to work on the imperfections of his world as long as root wanted. Then he behold and all was good. A magic chant late at night when all people slept and the people woke up in the new world. What´s Live Upgrade
Okay, Live Upgrade isn´t really a “less known feature”, but in the time working at the keyboard at several customer sites, i´ve got aware of a fact: One of the most simple, but brilliant feature of Solaris is a somewhat unused feature. The feature is called Live Upgrade. We´ve got painfully aware of two facts in the past: At first … yes, we know of our somewhat suboptimal patch process. And: You can´t expect updates of the operating environment when you have to bring down the machine for some time. Thus Sun introduced a feature called Live Upgrade. Okay, Live Upgrade is so easy that nobody has an excuse not to use it. And with 6 GB size of the SOE and 73 GB boot disks minimum “no space” isn´t an excuse too ;) The concept behind Live Upgrade
The basic concept behind Live Upgrade is pretty simple. All mechanisms are grouped around the concept of alternate boot environments. At first you have your running boot enviroment and a emtpy slice or disk (the symbol with the thick lines is the active boot environment).
Now you create an alternate boot environment. It´s a copy of the actual boot environment. The system still runs on this environment.
The trick is: The update/patch processes doesn´t work on the actual boot environment, they use this alternate but inactive boot environment. The running boot environment isn´t touched at all.
After the completion of the updating you have an still running boot environment and a fully patched and updated alternate boot environment. Now the boot environments swap their roles with a single command and a single reboot.
After the role swap the old system stays untouched. So, whatever happens with your new installation, you can fall back to you old system. In case you see problems with your new configuration, you switch back the but environments and you run with your old operating environment.
A hint for testing this
Use some spare equipment. I´ve used my MacBook Pro for the first try, and it took forever. Do yourself a favour and don´t use a virtual environment. At least use a real DVD and not an ISO to prevent the harddisk from jumping around. Using Live Upgrade without Updating
Okay, i will present two usecases to you: The first one doesn´t exactly match to the “upgrade” moniker. It´s a solution for a small problem: You´ve installed your system and after a few weeks you realize, that you filesystem model wasn´t the best choice. /export/home to large, / to small. and a seperated /var would be nice. Okay, how you seperate those filesystems without a longer service interuption. Bringing the system down, moving files around, booting it up is not an option for productive system. Moving while running isn´t a good idea. Live Update is a nice, but simple solution for this problem: Live Upgrade replicates the boot environments by doing a file system copy. The filesystem layout of the old boot environment and the new environment doesn´t have to be the same. Thus you can create a filesystem layout with a bigger /, a smaller /export/home and a seperate /var. And the best is: The system runs while doing this steps. In my example i will start with an operating system on a single partition. The partition is located on
/dev/dsk/c0d0s0 and has the size of 15 GB.
At the installation time i´ve created some additional slices.
c0d0s6. Each of the slices has the size of 10 GB.
Seperating the the single slice install to multiple slices is nothing more than using Live Upgrade without upgrading. At first i create the alternate boot enviroment:
We´ve successfully created a copy of the actual boot environment. But we told the mechanism to put / on c0d0s3, /usr on c0d0s4 and /var on c0d0s5. As this was the first run of Live Upgrade on this system the naming of the environment is more important than on later runs. Before this first run, the boot environment has no name. But you need it to tell the process, which environment should be activated, patched or updated. Okay, my actual enviroment runs with Solaris Express CE build 78, thus i´ve called it “sx78”. The lucreate command set this name to the actual enviroment. My new boot environment has the name “sx78_restructured” for obvious reasons.
Okay, now you have to activate the alternate boot environment.
Now we have to reboot the system. Just use init or shutdown. If you use any other command to reboot the system, Live Upgrade will not switch to new environment:
Okay, this takes a minute. But let´s have a look on the mount table after the boot.
Mission accomplished. Okay, but we want to use LiveUpgrading for upgrading, later. Switch back to your old environment:
Boot the system. And your are back on your old single-slice installation on
Using Live Upgrade for upgrading Solaris Express
With a new Solaris Express Community Edition every week a Live Upgrade procedure is a good practice to update your system to a new release of the operating system. Okay, i´ve burned a DVD with the Solaris Express Community Edition Build 81. I want to upgrade the exisiting boot environment on the three slices. Just to keep the naming in line, i rename it so sx81.
You don´t have to rename it, you just could use the old name. But why should you confuse your fellow admins by calling your Build 81 boot environment
Okay, now start the upgrade. My installation DVD was mounted under
/cdrom/sol_11_x86 by Solaris and i want to upgrade the
sx81 boot environment. This will take a while. Do this overnight or go shopping or play with your children. Your system is still running and the process will not touch your running installation:
Okay. Let´s check the
/etc/release before booting into the new environment:
Activate the new boot environment:
Eject the installation DVD and reboot the system:
Wait a minute, login to the system and let´s have a look at
By the way, the system runs on the three seperated slices now:
Neat, isn´t it ?
Do you want to learn more ?
Solaris 10 8/07 Installation Guide: Solaris Live Upgrade and Upgrade Planning » Upgrading With Solaris Live Upgrade</blockquote> Others
Solaris[TM] Live Upgrade Software: Minimum Patch Requirements(the infodoc formerly known as 72099)