Monday, October 27, 2008

Recap: Live Upgrade with ZFS root using SXCE (Nevada/OpenSolaris)

This is just a follow up to my previous blog entry "Live Upgrade with ZFS root using SXCE (Nevada)". I thought I would just do a quick recap, since I wanted to add a couple of points. For the full example and the output which is expected see the above entry.

Live Upgrade
  1. Preparation
  2. # lofiadm -a /export/iso/sol-nv-b99-x86-dvd.iso
    /dev/lofi/1
    # mount -o ro -F hsfs -o ro /dev/lofi/1 /mnt
    #
    pkgrm SUNWluu SUNWluzone SUNWlur SUNWlucfg
    #
    pkgadd -d /mnt/Solaris_11/Product SUNWlucfg SUNWlur SUNWluu SUNWluzone
  3. Create a new boot environment
    • If this is your first live upgrade then use this command (-c Assigns a name to the current current Boot Environment)
    # lucreate -c b97 -n b99
    # lucurr
    b97
    • Otherwise if you have done live upgrades before you do not need -c
    # lucreate -n b99
  4. Check it
  5. # lustatus
    Boot Environment Is Active Active Can Copy
    Name Complete Now On Reboot Delete Status
    -------------------------- -------- ------ --------- ------ ----------
    b95a yes no no yes -
    b97 yes yes yes no -
    b99 yes no no yes -
  6. Upgrade
  7. # luupgrade -u -n b99 -s /mnt
    # zfs list
    NAME                      USED  AVAIL  REFER  MOUNTPOINT
    rpool 151G 77.5G 41K /rpool
    rpool/ROOT 32.2G 77.5G 18K legacy
    rpool/ROOT/b95a 88.7M 77.5G 12.4G /tmp/.alt.luupdall.6066
    rpool/ROOT/b97 27.8G 77.5G 11.1G /
    rpool/ROOT/b97@20080820 7.77G - 9.51G -
    rpool/ROOT/b97@b97 8.57G - 12.4G -
    rpool/ROOT/b97@20080916 64.9M - 10.9G -
    rpool/ROOT/b97@b98 14.7M - 11.1G -
    rpool/ROOT/b99 4.34G 77.5G 11.2G /tmp/.luupgrade.inf.6336
    rpool/dump 2.97G 77.5G 2.97G -
    rpool/export 113G 77.5G 43.6G /export
    rpool/export/home 69.1G 77.5G 69.1G /export/home
    rpool/swap 2.97G 78.7G 1.75G -
  8. Make it your default boot enviroment
  9. # luactivate b99
  10. Reboot. WARNING must use init command
# init 6


Trouble Shooting:

  • - Error about mount point not empty during a live upgrade or after:
i.e.
ERROR: cannot mount '/.alt.tmp.b-nnb.mnt/': directory is not empty
or
cannot mount '/export/home': directory is not empty
This is most likely that there is a file or directory in this location or a mount point already exist.

Check only current system mounted (NO /.alt.. or /export/home) and then do some cleaning up (WARNING: before doing the "rm -ir" make sure you are happy delete these files)
# df -F zfs
/ (rpool/ROOT/snv_98 )
/export (rpool/export )
/export/home (rpool/export/home )
/rpool (rpool )


# zfs unmount /export/home
# ls -adR
/.alt.tmp.b-nnb.mnt /export/home
# rm -ir /.alt.tmp.b-nnb.mnt /export/home
# zfs unmount /export
# ls -adR /export
# rm -ir /export

# zfs mount /export
# zfs mount /export/home
or
# lumount NV95
# luunmount NV95