All | 43 Folders | Accessibility | BoingBoing | Books | Computer Related | Family | Films | General | Hacking | Hobbies | Humor | Java | Links | Omni | OpenSolaris | Puzzles and Games

« J K Rowling Working... | Main | Getting Audio Workin... »
20080731 Thursday July 31, 2008

The Power of pkg image-update and ZFS

One of the things that used to drive me crazy with working on the bleeding edge of Ubuntu (rather than the stable releases), was when a

      $ sudo apt-get dist-upgrade
    

of the latest packages and a reboot would leave me in a horked state. (Admittedly this was very rarely, but still: it did happen).

I then had to work out exactly which package blew me away (usually with the help of other people that were more experienced in this area then I was), and typically revert to an earlier more stable version.

Things are different under OpenSolaris with pkg. Yesterday afternoon, I ran:

  $ pfexec pkg image-update
  DOWNLOAD                                    PKGS       FILES     XFER (MB)
  Completed                                567/567 27150/27150 1648.05/1648.05

  PHASE                                        ACTIONS
  Removal Phase                              7140/7140
  Update Phase                             21974/21974
  Install Phase                            12389/12389
  A clone of opensolaris exists and has been updated and activated. On 
  next boot the Boot Environment opensolaris-1 will be mounted on '/'. 
  Reboot when ready to switch to this updated BE.
  $

No need to reboot right away. No updating of live images. And really fast. Nice!

So this morning, I rebooted the machine. There was the new GRUB entry "opensolaris-1" (set as the default), and I went ahead and pressed Return to boot from that.

And it failed and eventually threw me back to the GRUB menu. Being a typical engineer, and failing to initially believe there was a problem here, I tried it again and it failed again.

But here's the nice part. I then simply selected the previous entry in the GRUB menu and booted from that. Now I'm back up and running nicely with the previous image.

I guess the next step in my education (or the next yak to shave depending how you look at it), is trying to work out exactly why the new boot image failed. Time to talk to some of the OpenSolaris engineers in adjacent offices.

Update:

Danek Duvall pointed me at the release notes (thanks!) and provided the magic mount command for this new OS image that is needed before you can do the update_grub command:

  $ $ su
  Password:
  # beadm mount opensolaris-1 /mnt
  # pfexec /mnt/boot/solaris/bin/update_grub -R /mnt
  Creating GRUB menu in /mnt
  Installing grub on /dev/rdsk/c5t0d0s0
  stage1 written to partition 0 sector 0 (abs 16065)
  stage2 written to partition 0, 265 sectors starting at 50 (abs 16115)

Now when you reboot, you'll see another new entry in the GRUB menu. Booting with that nicely works, and it's now a GNOME 2.22.X based system as opposed to a GNOME 2.20.X one.

Further Update

Dan Anderson pointed me at revised instructions for updating your OpenSolaris 2008.05 system (thanks!).

[]

[]

[]

( Jul 31 2008, 11:15:42 AM PDT ) [Listen] Permalink Comments [4]

Comments:

You saw the Solaris banner for a few seconds, and then it rebooted?

If that's the case, then you didn't follow the release notes fully. :) Look for the instructions for running update_grub.

Posted by 192.18.43.225 on July 31, 2008 at 11:31 AM PDT #

Thanks. So I RTFRN'ed, and found:

----
Grub Update for Those Who Upgrade From b_86 to b_93

Due to changes in the GRUB boot system, one must manually update the Master Boot Record (MBR) to include these latest changes. Failure to follow these instructions when updating from 2008.05 (build 86) to a later build will result in a system that does not boot by default and instead the original boot environment must be manually selected.

Update the GRUB configuration on your ZFS boot device(s) using the following command:

$ pfexec /mnt/boot/solaris/bin/update_grub -R /mnt

When you're ready to boot into the updated boot environment, you can reboot(1M) or init(1M) as usual.

----

So I am currently booted into my previous image, and I naively did:

$ pfexec /mnt/boot/solaris/bin/update_grub -R /mnt
pfexec: can't get real path of ``/mnt/boot/solaris/bin/update_grub''
$

I presume there is a mount step that I'm missing.

What should it be?

Posted by Rich burridge on July 31, 2008 at 12:36 PM PDT #

The instructions you give are incomplete and will result in a "bricked" system if upgrading from the currently-released OpenSolaris 2008.05. Here's the full instructions:
http://www.opensolaris.org/jive/thread.jspa?threadID=66520&tstart=0
(if the URL is munged, it's posted on OpenSolaris Announce July 14, 2008)

Posted by Dan Anderson on July 31, 2008 at 08:46 PM PDT #

Thanks Dan.

All I can say is that it worked for me.
I installed OpenSolaris 2008.05.

Then from the release notes at:

http://opensolaris.org/os/project/indiana/resources/rn3/

I did:

$ pfexec pkg refresh
$ pfexec pkg install SUNWipkg@0.5.11-0.86
$ pfexec pkg install entire@0.5.11-0.86

Then I did the:

$ pfexec pkg image-update

Then, in order to boot, I did:

$ su
Password:
# beadm mount opensolaris-1 /mnt
# pfexec /mnt/boot/solaris/bin/update_grub -R /mnt

A fresh reboot and selecting the new GRUB entry
resulting in a bootable GNOMe 2.22.X system.

This was on an Ultra 40.

If the Release Notes at:

http://opensolaris.org/os/project/indiana/resources/rn3/

are incomplete, and can result in brickable
systems, shouldn't they be updated?

Posted by Rich Burridge on July 31, 2008 at 09:28 PM PDT #

Post a Comment:

Comments are closed for this entry.