|
In this HowTo I will do my best to introduce you to the Solaris Live Upgrade process. Recently, I have had to do this quite a bit and I figured why not and just write up a quick HowTo on this subject. As a few of you already know I am not a fan of OpenSolaris, though as of recent I am starting to get drawn into it.
One thing about the Live Upgrade process is that it allows you to have multiple BE's ( Bootable Environments ). This is so cool, since this allows you to have a CLEAN BE and the others to Test/Destroy/...Whatever. First things first you need to make sure that you have at least one available partition that is big enough to to transfer your current environment and enough space to do the Live Upgrade as well as have the OpenSolaris Express Image. OK, lets get into the Live Upgrade process....
- Verify that you have at least ONE partition aka slice available...You will need to use the format command.
Here is the example output...
bash-3.2# format
Searching for disks...done AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 9726 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@1f,1/ide@1/cmdk@0,0
Specify disk (enter its number): 0
selecting c0d0
Controller working list found
[disk formatted, defect list found]
Warning: Current Disk has mounted partitions.
/dev/dsk/c0d0s5 is in use for live upgrade /. Please see ludelete(1M).
/dev/dsk/c0d0s1 is currently used by swap. Please see swap(1M).
/dev/dsk/c0d0s6 is in use for live upgrade /var. Please see ludelete(1M).
/dev/dsk/c0d0s4 is currently mounted on /backup. Please see umount(1M).
/dev/dsk/c0d0s0 is currently mounted on /. Please see umount(1M).
/dev/dsk/c0d0s3 is currently mounted on /var. Please see umount(1M).
/dev/dsk/c0d0s7 is currently mounted on /export. Please see umount(1M).
- Get the solexpress dvd iso image... I used solexpres95 "sol-nv-b95-x86-dvd.iso"
- You now need to mount the OpenSolaris Image using lofiadm. The HowTo for that is here...
http://www.linuxdynasty.org/how-to-mount-an-iso-image-under-solaris-or-opensolaris.html
- Run the lucreate command. This command will label the current BE ( Which is the default Environment you are logged into )using the -c option then you need to specify the mounts you want to use and on what partition you want them on using the -m option. Example below..
bash-3.2# lucreate -c solexpr81 -m /:/dev/dsk/c0d0s5:ufs -m /var:/dev/dsk/c0d0s6:ufs -n solexpr95
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 <solexpr81> 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.
Searching /dev for possible boot environment filesystem devices
Updating system configuration files.
The device </dev/dsk/c0d0s5> is not a root device for any boot environment; cannot get BE ID.
Creating configuration for boot environment <solexpr9>.
Source boot environment is <solexpr81>.
Creating boot environment <solexpr9>.
Checking for GRUB menu on boot environment <solexpr9>.
The boot environment <solexpr9> does not contain the GRUB menu.
Creating file systems on boot environment <solexpr9>.
Creating <ufs> file system for </> in zone <global> on </dev/dsk/c0d0s5>.
Creating <ufs> file system for </var> in zone <global> on </dev/dsk/c0d0s6>.
Mounting file systems for boot environment <solexpr9>.
Calculating required sizes of file systems for boot environment <solexpr9>.
Populating file systems on boot environment <solexpr9>.
Checking selection integrity.
Integrity check OK.
Populating contents of mount point </>.
Populating contents of mount point </var>.
Copying.
WARNING: The file </tmp/lucopy.errors.6170> contains a list of <6>
potential problems (issues) that were encountered while populating boot
environment <solexpr9>.
INFORMATION: You must review the issues listed in
</tmp/lucopy.errors.6170> and determine if any must be resolved. In
general, you can ignore warnings about files that were skipped because
they did not exist or could not be opened. You cannot ignore errors such
as directories or files that could not be created, or file systems running
out of disk space. You must manually resolve any such problems before you
activate boot environment <solexpr95>. Creating shared file system mount points.
Copying root of zone <logger>.
Copying root of zone <zenoss>.
Copying root of zone <ipf>.
Creating compare databases for boot environment <solexpr95>.
Creating compare database for file system </var>.
Creating compare database for file system </>.
Updating compare databases on boot environment <solexpr95>.
Making boot environment <solexpr95> bootable.
Updating bootenv.rc on ABE <solexpr95>.
Population of boot environment <solexpr95> successful.
Creation of boot environment <solexpr95> successful.
6. Once the lucreate command finishes ( Takes about 15 to 30 minutes, at least for me it does), You now have to run the luupgrade command.
The -u option stands for upgrand and the -n option stands for the name of the BE that you are upgrading and the -s options stands for
the source image location that you are using.
bash-3.2# luupgrade -u -n solexpr95 -s /mnt/
Copying failsafe kernel from media.
Uncompressing miniroot
Uncompressing miniroot archive (Part2)
13364 blocks
Creating miniroot device
miniroot filesystem is <ufs>
Mounting miniroot at </mnt//Solaris_11/Tools/Boot>
Mounting miniroot Part 2 at </mnt//Solaris_11/Tools/Boot>
Validating the contents of the media </mnt/>.
The media is a standard Solaris media.
The media contains an operating system upgrade image.
The media contains <Solaris> version <11>.
Constructing upgrade profile to use.
Locating the operating system upgrade program.
Checking for existence of previously scheduled Live Upgrade requests.
Creating upgrade profile for BE <solexpr95>.
Checking for GRUB menu on ABE <solexpr95>.
Checking for x86 boot partition on ABE.
Determining packages to install or upgrade for BE <solexpr95>.
Performing the operating system upgrade of the BE <solexpr95>.
CAUTION: Interrupting this process may leave the boot environment unstable
or unbootable.
Upgrading Solaris: 61% completed
Upgrading Solaris: 98% completed
Upgrading Solaris: 100% completed
Installation of the packages from this media is complete.
Deleted empty GRUB menu on ABE <solexpr95>.
Adding operating system patches to the BE <solexpr95>.
The operating system patch installation is complete.
ABE boot partition backing deleted.
Configuring failsafe for system.
Failsafe configuration is complete.
INFORMATION: The file </var/sadm/system/logs/upgrade_log> on boot
environment <solexpr95> contains a log of the upgrade operation.
INFORMATION: The file </var/sadm/system/data/upgrade_cleanup> on boot
environment <solexpr95> contains a log of cleanup operations required.
WARNING: <6> packages failed to install properly on boot environment <solexpr95>.
INFORMATION: The file </var/sadm/system/data/upgrade_failed_pkgadds> on
boot environment <solexpr95> contains a list of packages that failed to
upgrade or install properly.
INFORMATION: Review the files listed above. Remember that all of the files
are located on boot environment <solexpr95>. Before you activate boot
environment <solexpr95>, determine if any additional system maintenance is
required or if additional media of the software distribution must be
installed.
The Solaris upgrade of the boot environment <solexpr95> is partially complete.
Installing failsafe
Failsafe install is complete.
7. Once the luupgrade finishes ( Which takes about 30 to 45 minutes, at least for me it does. ) You should now run lustatus, which as the name
suggest it will give you the status of the BE's.
bash-3.2# lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
solexpr81 yes yes yes no -
solexpr95 yes no no yes -
8. As you can see above solexpr81 which is the current BE is Active and is Active On Reboot as well. We need to change that so that
we can boot in to the new BE. We can do so by running luactivate and the BE name.
bash-3.2# luactivate solexpr95
WARNING: <6> packages failed to install properly on boot environment <solexpr95>.
INFORMATION: </var/sadm/system/data/upgrade_failed_pkgadds> on boot
environment <solexpr95> contains a list of packages that failed to upgrade
or install properly. Review the file before you reboot the system to
determine if any additional system maintenance is required.
Saving latest GRUB loader.
Setting failsafe console to <ttya>.
Generating partition and slice information for ABE <solexpr95>
Boot menu exists.
Generating direct boot menu entries for ABE.
Generating direct boot menu entries for PBE.
**********************************************************************
The target boot environment has been activated. It will be used when you
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You
MUST USE either the init or the shutdown command when you reboot. If you
do not use either init or shutdown, the system will not boot using the
target BE.
**********************************************************************
In case of a failure while booting to the target BE, the following process
needs to be followed to fallback to the currently working boot environment:
1. Do *not* change *hard* disk order in the BIOS.
2. Boot from the Solaris Install CD or Network and bring the system to
Single User mode.
3. Mount the Parent boot environment root slice to some directory (like
/mnt). You can use the following command to mount:
mount -Fufs /dev/dsk/c0d0s0 /mnt
4. Run <luactivate> utility with out any arguments from the Parent boot
environment root slice, as shown below:
/mnt/sbin/luactivate
5. luactivate, activates the previous working boot environment and
indicates the result.
6. Exit Single User mode and reboot the machine.
**********************************************************************
Modifying boot archive service
GRUB menu is on device: </dev/dsk/c0d0s0>.
Filesystem type for menu device: <ufs>.
Activation of boot environment <solexpr95> successful.
9. Now when that command successfully completes and give you a bunch of good info that you should take note of. HINT HINT....
If you run lustatus again the the ActiveOn Reboot should be no for solexpr81 and yes for solexpr95.
bash-3.2# lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
solexpr81 yes yes no no -
solexpr95 yes no yes no -
10. Now I'm sure by now you are wondering, what are the 6 errors that the LiveUpgrade process keeps telling us about.
In order to check the errors we will need to mount the /var partition.
bash-3.2# mount -F ufs /dev/dsk/c0d0s6 /luvar
11. We can now view the file by running the following below...
bash-3.2# cat /luvar/sadm/system/data/upgrade_failed_pkgadds
SUNWmccom
SUNWfirefox
SUNWthunderbird
SUNWrealplayer
SUNWfsexam-root
SUNWfsexam
12. Since the packages above are not really important we can now reboot the system, using the following below.
bash-3.2# sync;sync;shutdown -y -g0 -i6
|