20070330 Friday March 30, 2007

Friday fun with BFU and ZFS root

So, I just did a fun experiment with my new zfs root pool. I created that pool yesterday and decided it would be fun to bfu it again today, but to be able to revert back should anything go wrong.

I took a snapshot

zfs snapshot rootpool/rootfs@prebfu
made a writable version:

zfs clone rootpool/rootfs@prebfu rootpool/rootfsbfu
and then bfu'd that:

/ws/onnv-gate/public/bin/bfu nightly-nd /rootpool/rootfsbfu

That seemed to go well, no conflicts overnight. Exited the bfu shell.

Now to make the root entry in vfstab of that new root file system correct, I edited the root file system line in
/root/rootfsbfu/etc/vfstab
to look like:

rootpool/rootfsbfu      -       /       zfs     -       no      -
and then added a new entry to
/rootpool/boot/grub/menu.lst
as well:

        title Solaris ZFS-bfu
        bootfs rootpool/rootfsbfu
        root (hd0,1,a)
        kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
        module$ /platform/i86pc/$ISADIR/boot_archive
Which was a duplicate of the ZFS entry, excepting the title was different and the extra bootfs line was added.

Then I took a deep breath and rebooted. I chose the un-bfu'd root from the GRUB menu first. It still worked. Good deal, I had a recovery path.

Rebooted again and selected the new bfu'd root. Got the expected Solaris banner, but it seemed to hang. :-( Power cycled and tried again, this time pausing to edit the boot entry to include -kv on the kernel/unix line so I can get a better idea of what might be happening. Lori Alt fortuitously (for me, at least) walked by my office just at that moment, and I corralled her and explained what folly I had been engaged in. While I'm talking to her, the second attempt to boot the new root does seem to get farther, I get a complaint about how the boot-archive is out of date, and get dropped to a shell.

To make a long story short, after some thinking and several other reboots, Lori realizes that I've forgotten one step. Booted off the old root, I mark the new root as a legacy mountpoint with

        zfs set mountpoint=legacy rootpool/rootfsbfu
For good measure, we also rebuild the boot archive on that file system

        bootadm update-archive -R /rootpool/rootfsbfu
One last reboot, select the bfu'd root, and voila, I'm up and running. Too cool!

It seems like a nice next step would be to maybe make a wrapper around bfu or perhaps to have bfu itself, if, say, -Z is set, do this procedure automatically, and make the bfu'd root the default choice in menu.lst.

( Mar 30 2007, 02:42:37 PM MDT ) Permalink Comments [1]
Comments:

Looks like you have a typo here:
Now to make the root entry in vfstab of that new root file system correct, I edited the root file system line in:

/root/rootfsbfu/etc/vfstab
Shouldn't that be /rootpool/rootfsbfu/etc/vfstab

Posted by Darren Moffat on April 02, 2007 at 02:53 AM MDT #

Post a Comment:

Comments are closed for this entry.