ZFS mounting failed with error 2

Beeblebrox zaphod at berentweb.com
Tue Apr 16 04:49:36 UTC 2013

>> one thing I'm not sure about is that some people create a dataset root but
that actually mounts at / (and not /root) and some just create others mount
points directly on the zpool

You can do this either way. A ZFS dataset is created at the same time and
with the same name as the zpool. You can use the zpool-named-dataset as root
without any problem. As I recall, the separate root dataset was a
work-around for some old problem, so it is not necessary any longer. That
said, you can place and name the zfs root dataset anywhere you want, as long
as you have the 'vfs.root.mountfrom=' path set correctly. In your example,
it is set correctly.

Now as to why you cannot boot - from my experience, the problem is your last
'# zpool export tank' will leave the pool in an exported state, and when the
system tries to boot, it will not be able to locate the zpool because the
pool is in exportland. The solution is different. After you are finished
with all your settings you should
# zfs umount -a (unmount all tank & child datasets in /mnt)
# zfs set mountpoint=/ tank
# reboot

At step 2, dataset tank should not try to re-mount its self and remain
un-mounted. The older versions of ZFS did not behave this way and would
immediately mount the zpool on root. If this happens, you have to hard-reset
and such because the system will freeze up. If all goes well, before reboot
you can also check (zfs get all tank) and make sure that canmount=on is set
for tank.

The best zfs guide is FreeBSD's own docs: https://wiki.freebsd.org/RootOnZFS

10-Current-amd64-using ccache-portstree merged with marcuscom.gnome3 & xorg.devel

View this message in context: http://freebsd.1045724.n5.nabble.com/ZFS-mounting-failed-with-error-2-tp5802786p5804167.html
Sent from the freebsd-questions mailing list archive at Nabble.com.

More information about the freebsd-questions mailing list