Friday, November 30, 2007

Live Upgrade step-by-step for Solaris Express

I have heard lots of good things about Live Upgrade -- it allows you to upgrade to a new version of the OS while giving you the option to go back to your old version. Pretty cool!

Live Upgrade requires you set up a partition that's the same size as your root partition. In the past, if you didn't do that yourself, you can find out you don't have enough space to do that. I and others gave some feedback about that.

So I was very happy to notice that when I installed SXDE 09/07 it said that if I had given it more than 20GB of space (which I had), then the install would automatically set up a partition to make it possible to do a live upgrade.

Sure enough, when the install was done, there was a mount called /second_root that was exactly the same size as my / partition:

# /usr/ucb/df
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0d0s0 9294575 6742458 2459172 74% /
/dev/dsk/c0d0s4 9294575 9233 9192397 1% /second_root

So, after doing some research on the Web on how to do this, here are the steps I followed. You can also find the official instructions here.

Back Up your VMWare Image File

I didn't need to tell you to do this, did I?

Download the Image for the new OS

There are weekly builds of OpenSolaris called Nevada or Solaris Express Community Edition (SCDE) that have not gone through the same level of validation as Solaris Express Developer Edition (SXDE), which comes out about once a quarter (next one due in January).

So if you're brave and want the latest and greatest, get Nevada/SXCE. The latest one is build 78, with build 79 coming out some time next week. The nice thing is with Live Upgrade you can turn back the clock if you Otherwise, get the latest SXDE.

Mount the Image

Once you have the image, you can mount it into your current Solaris image using VMWare.
Choose Virtual Machine->CD/DVD->Choose Image... and then browse to your .iso file.

Upgrade LiveUpgrade

You heard me right. Before you can do Live Upgrade, you need to install the latest version of Live Upgrade. This seriously bit me in my last attempt about six months ago. It makes sense when you think about it, but, you know, hindsight is 20/20...

Find out where the CD is mounted to (it's usually under /cdrom), and then run something like the following:

# /cdrom/sol_11_x86/Solaris_11/Tools/Installers/liveupgrade20

and then let it do its thing.

Create a Live Upgrade Unit

is going to contain a copy of/. This is what will be upgraded, and then you will "switch" roots when you want to run in the new operating system. If you want to go back, the old one is still there, and you can "switch" back. Cool, huh?

So, first step is to make a copy of your root partition. This is done with lu_create.

First, you need to get the device name for /second_root. Do a df to find out. From above, you can see mine is c0d0s4.

Take a note of that, and then unmount /second_root and comment it out from /etc/vfstab. This is important, lu_create won't work if it thinks /second_root is in use.

Once you've done that, run the following command

# lucreate -c sxde907 -n nv78 -m /:c0d0s4:ufs

Where sxde907 is the name you want to give your current OS version, nv78 is whatever name you want to name your new OS version, and c0d0s4 is whatever the device name is for your /second_root partition.

This will run for quite some time, as it is copying your entire root partition. Time to go get a cup of coffee...

Note: keep an eye on things in the Performance Monitor. I noticed code>vmware-guestd taking up all the CPU and lucreate was asleep - if this happens, you can safely kill vmware-guestd, and then things will move along. I think this issue is fixed once you install the VMWare tools (I'm not sure though).

Run the Upgrade

This is done pretty simply. If your new image is mounted in the standard place, it will look like this:

# luupgrade -u -n nv78 -s /cdrom/sol_11_x86

Where nv78 is whatever name you gave to your new partition.

Activate the New Partition, And Go


# luactivate nv78

to activate your new boot environment. This command, when run, provides very useful information on how to get *back* to your current boot environment if for some reason reboot fails, so do take note.

Make sure you fully shutdown, versus "soft reboot" by using the shutdown command or the init command. The simplest way to do this is to do a full shutdown; if necessary (it shouldn't be) shut down the virtual machine using VMWare's code>Virtual Machine->Shut Down Guest.

When you reboot, you'll be in the new operating system version. If you ever want to go back, run luactivate again to activate the old bood environment, e.g.

# luactivate sxde907

Note that the startup menu lets you pick which boot environment you want to run in. Pretty nice!

My only complaint is that it took longer for me to run the upgrade than it did to make a clean install. But I guess that's to be expected, upgrading is a more complicated process.


I noticed that PostgreSQL did not start up in build 78.

Also I got an error saying there was a version mismatch for the 'vmhgfs' filesystem, and the HGFS module could not be started. However, I could see my shared directory no problem.

The screen resolution stuff appears to be kind of broken in build 78. This has been reported and hopefully will be fixed in subsequent releases. It's workable, but not nearly as nice as with SXDE 09/07.

1 comment:

Sol_Eng said...


I'm trying to upgrade from Solaris 10 to Solaris 11 (SPARC). The Media Pack i have, is "Solaris 11 11/11 (not Solaris Express - as Oracle doesn't support it anymore)" I have searched some documents on the internet on the steps but none of them really help specifically.

Other thing how do i get the latest version of Live Upgrade, because the Info doc 206844 that they mention, i cannot locate it anywhere (tried the SunSolve but nothing, it down).

Now, if i lucreate a new BE (Solaris 10) on another partition/disk will i be able to luupgrade that BE with Solaris 11.

Please help?