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.
/ on /dev/dsk/c0d0s0 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1980000 on Mon Feb 11 21:06:02 2008
At the installation time iīve created some additional slices.
c0d0s3 to
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:
# lucreate -c "sx78" -m /:/dev/dsk/c0d0s3:ufs -m /usr:/dev/dsk/c0d0s4:ufs -m /var:/dev/dsk/c0d0s5:ufs -n "sx78_restructured"
Discovering physical storage devices
[..]
Populating contents of mount point >.
Populating contents of mount point .
Populating contents of mount point .
[..]
Creation of boot environment successful.
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.
# luactivate sx78_restructured
Saving latest GRUB loader.
Generating partition and slice information for ABE
Boot menu exists.
Generating direct boot menu entries for ABE.
Generating direct boot menu entries for PBE.
[..]
Modifying boot archive service
GRUB menu is on device: .
Filesystem type for menu device: .
Activation of boot environment successful.
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:
# init 6
Okay, this takes a minute. But letīs have a look on the mount table after the boot.
# mount
/ on /dev/dsk/c0d0s3 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1980003 on Tue Feb 12 05:52:50 2008
[...]
/usr on /dev/dsk/c0d0s4 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1980004 on Tue Feb 12 05:52:50 2008
[...]
/var on /dev/dsk/c0d0s5 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1980005 on Tue Feb 12 05:53:12 2008
Mission accomplished. Okay, but we want to use LiveUpgrading for upgrading, later. Switch back to your old environment:
# luactivate sx78
Boot the system. And your are back on your old single-slice installation on
c0d0s0:
/ on /dev/dsk/c0d0s0 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1980000 on Mon Feb 12 06:06:02 2008
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.
# lurename -e sx78_restructured -n sx81
Renaming boot environment to .
Changing the name of BE in the BE definition file.
Changing the name of BE in configuration file.
Updating compare databases on boot environment .
Changing the name of BE in Internal Configuration Files.
Propagating the boot environment name change to all BEs.
Boot environment renamed to .
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
sx78_restructured.
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:
# luupgrade -u -n sx81 -s /cdrom/sol_11_x86
Copying failsafe kernel from media.
Uncompressing miniroot
[...]
The Solaris upgrade of the boot environment is complete.
Installing failsafe
Failsafe install is complete.
Okay. Letīs check the
/etc/release before booting into the new environment:
# cat /etc/release
Solaris Express Community Edition snv_78 X86
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 20 November 2007
Activate the new boot environment:
# luactivate sx81
Saving latest GRUB loader.
Generating partition and slice information for ABE
Boot menu exists.
Generating direct boot menu entries for ABE.
Generating direct boot menu entries for PBE.
[...]
Modifying boot archive service
GRUB menu is on device: .
Filesystem type for menu device: .
Activation of boot environment successful.
Eject the installation DVD and reboot the system:
# eject
cdrom /dev/dsk/c1t0d0s2 ejected
# init 6
Wait a minute, login to the system and letīs have a look at
/etc/release again:
bash-3.2$ cat /etc/release
Solaris Express Community Edition snv_81 X86
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 15 January 2008
By the way, the system runs on the three seperated slices now:
/ on /dev/dsk/c0d0s3 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1980003 on Tue Feb 12 07:22:32 2008
[..]
/usr on /dev/dsk/c0d0s4 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1980004 on Tue Feb 12 07:22:32 2008
[..]
/var on /dev/dsk/c0d0s5 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1980005 on Tue Feb 12 07:22:54 2008
Neat, isnīt it ?
Do you want to learn more ?
Documentation
Solaris 10 8/07 Installation Guide: Solaris Live Upgrade and Upgrade Planning >> Upgrading With Solaris Live Upgrade
Others
Solaris[TM] Live Upgrade Software: Minimum Patch Requirements(the infodoc formerly known as 72099)