To make my life easier while testing ZFS on root, I wrote a simple script to automate the installation, as documented on Tabriz's blog, which you should read before going any further...

As with anything new like this, I'm going to apply a strong disclaimer : this works for me on the machines I've tried it on, but YMMV -- make a backup of data you care about on your system, cross your fingers before running it and think happy thoughts!

For the script to work, you need to run it as root on an x86/x64 machine with a fresh install or upgrade of Solaris Express from nv_37 upwards (not just BFUd to that level, but optionally with any BFUs after that date). Give the script arguments of disks or slices with enough space to install your root filesystem, and those disks or slices must not be mounted when you run the script.

Whew. With all those disclaimers disclaimed, you can get the script here - all comments welcome!

Updated 12th May 2006: Fixed a problem with the script not understanding comment lines in /etc/vfstab. Works fine now.

Updated 16th May 2006: Carl suggested a few things in the comments, so I've updated the usage message, and added an exit 0 to be polite. (Thanks Carl!)

Updated 22nd May 2006: Clarifications on Carl's point mean I've now got the exit 0 in the right place :-)


Comments:

The script needs exit 0 put in the end of run-me-zfs-root.sh and it'd be nice to have a prompt suggesting mirror or raidz for the disks in use for the root f/s. thankyou for the script, very helpful!

Posted by Carl Brewer on May 16, 2006 at 09:13 AM IST #

Thanks for the kind words Carl! Needs an exit 0 ? Seems to work without, but you're right, just to be polite, I've added it. Also tweaked the usage message to ask for zpool options, with examples including raidz. Glad you've found it useful!

Posted by Tim Foster on May 16, 2006 at 09:32 AM IST #

My mistake, it's not the run me zfs root script, it's the one that copies the boot file around at boot-time that needs it. bootadm should be this, or similar : #!/usr/bin/sh /sbin/bootadm.real "$@" /usr/bin/cp /platform/i86pc/boot_archive /ufsroot/platform/i86pc/boot_archive.zf s exit 0 If the exit 0 isn't there, my PC running b38 doesn't mount / as rw and drops into maintenance mode. Also, the script didn't create a mountpoint for /dev/fd in the zfs filesystem, which can cause some subtle breaks down the track if it's not present. My install is : scratchy: {33} uname -a SunOS scratchy 5.11 snv_38 i86pc i386 i86pc One question I have, which maybe you can help with? My aim with this box is to have a zfs mirrored filesystem (I'm looking at an alternative to NetBSD's RAIDFrame on /, or the old Sun ODS stuff). As it stands at the moment, I'm using a third disk as my initial disk, which is the ufsboot drive, and also holds swap. This means I have a reliance on that single point of failure at the moment (kinda defeating the purpose of the mirror!). It's reasonably easy to replace that disk if it dies with minimal downtime, but it will still involve an (undocumented at this time!) install so it can work with the ZFS root FS your script helps set up. Do you know if there's any plans within the ZFS developer community to make ZFS a true native filesystem that grub or something else can work with, to get rid of the single disk requirement? Or would I be better off using ODS and UFS to mirror the root FS like in the old days, and then using ZFS to look after everything else? Thanks again!

Posted by Carl Brewer on May 17, 2006 at 09:28 AM IST #

hey Carl,

My answer is an emphatic "yes" to all of your (excellent) questions - zfsroot is really at demo stage right now; it's not yet fully integrated and there's work going on to address all of your concerns, particularly with grub booting - zfs will be a 1st class citizen during boot, as much as ufs was for root filesystems. It'll be a while before that support's delivered. However, I know that Tabriz, Lori and Bill are working hard on this, though I don't yet know a timeframe (being merely an innocent bystander (or enthusiastic cheerleader) in all this: I'm a ZFS tester, as opposed to a core developer - but I'll get there one day!)

I'll have a look at the problems you're seeing with the script - I too have had to svcadm clear boot-archive to get beyond a particular stage of boot (which I had thought was a problem with too many entries in /boot/solaris/filelist.ram, but don't quote me on that just yet)

When I've a bit more time on my hands, I plan on investigating a bit more, and seeing if I can workaround the problem in the script, but as I say, for now, zfsroot is in the development stages [ although I for one am *already* finding it hugely useful :-) ]

Posted by Tim Foster on May 17, 2006 at 10:05 PM IST #

Hello Tim, just a quickie ... it kinda looks like ZFS root/boot stuff has stalled, from an outsider's perspective, it doesn't look like there's been any progress on grub/zfs integration so we can start to use it for real? Thankyou for your time & effort thus far

Posted by Carl Brewer on January 01, 2007 at 02:54 AM GMT #

Regarding script zfs-root-install.sh line 156; this fails because these directories do not exist. What is your recommended solution at this point (where the script exited)? /zfsroot/boot and /zfsroot/boot/solars

Posted by Brian Rydzeski on January 29, 2007 at 03:21 PM GMT #

Brian - there's enough context for me to work out what's going on in your situation (line 156 for me, says "cat >> /zfsroot/etc/system <<END". Based on what you say, it could be the line 162, which reads:

"echo "etc/zfs/zpool.cache" >> /zfsroot/boot/solaris/filelist.ramdisk"

Now, if you don't have a /zfsroot/boot/solaris, then it sounds like something went wrong with the initial cpio of your ufs root to /zfsroot, but it's hard to tell...

Drop me a mail, I'll try to help.

Posted by Tim Foster on January 29, 2007 at 03:34 PM GMT #

Yep, things have seemed a bit slow alright - there's work going on the sparc side of things at the moment (can't use the grub-based solution on sparc), but us folks in zfs-test haven't been given official bits to exercise yet. It'd be nice if the dev guys were more public about their progress, I admit.

Posted by Tim Foster on January 29, 2007 at 03:38 PM GMT #

Perhaps I have an older version of the script. I looked in the zfs-root-intall.sh script and found this starting on line 69: 69: cd / 70: find . -xdev -depth -print | cpio -pvdm /zfsroot 2>&1 > /dev/null From that I looked in my root directory, and I do not have /boot. Okay, and here is the 'ah-ha' for you. I am trying this on a SPARC system. I need to practice for a project I have. I'm just experimenting for now. I loaded the system from the SPARC 11/06 DVD on a SunBlade 2000. You can email me directly if you'd like to.

Posted by Brian Rydzeski on January 29, 2007 at 04:03 PM GMT #

Cool - yep, that's the "Aha" :-) The ZFS mountroot procedure is still x86 only unfortunately. The work to get sparc booting from ZFS is ongoing at the moment!

Posted by Tim Foster on January 29, 2007 at 04:06 PM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2010 by timf