BigAdmin System Administration Portal
Feature Article
Print-friendly VersionPrint-friendly Version

Using Solaris Live Upgrade for the x86 (and SPARC) Platform

By Alan DuBoff

It is my hope that this document will encourage more people to use Sun's Solaris Live Upgrade software. Even though I'm writing here about the Solaris Operating System, x86 Platform Edition, the information is applicable to the SPARC Platform Edition as well.

The Solaris Express program is now offered as an option for Sun's customers to gain early access to the next Solaris release. This program is updated every month. We highly encourage people to download and install these early releases so they will have access to new features coming in the Solaris OS.

When we access early releases, we may start running into situations where we have two or three different environments that we might want to either test or develop on. Live Upgrade is a means to boot between these multiple environments. It upgrades the environment so that it will be as close as possible to what existed in the environment you copied from.

Sun provides product documentation on http://docs.sun.com/, so you can reference that site for specific technical diagrams and various information.


Example: Booting Between the Solaris 9 FCS and the Current Solaris Express Release

Let's start out simple. I have a system that I would like to boot between the Solaris 9 FCS release and the current Solaris Express release, which comes out every month.

I'm going to partition a single 40-Gbyte disk on an x86 system to accomplish this. Live Upgrade will handle more than a single disk, but in the most basic case I want to demonstrate how a person with only a single disk can benefit from Live Upgrade, using the Solaris 9 OS and Solaris Express.

Important note: It is not possible to do a downgrade. Downgrading is not supported by Sun tools, including Live Upgrade.

Here's another reason we need to understand that there are no downgrades. All of the changes that you've made to your system, including file permission changes and file system changes, are moved to the new system. This will include symlinks you've changed, software you've installed, packages you've installed, and so on.

As you might imagine, this could take quite some time, so in some cases it's best to copy a boot environment with as few changes done to it as possible, at least for time considerations. However, for convenience, it's certainly worth the time to have Live Upgrade copy those changes for you, creating the same environment you were using on a newer release of Solaris. This is of course the concept behind Live Upgrade.

For the example we're going to create, see Figure 1, and refer to the example for one hard disk.

This fits our scenario where we have three roots: one is our current release, and the other two are upgraded to Solaris Express builds. In this case, I would like to install Solaris 9 update 6 as the current release, and before we add many changes, create the second boot environment for the current release of Solaris Express. Later we'll create and update a future Solaris Express build.

Live Upgrade

Figure 1: Creating a Boot Environment -- Copying from root (/) to root (/)

The example here of using two hard disks shows how you would incorporate Live Upgrade for that scenario. You may have three or more hard disks, and the roots can go on any of the slices within a Solaris partition.

I would like to point out that /, /var, /usr, and /opt are all needed for the Live Upgrade. These are referred to as the Solaris required file systems. These file systems must be copied when a new boot environment is created. They cannot be shared between multiple boot environments. They cannot be excluded from copying when a new boot environment is created. For ease of explanation I will plan on all of these being in the root partition depicted in Figure 1 for one hard disk.

I would also like to point out that /export will be shared among all of these boot environments. You could have many partitions that are located across any number of disks, and you'll find that Live Upgrade is very flexible in that regard. In general, if a file system is mounted and has an entry in /etc/vfstab at the time a new boot environment is created, that file system will be shared between the current boot environment and the new boot environment. The exceptions are the Solaris required file systems (/, /var, /usr, and /opt), which may never be shared.

What we should now have per Figure 1 is one large Solaris partition that has three root slices, one shared swap slice, and one shared export slice. Let's assume that we've partitioned our single 40-Gbyte drive as such. We gave 9 Gbyte for each root slice, 500 Mbyte for our swap partition, and the remaining 10-12 Gbyte for our shared export.

After the install described here, you should remove the additional root partitions if you have them loaded in your /etc/vfstab, because if they're attached to a mount, the Live Upgrade utilities won't be able to use them.


Installing Live Upgrade Tools

The first thing you must do before using Live Upgrade is to install the latest Live Upgrade tools from the update release you're going to install. You can't go backward in releases, only forward, so the most recent Live Upgrade tools must be installed from the media that you are upgrading to.

You can install the latest Live Upgrade tools by going to CD 2 of 2, and executing the installer as follows:

  • (For Solaris 9)
    Solaris_9/Tools/Installers/liveupgrade20
  • (For Solaris 10)
    Solaris_10/Tools/Installers/liveupgrade20

This will install the latest utilities for you to use.

You must install the latest Live Upgrade utilities before performing an upgrade. If the level of utilities is the same, WebStart should tell you that the same level is already installed.

Alternatively, you can use the package commands directly to do this. First you remove the existing Live Upgrade packages:

pkgrm SUNWluu SUNWlur

Then you add the new Live Upgrade packages from the Solaris install media:

pkgadd -d /cdrom/cdrom0/s2/Solaris_9/Product SUNWlur SUNWluu

Creating Another Boot Environment

The first thing you'll need to do is create another boot environment.

The preferred way to use Live Upgrade is by means of the command-line interfaces:

luactivate
lucancel
lucompare
lucreate
lucurr
ludelete
ludesc
lufslist
lumake
lumount
lurename
lustatus
luumount
luupgrade

Manual pages in section 1M are available for each Live Upgrade command, as well as for live_upgrade(5).


Using the lu(1m) Interface with Solaris Live Upgrade

As root, execute the lu utility, and select Create. For the new boot environment, select your partition: You can do that by selecting F2, which will offer you a choice.

Note: You should have taken out any mounts from your /etc/vfstab for boot environments that you created when you initially installed the Solaris OS. They should not be mounted or listed in /etc/vfstab. You can rename your initial install so that the boot environment has a name reflecting the distribution, rather than the name of the disk as it defaults.

You can use the same swap you had, or another if you like. In most cases, people want to use the same swap. By default the same swap devices will be used unless one new swap device is specified, in which case only the new swap devices given will be used.

The following instructions refer to using the lu(1M) command to access Live Upgrade. This command is deprecated and will not be supported in the future. Among other issues, lu(1M) only provides access to a subset of the total Live Upgrade functionality. Also, lu(1M) cannot be internationalized and only displays U.S. English text.

After you have selected the "/" partition (which includes /var, /opt, and /usr by default), select F3 to save. Be patient as lucreate copies the information to the new boot environment. If you would like to use different partitions for /var, /opt, and /usr, you should do so before saving the boot environment.


Performing the Upgrade

After creating a second boot environment, it's finally time to perform the actual upgrade. As root, enter the lu utility and select the Upgrade option. You will now be prompted for the name of the boot environment, along with the package media. Enter the name of the boot environment you created in the preceding steps, and give the path to the Solaris package media. The package media can be a network install, or the CD media; either works just fine. Remember that if you use the CD media, you'll need to perform two steps here, one for CD 1 of 2, and one for CD 2 of 2. Any number of additional CDs can be used as well, and packages can be selected from them if you want to include only the given ones.

In the case where you use a network install image of Solaris (which can be created from the CDs), you'll need to point the package media to the directory in which you installed the network install. You could have installed it to any location (for example, you might have installed to /export/install/S10_51). Enter the path where you have installed it.

For the case where you use CD media, you'll first need to put in CD 1 of 2, and enter /cdrom/cdrom0/s2. When you want to add CD 2 of 2, put /cdrom/cdrom0 as the package media path.


Using the Live Upgrade Command-Line Interfaces

You may also use the command-line utilities to perform these functions, and you could create a boot environment with:

# lucreate -n S10_51

If you don't enter the disk to be used (as in the preceding example), a dialog box will provide valid choices for you to select from.

To create a new boot environment with the "/" file system on /dev/dsk/c1t0d0s0, use this:

# lucreate -n S10_51 -m /:c1t0d0s0:ufs

To create a new boot environment with the "/" file system on the SVM mirror d10, which contains two submirrors c1t0d0s0 and c2t0d0s0:

# lucreate -n S10_51 -m /:d10:mirror,ufs -m /:c1t0d0s0:attach -m /:
c2t0d0s0:attach
Then you can upgrade with the following command for the first CD:

# luupgrade -u -n s10_51 -s /cdrom/cdrom0/s2

And then follow it up with the second CD:

# luupgrade -i -n s10_51 -s /cdrom/cdrom0 -O "-nodisplay -noconsole"

If you need to install language CDs, repeat the preceding command with each language CD required.

If you have a combined install image available on the network at /net/server/export/s10_51/sparc, use this:

# luupgrade -u -n s10_51 -s /net/server/export/s10_51/sparc

Of course, there are many arguments you can pass on the command line if you wish to do so; please refer to the man pages or the online documentation to understand all of the correct ones.


Activating the Boot Environment

Now that the boot environment has been upgraded to S10_51, only one small step remains. Activate it!

For all practical purpose, let's say that I renamed my first boot environment to S9_U6, and the second boot environment was named S10_51. In this case S10_51 was live upgraded from S9_U6, and S9_U6 is still active. You can get a status by executing:

# lustatus

This should show your output as follows:

Boot Environment       Is       Active Active    Can    Copy      
Name                   Complete Now    On Reboot Delete Status    
---------------------- -------- ------ --------- ------ ----------
S9_U6                  yes      yes    yes       no     -         
S10_51                 yes      no     no        yes    -         

You can issue:

# luactivate S10_51
# lustatus
Boot Environment       Is       Active Active    Can    Copy      
Name                   Complete Now    On Reboot Delete Status    
---------------------- -------- ------ --------- ------ ----------
S9_U6                  yes      yes    no        no     -         
S10_51                 yes      no     yes       no     -         

After you issue the luactivate command, it is important that you perform a clean shutdown and reboot of the system with the following command:

# init 6

If you do not use init 6 and perform reboot, the new boot environment will not be activated. Do not use the uadmin, halt, or reboot commands! Take care to shut down and reboot properly.

Now that you have two boot environments, you can add a third by activating the boot environment you want to update from, creating another boot environment as outlined above, performing the upgrade as described above, and activating it along with init 6.

Once you have done so, you will be able to activate any of the three boot environments.

In this example, you might have:

Boot Environment       Is       Active Active    Can    Copy      
Name                   Complete Now    On Reboot Delete Status    
---------------------- -------- ------ --------- ------ ----------
S9_U6                  yes      yes    yes       no     -         
S10_51                 yes      no     no        yes    -         
S10_54                 yes      no     no        yes    -         

I like to use this as our example, since it gives the user the option of activating S9_U6, the current release, or two different versions of Solaris Express. This way the user can have the most recent S9 MU (Maintenance Update), and continue to ping-pong the Solaris Express builds. In this example, when Solaris Express build 56 comes out, you can then rename or delete the S10_51 boot environment and create a S10_56 from the S10_54, and perform a Live Upgrade to the new build. Just keep in mind that you upgrade from whichever boot environment is active, so activate the one you want to perform Live Upgrade from before you execute the commands.

Also, to be safe, always install the latest Live Upgrade utilities from the second CD. This will ensure that Live Upgrade works as planned.

The number of boot environments you can have is unlimited. Each boot environment must have at least one disk partition assigned to it for the "/" file system. Practically, this means you can have up to seven boot environments per disk (eight slices minus one for slice "2" which may never be used).

 


Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License.


BigAdmin
  
 
 
 
Contact About Sun News & Events Employment Site Map Privacy Terms of Use Trademarks Copyright 1994-2008 Sun Microsystems, Inc.