SOLARIS LIVE UPGRADE
Over the course of a few days, during my normal working hours, I upgraded
my servers
to the latest release of Solaris 9 and patched them with virtually no down
time. My only
down time was the time it took to reboot which I did early in the mornings.
***************************************************************************
BEFORE YOU JUMP IN...
You'll need a 2nd HDD or enough unused space on your master boot drive
to use liveupgrade.
I would recommend you understand your disks and how to boot to a
specific disk at the prom level.
At the prom level you can use the 'boot' command followed by a disk
definition. However, I have found that the definition you get from
using the format command is not always the correct definition.
Via format you can choose a disk and then use the 'current' command to
'describe the current disk'. You'll get something back like the
following:
format> current
Current Disk = c0t1d0
<IBM-DNES-318350Y-SA30 cyl 11199 alt 2 hd 10 sec 320>
/pci@1f,0/pci@1/scsi@8/sd@1,0
The definition, /pci@1f,0/pci@1/scsi@8/sd@1,0 may not work
to boot
at the prom level. This particular case is off my SunFire V100.
Booting
at the prom using this definition does NOT work. I watched a subsequent
normal boot carefully and noticed the word 'disk' in place of 'sd' so
the following definition does work to boot from prom level
boot /pci@1f,0/pci@1/scsi@8/disk@1,0
***************************************************************************
1) Install Live Upgrade
Should have come with 2.6 to present releases.
Insert the Solaris 9 DVD or Solaris 9 Software 2 of 2 CD.
Find it at: /cdrom/cdrom0/Solaris_9/Tool/Installers/liveupgrade20
This is a no brainer GUI install.
Can find binaries in /usr/sbin and /usr/lib/lu
after the install.
2) Running 'lu' on command line provides a text based interface for
operation/config (use F6 for 'cancel') but this did not function
properly for me. Resorted to all command line usage.
3) Create Alternate Boot Environment (ABE)
You'll use /usr/sbin/lucreate
First, a picture of my master disk /dev/dsk/c0t0d0 :
Part Tag
Flag Cylinders
Size Blocks
0 root
wm 0 - 3942
8.86GB (3943/0/0) 18579416
1 swap
wu 3943 - 5723
4.00GB (1781/0/0) 8392072
2 backup wm
0 - 7505 16.86GB (7506/0/0)
35368272
3 var
wm 5724 - 6614
2.00GB (891/0/0) 4198392
4 unassigned wm
0
0 (0/0/0)
0
5 unassigned wm 6615
- 7505 2.00GB
(891/0/0) 4198392
6 unassigned wm
0
0 (0/0/0)
0
7 unassigned wm
0
0 (0/0/0)
0
/dev/dsk/c0t0d0s0 9147129 1698241
7357417 19% /
/dev/dsk/c0t0d0s3 2056211 294404
1700121 15% /var
/dev/dsk/c0t0d0s5 2056211 298369
1696156 15% /cache
swap
4843896 1256 4842640 1%
/tmp
Command line entry:
lucreate -c master -m /:/dev/dsk/c0t1d0s0:ufs -m /var:/dev/dsk/c0t1d0s3:ufs
\
-m /cache:/dev/dsk/c0t1d0s5:ufs -m -:/dev/dsk/c0t1d0s1:swap
-n newboot
The '-c master' is the name you assign the current BE; here
I used 'master'.
The -m entries tell lucreate what file system, where you
want it on the other
disk, and what kind of file system it is. So the first
entry is '/', put
it the /dev/dsk/c0t1d0s0 slice of the other disk, and it
is a 'ufs' type
file system.
The '-n second' is the name I have the ABE.
The lucreate command begins by configuring, then ends by
copying the file
systems over from the Current Boot Environment to the ABE.
This will take
some time to complete depending on the number of bytes to
be copied.
4) Upgrade the ABE
luupgrade -n second -u -s /net/haber/export/holding1/solaris/solaris9
Running with the -N, dry-run mode, enables you to determine
whether your
command arguments are correctly formed.
Once you start the luupgrade process do not interrupt it.
Note: You can use the lustatus command while doing things
like lucreate
and luupgrade to see
what's up.
5) Check the logs.
/var/sadm/system/logs/upgrade_log is loaded with info
on what was done.
See /var/sadm/system/data/upgrade_cleanup
the last 20-30 lines may have info on what you yet need to
do to complete
the upgrade.
Special notes on cleanup
1) /etc/init.d/sendmail
be sure the MODE is set appropriately for
relay/non-relay
check /etc/mail/sendmail.cf is correct
for your configuration
2) apache
just make sure your startup scripts are
what they should be
for your configuration
6) Use lustatus to see if the new BE is bootable.
BE_name
Complete Active ActiveOnReboot CopyStatus
------------------------------------------------------------------------
master
yes yes yes
-
second
yes no
no
-
7) Activate the ABE
luactivate second
init 6
You could use lustatus after the luactivate command just
see what happened.
Now, the 'second' disk should be used to boot from upon next
reboot.
See the warning message that is produced:
**********************************************************************
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. Enter the PROM monitor (ok prompt).
2. Change the boot device back to the original boot environment
by typing:
setenv boot-device disk:a
3. Boot to the original boot environment by typing:
boot
**********************************************************************
8) Fall back to orignal BE.
What do to if:
A) ABE worked fine but still want to boot to the old BE.
/usr/sbin/luactivate master
init 6
B) ABE didn't work so want to return to the old BE.
You'll have to get to the OK prompt and
either boot to the net
in single user mode or boot specifically
to the orignal disk in
single user mode.
Net: OK boot net -s
Disk: boot /sbus@1f,0/SUNW,fas@e,8800000/sd@1,0
****************************************************************************
See the following commands
luactivate(1M) Activate an inactive boot environment.
lucancel(1M) Cancel a scheduled copy or create job.
lucompare(1M) Compare an active boot environment with an inactive
boot
environment.
lucopy Recopy file
systems to update an inactive boot environment.
lucreate(1M) Create a boot environment.
lucurr(1M) Name the active boot environment.
ludelete(1M) Delete a boot environment.
ludesc(1M) Add a description to a boot environment
name.
lufslist(1M) List critical file systems for each boot
environment.
lumount(1M) Enable a mount of all of the file
systems in a boot environment.
This command enables you to modify the files in a boot
environment while that boot environment is inactive.
lurename(1M) Rename a boot environment.
lustatus(1M) List status of all boot environments.
luumount(1M) Enable an unmount of all the file systems
in a boot environment.
This command enables you to modify the files in a boot
environment while that boot environment is inactive.
luupgrade Upgrade an operating environment
or install a flash archive
on an inactive boot environment.