Solaris Live Upgrade

The following steps were used to perform a Live Upgrade from Solaris 2.6 to Solaris 8. The disks on the system are under DiskSuite control.

1. Gather baseline information.

The system has two internal disks:

# format < /dev/null
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133>
          /pci@1f,4000/scsi@3/sd@0,0
       1. c0t8d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133>
          /pci@1f,4000/scsi@3/sd@8,0
Specify disk (enter its number):

I wrote the following determine_bootdisk script to determine the boot disk.

# Determine the Solaris boot disk in cxtxdx format.
BOOTPATH=`prtconf -pv | grep bootpath | tr -d "'" | awk '{print $2}'`

if [ -n "`echo $BOOTPATH | grep "/disk"`" ] ; then
   # The bootpath contains "disk," but the /devices block device contains
   # either "sd" or "ssd"
   BOOTPATH=`echo $BOOTPATH | sed 's/disk@//'`
   BOOT_DISK=`ls -l /dev/dsk | sed -e 's/ssd@//' -e 's/sd@//' \
   | grep "$BOOTPATH" 2>/dev/null | awk '{print $9}' | sed 's/s[0-7]//'`
else
   BOOT_DISK=`ls -l /dev/dsk | grep "$BOOTPATH" 2>/dev/null | \
   awk '{print $9}' | sed 's/s[0-7]//'`
fi

if [ -n "$BOOT_DISK" ] ; then
   echo "Your boot disk is ${BOOT_DISK}."
else
   echo "Unable to determine logical boot disk."
fi

# sh ./determine_bootdisk
Your boot disk is c0t0d0.

c0t0d0 is the boot disk, and c0t8d0 is a mirror of the boot disk.

2. Download and install Live Upgrade from the following URL:
http://wwws.sun.com/software/solaris/liveupgrade/

Note the following warning when installing Live Upgrade on Solaris 2.6:

=========================================================================
                              IMPORTANT NOTICE

The latest Solaris Recommended Patch Cluster for SunOS 5.6 for the sparc
platform must be installed on this system prior to running Live
Upgrade. The latest Solaris recommended Patch Cluster brings the
system up to the currently-supported release level. Live Upgrade may
fail to work properly if the latest Solaris Recommended Patch Cluster
is not installed on this system.
=========================================================================

3. Backup /etc/vfstab and /etc/system.
# cp /etc/vfstab /etc/vfstab_pre_upgrade
# cp /etc/system /etc/system_pre_upgrade

4. Run metaroot with the path to your boot disk's root slice to make necessary /etc/vfstab and /etc/system modifications. These modifications allow you to boot from the boot disk instead of the mirror metadevice.
# /usr/opt/SUNWmd/sbin/metaroot /dev/dsk/c0t0d0s0

5. Modify mount points in /etc/vfstab to point to boot disk logical partitions (ex. /dev/dsk/c0t0d0s0) instead of DiskSuite metadevices (ex. /dev/md/dsk/d0).

6. Reboot the system.

7. Remove the submirror and mirror metadevices for the bootdisk (c0t0d0) and mirror (c0t8d0).

for MIRROR in `/usr/opt/SUNWmd/sbin/metastat | grep Mirror | awk '{print $1}' | tr -d ':'`
do
   /usr/opt/SUNWmd/sbin/metaclear -r $MIRROR
done

8. Repartition the former mirror disk (c0t8d0) with format, if applicable.

9. Insert the Solaris 8 Software CD 1.

10. Run Live Upgrade.

Note: you may have to export your TERM variable to vt220 in order to properly use the function keys within the Live Upgrade interface.

# TERM=vt220 lu

11. Choose Create. Name the current boot environment Solaris_2.6 and the new boot environment Solaris_8.

12. For each of the devices in the Active Boot Environment, select a corresponding device in the New Boot Environment.

Example:

Active Boot Environment
/       c0t0d0s0
-       c0t0d0s1
/usr    c0t0d0s3
/var    c0t0d0s5
/opt    c0t0d0s4

New Boot Environment
/       c0t1d0s0
-       c0t1d0s1
/usr    c0t1d0s3
/var    c0t1d0s5
/opt    c0t1d0s4

13. Choose Upgrade. Enter Solaris_8 for Name of Boot Environment: and the path to the Solaris 8 Software CD 1 for Package Media:.

14. Choose Activate. Enter Solaris_8 for Name of Boot Environment:.

15. Reboot the system with shutdown -i6 -g0 -y

16. If applicable, install additional packages from Solaris 8 Software CD 2 listed in /var/sadm/system/data/packages_to_be_added.

Example:

WARNING: <14> packages still need to be installed.
INFORMATION: </var/sadm/system/data/packages_to_be_added> contains a log
of packages that need to be added that were not present on the volume of
the media being upgraded to.

grep PKG= /var/sadm/system/data/packages_to_be_added | cut -c5-

SUNWsprot
SUNWsra
SUNWsrh
SUNWsutl
SUNWhea
SUNWbtool
SUNWarc
SUNWolinc
SUNWcg6h
SUNWlur
SUNWluu
SUNWxwinc
SUNWdfbh
SUNWlibm

17. Install the latest Recommended Patch Cluster for Solaris 8. Reboot after completing patch cluster installation.

18. If applicable, mirror the boot disk.

Veritas Volume Manager instructions

The following steps were used to perform a Live Upgrade from Solaris 2.6 to Solaris 8. The disks on the system are under Veritas Volume Manager (VxVM) control.

Versions of Solaris prior to 2.6 cannot use Live Upgrade, but may be upgraded using the "Upgrade" option with the Solaris Interactive Installation.

1. Gather baseline information.

The system has two internal disks:

# format < /dev/null
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133>
          /sbus@1f,0/SUNW,fas@e,8800000/sd@0,0
       1. c0t1d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133>
          /sbus@1f,0/SUNW,fas@e,8800000/sd@1,0
Specify disk (enter its number):

Disk c0t0d0 is the boot disk, and c0t1d0 is a mirror of the boot disk.

# prtconf -pv | grep boot-device
        boot-device:  'disk net'

# prtconf -pv | grep disk:
        disk:  '/sbus/SUNW,fas@e,8800000/sd@0,0'

# ls -l /dev/dsk/c0t0d0s0
lrwxrwxrwx   1 root     root          51 Dec  7  1998 /dev/dsk/c0t0d0s0 -> ../../devices/sbus@1f,0/SUNW,fas@e,8800000/sd@0,0:a

The disks are under Veritas control:

# df -lk
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/vx/dsk/rootvol   124330   48702   63195    44%    /
/dev/vx/dsk/usr      1018382  432592  524688    46%    /usr
/proc                      0       0       0     0%    /proc
fd                         0       0       0     0%    /dev/fd
/dev/vx/dsk/var      1018382  286900  670380    30%    /var
/dev/vx/dsk/opt      1755415 1222911  479842    72%    /opt
swap                 2269776   59960 2209816     3%    /tmp

2. Download and install Live Upgrade from the following URL:
http://wwws.sun.com/software/solaris/liveupgrade/

Note the following warning when installing Live Upgrade on Solaris 2.6:

=========================================================================
                              IMPORTANT NOTICE

The latest Solaris Recommended Patch Cluster for SunOS 5.6 for the sparc
platform must be installed on this system prior to running Live
Upgrade. The latest Solaris recommended Patch Cluster brings the
system up to the currently-supported release level. Live Upgrade may
fail to work properly if the latest Solaris Recommended Patch Cluster
is not installed on this system.
=========================================================================

The showrev command shows that my Solaris 2.6 system is several revisions behind the latest kernel, so I will install the latest Recommended Patch Cluster and reboot after unencapsulating the root disk below.

3. Unencapsulate the root disk (if under Veritas control).

Remove the plexes on the mirrored boot disk.
# vxplex -o rm dis rootvol-02 swapvol-02 usr-02 var-02 opt-02

Run vxunroot.

# vxunroot

  This operation will convert the following file systems from
  volumes to regular partitions: root swap usr var opt

  Replace volume rootvol with c0t0d0s0.

  This operation will require a system reboot.  If you choose to
  continue with this operation, system configuration will be updated
  to discontinue use of the volume manager for your root and swap
  devices.

Do you wish to do this now [y,n,q,?] (default: y) y

  Restoring kernel configuration...

  A shutdown is now required to install the new kernel.
  You can choose to shutdown now, or you can shutdown later, at your
  convenience.

Do you wish to shutdown now [y,n,q,?] (default: n) n

  Please shutdown before you perform any additional volume manager
  or disk reconfiguration.  To shutdown your system cd to / and type

        shutdown -g0 -y -i6

4. Install the latest Recommended Patch Cluster for Solaris 2.6.

5. Remove Veritas packages (identify with pkginfo | grep VRTS) with pkgrm.

6. Reboot.

7. Duplicate the partition table of the boot disk (c0t0d0) with the Alternate Boot Environment (c0t1d0).

# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2

6. Run Live Upgrade. Note: you may have to export your TERM variable to vt220 in order to properly use the function keys within the Live Upgrade interface.

# lu

7. Choose Create. Name the current boot environment Solaris_2.6 and the new boot environment Solaris_8.

8. For each of the devices in the Active Boot Environment, select a corresponding device in the New Boot Environment.

Example:

Active Boot Environment
/       c0t0d0s0
-       c0t0d0s1
/usr    c0t0d0s3
/var    c0t0d0s5
/opt    c0t0d0s4

New Boot Environment
/       c0t1d0s0
-       c0t1d0s1
/usr    c0t1d0s3
/var    c0t1d0s5
/opt    c0t1d0s4

9. Exit the Live Upgrade utility. According to the Live Upgrade documentation, "If the installation requires more than one CD, you must use the command line interface procedure for upgrading." Therefore, I will use the command-line utilities to upgrade the new boot environment to Solaris 8, because our system may need packages on the second Solaris 8 Software CD.

10. Insert Solaris 8 Software CD 1.

11. Run the Live Upgrade installer on the first disc.
# luupgrade -u -n Solaris_8 -s /cdrom/cdrom0/s0

12. When finished, eject the CD and insert Solaris 8 Software CD 2.

13. Run the Live Upgrade installer on the second disc.
# luupgrade -i -n Solaris_8 -s /cdrom/cdrom0/s0 -O -nodisplay

14. Active the new boot environment.

# lu

Choose Activate and enter Solaris_8 for the boot environment name.

15. Reboot the system to use the new boot environment.

# shutdown -i6 -g0 -y

16. Install the latest Recommended Patch Cluster for Solaris 8. Reboot after completing patch cluster installation.

17. If applicable, reinstall Veritas, and mirror the root disk.

Back to brandonhutchinson.com.
Last modified: 09/27/2005