ZFS zfs mountpoints

aswell

New Member


Messages: 11

Please help me understand ZFS, I am utterly confused and can't seem to find clarity after reading the handbook, man zpool/zfs, or searching these forums. Have been using Hammer these last few years, and am therefore likely missing something that is obvious to regular zfs users...

So, let's say I pull a zfs formatted drive with a zpool called "zroot" from a FreeBSD server, mount it as an external drive on another FreeBSD server that has a zpool called "server", and execute the following:
Code:
zpool import -R /mnt zroot
In my mind, I should see the full file system on the zroot pool mounted under /mnt. For instance, under /mnt/etc should be the /etc directory from the mounted disk, along with things like rc.conf and pf.conf from the previous machine. Am I right?

Unfortunately, what I see is:
Code:
root@serve:/ # ls /mnt
tmp     usr     var     zroot
There is no /etc, no /home, and nothing under zroot. However, when I boot from that drive, all of those directories are present.

From my perspective, when mounting the "zroot" pool under /mnt the entire directory tree should appear. What am I missing?
 
OP
OP
aswell

aswell

New Member


Messages: 11

Okay, found the right "zfs mount" incantation:
Code:
zfs mount -o mountpoint=/mnt zroot/ROOT/default
User error resolved.
 
OP
OP
aswell

aswell

New Member


Messages: 11

Will look into Boot Environments, looks like a handy thing to have.

In Hammer there are PFS's (Pseudo File Systems) that are mounted to directories in the file system, in order to access the file structure within. Simply mounting a Hammer formatted drive only shows the contents of directories that are contained in the root PFS.

It seems this is similar. I followed this wiki entry when setting up ZFS on the externally mounted drive, therefore it seems the directories visible when importing zroot are directories that would not be affected when changing Boot Environments.

It all makes a bit more sense now, and thanks moridin for pointing out the bectl man page.
 
Top