ZFS mounting failed with error 2

David Demelier demelier.david at gmail.com
Tue Apr 16 07:14:05 UTC 2013


2013/4/16 Beeblebrox <zaphod at berentweb.com>:
>>> 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
> command:
> '# 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

Thank you so much, you made my day :-) For me I thought that export
was a kind of unmounting so I should have never found if you didn't
helped me on that case :p.

>
> 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
>


--
Demelier David


More information about the freebsd-questions mailing list