Solved [Solved] ZFS show mount points?

sossego

Retired from the forums
What is the command to show the mount points within the ZFS root because I am not sure if I did mount the jail on this install or on the previous?
 
That is quite a versatile command and sometimes easily overlooked. You probably know this one already but also don't forget about the -r and -t options you can use with list as well. So basically listing something recursive (which I often do when I need to check up on /usr/ports which sits on zroot/ports on my system) using -r. And also to select what kind of filesystems you want to list (I often use all or snapshot) using -t.

I figured I might mention this as well; these are the options I often overlooked in the past :)
 
zfs list will show the datasets, but it will also show unmounted sets. To really see what's mounted just use the mount command. If you enter the command without any arguments it will show a list of all mounted filesystems, regardless of the filesystem type. I sometimes forget if I mounted something or not too.

Quite handy is the -r switch for zfs get: zfs get -r mountpoint mypool
 
zfs list with the -o option is also pretty nifty. It outputs a nicely formatted table containing any properties you want:

Code:
# zfs list -o name,mountpoint,mounted,my.custom:property
NAME                             MOUNTPOINT                        MOUNTED  MY.CUSTOM:PROPERTY
storage                          /storage                              yes  -
system                           none                                   no  -
system/ROOT                      none                                   no  -
system/ROOT/default              legacy                                yes  -

This command is used by the FreeBSD rc scripts (with the -H option to make it machine readable) to list ZVOLs (-t volume) that have the FreeBSD swap property set.
 
There are also options for sorting the output by a field in ascending or descending order, the -s and -S options. I used those quite heavily when I wrote my own ZFS snapshotting and snapshot rotation scripts.
 
Back
Top