ZFS mounting failed with error 2

Trond Endrestøl Trond.Endrestol at fagskolen.gjovik.no
Wed Apr 10 08:46:41 UTC 2013


On Wed, 10 Apr 2013 10:16+0200, David Demelier wrote:

> Hello
> 
> I have tried to create a GPT partition scheme on my machine. I've
> created some dataset like that :
> 
> tank/usr
> tank/usr/ports
> tank/usr/src
> tank/var/
> tank/var/log
> 
> (Please note that is a test on a virtual machine before applying to a
> real machine).
> 
> I've tried to generate the zpool.cache like that:
> 
> zpool import -o cachefile=/tmp/zpool.cache -o altroot=/mnt -f
> cp /tmp/zpool.cache /mnt/boot/zfs/
> 
> And then tried to set mount point to legacy and bootfs with :
> 
> zfs set bootfs=tank tank
> zfs set mountpoint=legacy tank
> 
> The following commands made a lot of warnings :
> 
> zfs set mountpoint=/usr tank/usr
> zfs set mountpoint=/var tank/var
> ...
> 
> After, the import on the livecd shell generated the error :
> 
> cannot mount '/mnt/var': failed to create mountpoint.
> 
> I must say that it is very hard to make a ZFS working machine, there
> are a lot of pages on the Wiki and most of them are a little bit
> outdated..

Try to use /tmp/mnt as a temporary altroot. /tmp should be writeable. 
Not sure about / within the livecd env.

When you set mountpoints using the above commands, the filesystems are 
actually being mounted at their specified mountpoint.

Unless the filesystems contain some actual files, more to the point, 
critical files, i.e. libraries and executables, then you are out of 
luck.

My own blog entry is a bit (out)dated, but maybe it's worth a look:

http://ximalas.info/2011/10/17/zfs-root-fs-on-freebsd-9-0/

-- 
+-------------------------------+------------------------------------+
| Vennlig hilsen,               | Best regards,                      |
| Trond Endrestøl,              | Trond Endrestøl,                   |
| IT-ansvarlig,                 | System administrator,              |
| Fagskolen Innlandet,          | Gjøvik Technical College, Norway,  |
| tlf. mob.   952 62 567,       | Cellular...: +47 952 62 567,       |
| sentralbord 61 14 54 00.      | Switchboard: +47 61 14 54 00.      |
+-------------------------------+------------------------------------+


More information about the freebsd-questions mailing list