Slava Leanovich
Archives
« 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
Search

Links
 

Today's Page Hits: 8

All | Personal | Sun
« Installing MS Window... | Main | The 1-st Open Solari... »
20070121 Sunday January 21, 2007
Live Upgrade feature usage experience

Live Upgrage feature in Solaris OS, refer to live_upgrade(5), no doubt, is extremely convinient way of doing not only an operating system upgrade, but also a single product installation or the other various experiments - all of these in a very very safe manner.

The basic idea is to maintain several operating system images - "boot environments" on a single machine at the same time. Besides, boot environments may share partitions. So, the current environment can be smartly cloned to the other spare partitions, then modified as it is required - starting with sevral files replacement, and ending with the whole OS level upgrade. After that, a newly created alternative environment can be used as a working one.

If something is screwed up, you can fall back to your previous stable boot environment any time.

Continuing with Live Upgrade, you may clone boot environment 1 to 2, upgrade 2, reboot into 2, thus 2 becomes your current environment, and so you may clone 2 back to 1, do upgrade, switch to 1 and so forth - i.e. you'll get a non-stop safe upgrade process.

Everything starts with a planning, so let's consider some example.
Assume we want to play with two environments, well ... in general let's have the current root filesystem on slice 0, slice 1 is basically swap, slice 2 as we know always points to the whole disk (or to a whole Solaris fdisk(1M) partition if we're on x86), slice 3 we plan to use as root for an alternative boot environment, and slice 4 we plan to share between both environments. Note: the slice we plan for cloning current root (our case it's slice 3) must be "unassigned", i.e. not mounted, otherwise Live Upgrade won't see it as a spare slice.

For better flexibility, we put this shared slice 4 to a ZFS storage pool, refer to zpool(1M). It allows, for instance, each boot environment to have own copy of /opt, but at the same time, /opt/csw (community software from www.blastwave.org), /opt/soffice8 and similar can be shared as a separate filesystems. Good, our current environment looks stable, and now we want to create an alternative boot environment, so do lucreate(1M) new environment named be2, assuming we do that first time, therefore we need to give a name to the current environment, let's call it be1, and finally mapping tells that we clone only root filesystem to spare slice 3, all the rest (swap and ZFS pool) keep shared. Note: lucreate(1M) immediately starts copy data, rather then just configure boot environment and leave it unpopulated, so if you don't have half an hour time for a data copy, better not to start the process. The other thins is preserve flag looks quite confusing - it doesn't mean "leave partition unpopulated", it does mean "expect the target partition to be already populated and configured for LU usage".

Another catch is the lucreate(1M) process termination in the middle of execution. After that an invalid / incomplete environment neither can be recreated due to it's already exists, nor can be deleted due to the ACTIVE value of Copy Status. Even if you delete /etc/lu/COPY_LOCK making a Copy Status non ACTIVE, it won't help.
The way out is manual editing of /etc/lutab file, refer to lutab(4).

Next time you need to populate an already configured alternative boot environment, you may use lumake(1M) rather then lucreate(1M).
For instance, you've done lucreate(1M) and then install something on your current environment, so you probably want to get your alternative environment up to date ... Or, you've clonned environment 1 to 2, upgrade 2, switch to it and want to synchronize environment 2 back to 1. In these cases: Hint: On some old releases, lucreate(1M) was NOT aware of ZFS, and eventually it copies shared data from ZFS filesystems over. As a result, an alternative environment can't boot correctly, because it can't mount shared ZFS filesystems, due to they're non empty.
However, lumake(1M) fortunately handles ZFS stuff. Well, if you're working on old release, you can do lucreate(1M) and lumake(1M) after, which will remove wrongly copied data.

Now you can manage an alternative be2 environment, particularly: The next step is to activate your alternative environment, and make it bootable.
That basically means: Ok, so luactivate(1M) our alternative environment: From the program output above, we see that reboot(1M) is not quite suitable, looks like LU service's stop script (/etc/init.d/lu stop) execution is mandatory, then If you're on x86 and want to edit GRUB menu file, take into consideration it's physical location, i.e. you may have several boot environments, but only one contains active GRUB stuff: One more thing, LU updates the Master Boot Record, in particular resets it to a default one for Solaris OS ... no idea why LU touches MBR, anyway ... so if you're using specific MBR program, I'd recomment to backup it before and restore it after using LU, e.g.: If your alternative environment has problems during the boot, most probably that's because of some services can't start. If that's the case, compare /var/svc/manifest directories of previous and new environments to figure out which services are gone (exec_method points to non-exising path) and which are added. That'll give you a clue which services should be disabled and which in opposite - enabled.

Finally, here is an output from ludelete(1M) - boot environment delete program: The point I want to emphasize here is that if you delete boot environment, which contains GRUB stuff, LU automatically relocates it to the current environment.

If you want to relocate GRUB manually, as an example you have it on slice 0 and want all of the GRUB related stuff to be on slice 3, you can use installgrub(1M) utility: So, installgrub(1M) above writes the actual GRUB program to a corresponding location (basically to the fdisk(1M) partition, on which the Solaris OS slices reside), by the way configuring it to work with menu.lst file (and other GRUB related files) on a target slice (our case it's slice 3).

And after a reboot, an MBR program will find an active partition (presumably it's one with Solaris OS), then load its 1-st sector, where the GRUB stage 1 code is, which in turn will load stage 2 code, which will use the rest of a GRUB stuff, including menu.lst, from the 3-rd slice, as we've planned.

However after a reboot, the bootadm(1M) still shows the old "menu file" location, which is basically not correct any more ... That's because of LU configuration still points to that location ...
Adjust /etc/lu/GRUB_slice, make them pointing to a proper slice, i.e. let Live Upgrade know where you've relocated GRUB to. Now everything should be consistent.
Good luck.

posted by leanovich Jan 21 2007, 05:26:04 PM CET Permalink Comments [4]

Trackback URL: http://blogs.sun.com/vl/entry/live_upgrade_feature_usage_experience
Comments:

Hmm. I'm trying to use the merged keyword on Solaris 10 11/06; is it broken?
bash-3.00# lucreate -m /:/dev/dsk/c0t0d0s5:ufs -m /usr:merged:ufs -n be1
Discovering physical storage devices
Discovering logical storage devices
Cross referencing storage devices with boot environment configurations
Determining types of file systems supported
Validating file system requests
ERROR: cannot check device name <merged> for device path abbreviation
ERROR: cannot determine if device name <merged> is abbreviated device path
ERROR: cannot create new boot environment using file systems as configured
ERROR: please review all file system configuration options
ERROR: cannot create new boot environment using options provided

Posted by Ceri Davies on March 30, 2007 at 02:08 PM CEST #

I used LiveUpgrade (lucreate \ luupgrade\luactivate) in order to upgrade from solaris 10(3.05+resent recommanded pathed) to solaris 10(11.06). the upgrade finished succesfully, but then I check zfs commands like : zpool, zfs the upgrade installed only the simbolik links /use/sbin/ zpool but not the actual file that should be located on /sbin/ zpool !?!? do you know why? how can I use zfs on solaris 10(11.06) after LiveUpgrade on this situation?

Posted by shaybery on April 22, 2007 at 07:58 AM CEST #

Hmmmm, I installed LU on a sol10u3 x4200 then made a second BE, activated it, and booted from it. Contrary to what you show above, ludelete doesn't seem to be willing to relocate the GRUB stuff:

# lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
sol10u3frommedia yes no no yes -
sol10u3_c1t1 yes yes yes no -
# ludelete sol10u3frommedia
ERROR: The boot environment <sol10u3frommedia> contains the GRUB menu.
ERROR: You are not allowed to delete this BE.
Unable to delete boot environment.

Posted by Anthony D'Atri on September 29, 2007 at 01:51 AM CEST #

lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
Solaris10 yes yes yes no -
-bash-3.00# lucreate -c Solaris10 -n Solaris10_lu -m /:/dev/dsk/c0t2d0s0:ufs -m -:/dev/dsk/c0t2d0s1:swap -m /export/home:/dev/dsk/c0t2d0s7:ufs
Discovering physical storage devices
Discovering logical storage devices
Cross referencing storage devices with boot environment configurations
Determining types of file systems supported
Validating file system requests
Preparing logical storage devices
Preparing physical storage devices
Configuring physical storage devices
Configuring logical storage devices
Analyzing system configuration.
Comparing source boot environment <Solaris10> file systems with the file
system(s) you specified for the new boot environment. Determining which
file systems should be in the new boot environment.
Updating boot environment description database on all BEs.
reading tag: invalid character <1> (0x31) before start of tag
ERROR: Cannot delete existing filters for new boot environment.

Any idea where it is messing up ?

Posted by upendra on October 07, 2009 at 09:14 PM CEST #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed