Four Corners Noise

Tom Whitten's Weblog


20060421 Friday April 21, 2006

 Live Upgrade on my Laptop

Sun provides excellent Live Upgrade documentation in their Answer Books. Live Upgrade is a powerful tool that allows you to do many things, but all I wanted to do was a simple upgrade of my laptop every time a new Nevada build comes out. I like to be running the latest code. Thus, I wrote these notes that are aimed specifically at this need.

First of all you need enough room for two root slices. One is for the booted running system and the other is where the live upgrade takes place. The two root slices are called Boot Environments (BE) in live upgrade lingo.

At a high level live upgrade consists of the following steps:

  • copy the running BE to a new BE
  • upgrade the new BE
  • activate the new BE
  • reboot using init 6 into the new BE

Thus, the only down time is when you reboot.

You must have the latest live upgrade packages on your system, before creating a new BE. So the first step is to pkgrm SUNWluu, SUNWlur and SUNWlucfg. Then pkgadd them from the distribution media that you are going to upgrade to. They are on CD2 if you have a CD set.

Now for more details. Let's assume that your two root slices are sa and sb. They can be on the same disk or different disks. The process of creating the BE is a little different the first time that you do a live upgrade and when you do subsequent upgrades, so I'll discuss them separately.

First Time BE Creation

To start out with, you don't have any BEs, so you need to create one. Let's assume that you are running snv_37 (Nevada build 37) on sa and that you want to upgrade to snv_38 on sb. You would do something like:

lucreate -m /:/dev/dsk/sb:ufs -n snv_38 -c snv_37

The options are:

  • -m specifies the root filesystem for the new boot environment
  • -n is the name of the new BE
  • -c gives a BE name to the currently running OS. You only need to use -c once.

This command does a newfs on sb and then copies the file system on sa to sb. You can create additional BEs using lucreate again, but without the -c option. I sometimes find this to be handy in testing situations, but I never have more than two BEs on my laptop.

Subsequent BE creations are discussed later.

Doing the Upgrade

Now you upgrade the snv_38 BE. First throw in the DVD or first CD into your machine and let vold(1m) mount it. The command to start the upgrade is:

luupgrade -u -n snv_38 -s <mount point of media>

If you have a DVD, this will do the entire upgrade. If you have CDs, wait for this command to exit. Eject the CD and then put in the next one. The command to use for the 2nd and subsequent CDs is:

luupgrade -i -n snv_38 -s <mount point of media>

Note that you're using -i instead of -u.

Booting

Now activate the new BE using:

luactivate snv_38
init 6

Don't use reboot. The system will boot up into the new BE.

Subsequent BE Creation

Now that you have two BEs (snv_37 and snv_38) the process is slightly different. Let's assume that you're booted into snv_38 on sb, and you want to upgrade to snv_39. Do the following:

lumake -n snv_37
lurename -e snv_37 -n snv_39

The first command copies the active BE to the BE named snv_37. It takes the place of lucreate. The second command renames snv_37 to snv_39. Now you do the upgrade the same way as before.

As you can see, you can alternate between the two boot environments as new Solaris builds become available.

A Few More Notes

  • You can use luactivate to switch back and forth between BEs. If you don't like the upgrade for some reason, you can go back to the previous BE.
  • The lu commands take care of the grub menu.lst on x86/x64 boxes.
  • All lu* commands must be run as root.
  • The lustatus command is handy to see where you are.

My Laptop Environment

Here is how my solaris fdisk partition is sliced up (Size is in MB):

Part Tag   Cylinders       Size
   0  2       3 -   959   7506.94
   1  3     960 -  1087   1004.06
   2  5       0 -  3822   29988.52
   3  0    1088 -  2044   7506.94
   4  0    2045 -  2306   2055.19
   5  0    2307 -  2680   2933.75
   6  0    2681 -  3725   8197.23

Slices 0 and 3 are the two root slices that I used for live upgrade. As I move from one Nevada build to another I alternate between these two.

  • slice 1 = swap
  • slice 4 = /opt/sfw (the software companion stuff)
  • slice 5 = internal Sun stuff
  • slice 6 = personal stuff like my home directory and places to store the CD/DVD images that I down load. That explains the large size.

Slices 4, 5 and 6 are shared by the two BEs, so they don't get touched during a live upgrade. Here is how much free space I have on each slice. This shows that you could probably get away with less space.

Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0d0s0      7570275 3385054 4109519    46%    /
/dev/dsk/c0d0s4      2062186 1391065  609256    70%    /opt/sfw
/dev/dsk/c0d0s5      2943130 2219261  665007    77%    /pkg
/dev/dsk/c0d0s6      8266719 3379901 4804151    42%    /local

Technorati Tag: OpenSolaris
Technorati Tag: Solaris



( Aug 29 2007, 01:48:19 PM MDT / Apr 21 2006, 05:46:43 PM MDT ) Permalink Comments [2]
Trackback: http://blogs.sun.com/4ctom/entry/live_upgrade_on_my_laptop

Trackback URL: http://blogs.sun.com/4ctom/entry/live_upgrade_on_my_laptop
Comments:

Probably a "duh", but there's no reason that this shouldn't work with either a) an NFS mounted DVD image, or b) a lofi mounted DVD image, right? i.e. for b):
1) Download dvd image to HD as newimage.iso
2) lofiadm -a newimage.iso (returns /dev/lofi/1)
3) mount -o ro -F hsfs /dev/lofi/1 /mnt
4) luupgrade -u -n snv_38 -s /mnt
5) luactivate snv_38
6) init 6

Posted by Stephen Boyd on May 12, 2006 at 10:33 AM MDT #

need more information about configuration

Posted by Erion on May 30, 2006 at 12:30 AM MDT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed

« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today


XML







Today's Page Hits: 25