Random musings from sometimes sunny Ireland John Rice's Weblog

Wednesday Nov 23, 2005

OK so you've done your first Live Upgrade. See my earlier blog for all the gory details, "Solaris Live Upgrade":http://blogs.sun.com/roller/page/jmr?entry=solaris_live_upgrade_the_joys1 Now what about the next one? I assume you have 3 slices (partitions), one Active "/", one inactive to be upgraded and one "/export" that will remain unchanged on upgrade. My Active "/" is the solenv_s3 Boot Environment [BE] and I want to upgrade the old inactive solenv_s0 BE to nevada b27a.


# lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status

solenv_s0                  yes      no     no        yes    ---
solenv_s3                  yes      yes    yes       no     ---

* Steps * I need to upgrade some bits on solenv_s3 (frkit & lu tools), copy the current solenv_s3 to solenv_s0 (lumake), upgrade solenv_s0 (luupgrade) and finally make solenv_s0 my new active "/" BE (luactivate). The solenv_s3 then becomes my old inactive BE, ready for the next live upgrade. Here you go:


1. Update frkit
# /usr/sfw/bin/wget http://vaticaan.holland/~casper/tools/frkit ; chmod 755 frkit ; ./frkit <- as root

2. Get nevada iso and mount it
> ftp://nana.sfbay/solaris_media/nv/27a/x86/
> get solarisdvd-iso.gz  [2.23 Gigs]
# gunzip solarisdvd-iso.gz
# lofiadm ---a /export/home/john/build/solarisdvd.iso
# mount ---r ---F hsfs /dev/lofi/1 /mnt

3. Update lu tools from the iso
# cd /mnt/Solaris_11/Tools/Installers/
# ./liveupgrade20

Alternative
# pkgrm SUNWluu SUNWlur
# pkgadd ---d /mnt/Solaris_11/Product SUNWlur SUNWluu
# pkginfo ---l SUNWluu

4. Copy from current Active BE [solenv_s3] to Inactive target BE [solenv_s0] (1-2 hrs)
# lumake ---n solenv_s0

5. Upgrade the target BE [solenv_s0] (1-2 hrs)
# lupgrade ---u ---n solenv_s0 -s /mnt
[Note: add ---N if you want to do a dry run and check out what's going to happen]

6. Activate target BE
# luactivate solenv_s0

Reboot - DONE! It's getting easier ...

Monday Nov 07, 2005

Well thought I should upgrade from Solaris 11 (nevada b22) to the latest (nevada b26) on my Ferrari 3400 x86 box, just to see what's new and wanted to install the new Gnome 2.12 tarballs on the latest build. So had heard of Solaris Live Upgrade, the ability to upgrade your system on the fly and thought himm sounds like something to try. So checked out our friendly sun docs "Solaris 10 Installation Guide: Solaris Live Upgrade and Upgrade Planning":http://docsview.eng/app/docs/doc/817-5505/6mkv5m1l0?a=view and wished I hadn't ;) Very long winded, hey I'm an engineer attention span of a gnat when it comes to manuals ;) So in the best engineering tradition went and picked someone else's brain [thanks "Darren":http://blogs.sun.com/dar ]. * Where's Partition Magic when you need it?* OK so first problem, when I setup Solaris on my dual boot box initially I went for 2 slices (partitions - why slices who knows?), one for root and another for my /export/home. Not so good. In order to use the Live Upgrade I needed another slice to setup my boot environment in :( Now they tell me. So thankfully with a little housekeeping I reduced my home enough to be able to copy it all into the root slice (cpio is your friend). Once that's copied off then I was able to resize my /export/home and create a new slice to hold my boot environment. Once that was done I just copied my home back to the resized /export/home. $ cd /export/home $ find . --- depth ---print | cpio -pvd /export/home2 * Format * Boy do I want a good partition manager on Solaris. Please if anyone is listening ... So off to format, then select partition, edit my home slice to change its size, setup one of the unassigned slices to 9 Gig as another root slice and I'm done. No don't forget to type label, himm obvious not. $ format > partition > print - prints out partition table showing slices [partitions] select partition to edit - change cylinder size as required Slice 3 will be our new boot environment, so set it to be same size as current root partition, adjusted slice 7 to give us enough room for new boot env slice: 0 root wm 3 - 5082 9.77GB (5080/0/0) 20482560 3 unassigned wm 5384 - 10463 9.77GB (5080/0/0) 20482560 7 home wm 10464 - 29613 36.82GB (19150/0/0) 77212800 > label > quit Need to create new file system on home slice 7 - will wipe this slice $ newfs /dev/dsk/c0d0s7 * Grabbing the ISO * Too painful to describe getting this remotely (/usr/sfw/bin/ncftp is your dearest friend, thank god for resume), but eventually got the nevada b26 iso and cut it to disc: $ cdrw ---iv solarisdvd.iso [ create DVD of ISO image ] * NOTE: Using the latest Live Upgrade tools * [Comment from UVR] You need to make sure to be using the Live Upgrade tools from the release you are upgrading too :( I checked that the lu* packages hadn't changed between b22 and b26, so thought I was safe enough skipping this step. But if they have changed you will get an error. So to be safe: 1. Install the Solaris lu packages from the ISO you have just grabbed above and install them in the current image you are running and want to upgrade from. 2. Use the new lu tools for the live upgrade.

* Create Boot Environment *
Now all ready to go. Create your new boot env from the command line (can do it from a curses app, xterm -e lu &, but command line simpler and faster).

$ lucreate ---c solenv_s0 ---m /:/dev/dsk/c1d0s3:ufs -n solenv_s3
Creation of boot environment  successful.
$ lustatus solenv_s3

Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
solenv_s3                  yes      no     no        yes    -

* Upgrade and Activate * Now that I have my boot environment and my iso all I had to do to upgrade the boot environment was: $ luupgrade ---u ---n solenv_s3 -s /cdrom/sol_11_x86/ $ luactivate solenv_s3 -> activates new upgraded boot environment To check it out the upgrade before running just put in -N as the first param and this will do a dry run to check out your params and so on. 2 hrs later, the upgrade completed, did the activate, rebooted and it was all done, hooray !! Then I just went and downloaded the Gnome 2.12 tarball and installed it on my new nevada b26 boot environment and all was well with the world. * Next Time * This will be so much easier next time round, isn't it always ;) Will just have to grab the ISO, and type the above luupgrade comand targeting my now old version of Solaris solenv_0. Follow this with an luactivate, reboot and we are good to go. * Install suggestion * Wouldn't it be nice if you where installing Solaris for the first time on an x86 Windows machine and the installer setup everything by default to make LiveUpgrade easy. So during install it could setup for dual boot, make Solaris the default (optionally), then create two root partitions (slices) and one /export/home. Explaining to the user as you go that this will allow users to upgrade their version of Solaris, whilst still maintaining their current version completely intact.