Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Jan 2012 17:17:30 -0800
From:      Matt Mullins <mokomull@gmail.com>
To:        Drew Tomlinson <drew@mykitchentable.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: ZFS Root Won't Mount - Unknown Filesystem
Message-ID:  <CAPyT1SGp=i%2Bhr1eYE3i3a8cW3-p=r7=57fbJZ2XnBRv9P102HA@mail.gmail.com>
In-Reply-To: <4F08684C.2070809@mykitchentable.net>
References:  <4F08684C.2070809@mykitchentable.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jan 7, 2012 at 7:44 AM, Drew Tomlinson <drew@mykitchentable.net> wr=
ote:
> I'm attempting a new install of 9.0-RC3 amd64. =A0My system has 4 500 GB
> drives. =A0Using this tutorial as a guide:
>
> http://www.aisecure.net/2011/11/28/root-zfs-freebsd9/

When I built my ZFS-root system, I did most of these things, except I
had a slightly different setup for the root filesystem itself.  What I
did is akin to:
  # zpool import -o altroot=3D/target -o cachefile=3D/tmp/zpool.cache zroot
  # zfs set mountpoint=3D/ zroot
  # cp -a /tmp/zpool.cache /target/boot/zfs/zpool.cache

I did not manually set mountpoints for anything but the root
filesystem.  It sounds like manually-set mountpoints are the way most
people do it, but you can try to clear the mountpoints by doing:
  # zfs inherit mountpoint zroot/fs
for each filesystem in your root pool.

> I created a boot and a freebsd-zfs partition on each drive. =A0Then I cre=
ated
> a raid1z pool using all 4 drives. =A0I followed the rest of the tutorial
> exactly and ensured that I copied the zpool.cache to boot/zfs.
>
> When I try to boot my new system, it all goes fine up until it's time to
> mount zfs:zroot. =A0It fails with an "error 2" "unknown filesystem" error=
. =A0I
> don't know if this means anything but at the mountfrom prompt, the system
> will not accept any keyboard input. =A0Same keyboard works fine when boot=
ed
> into LiveCD.

I had that same problem with mine for a while, and it turned out that
importing with the "altroot" option implies "cachefile=3Dnone"; until I
realized I needed to also specify "cachefile=3D/some/path", I had
accidentally ended up with a /boot/zpool.cache that didn't actually
reference any zpools.

> Unfortunately because I can't figure out how to get a LiveCD type
> environment with sshd running, I can't copy and paste exact error message=
s
> or command outputs.

I was using PXE/NFS booting to install this machine, so unfortunately
I can't help you here.

> I've searched and the two things that seem to be important are that there=
's
> a zpool.cache file and that the zfs partitions are correct. =A0A 'gpart s=
how
> -l' shows my partitions something close to this:
>
> 34 <big number> =A0 =A0ada0 =A0 =A0GPT (456G)
> 34 =A0 =A0128 =A0 =A0 =A0 =A0 =A0 =A0 1 =A0 =A0 =A0 null (128K)
> 162 <big number> =A0 2 =A0 =A0 =A0 disk0 (456G)
>
> What have I done wrong and what do I need to do to get my zfs:zroot pool
> mounted as root?

It sounds like you're almost there!  My guess is that the cache file
is what is missing/incorrect.

Reading over some man pages, make sure you don't do a "zpool export"
before you copy the cache file; exporting the array removes it from
the cache and/or deletes the cache file entirely.

If you end up with a LiveCD that lets you copy these things, it might
help to see
  # zpool list -o name,altroot,cachefile
  # zpool status
  # zfs list -o name,mountpoint,mounted

Hope some of this helps.
--
Matt Mullins



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyT1SGp=i%2Bhr1eYE3i3a8cW3-p=r7=57fbJZ2XnBRv9P102HA>