10.1 ZFS - why canmount=off for /usr and /var by default?

John Goerzen jgoerzen at complete.org
Sun Feb 15 03:53:52 UTC 2015


So this is a fresh 10.1-RELEASE install, with the guided/automatic ZFS
setup on a single hard disk.  Couldn't be simpler, right?  Except
something is odd with /usr and /var.  Consider:

# zfs list | egrep 'NAME|usr'
NAME                 USED  AVAIL  REFER  MOUNTPOINT
zroot/usr            607M   216G    96K  /usr
zroot/usr/home       180K   216G   180K  /usr/home
zroot/usr/ports      607M   216G   607M  /usr/ports
zroot/usr/src         96K   216G    96K  /usr/src

Now, I've installed 5GB of packages into /usr/local.  There's no way
/usr is only using 607M.  So I thought, hmm, maybe they're not being
mounted.  And indeed:

# zfs list -o name,mountpoint,canmount,mounted | egrep 'NAME|no'
NAME                MOUNTPOINT  CANMOUNT  MOUNTED
zroot               none              on       no
zroot/ROOT          none              on       no
zroot/usr           /usr             off       no
zroot/var           /var             off       no

And, of course:

# df -h /usr/local
Filesystem            Size    Used   Avail Capacity  Mounted on
zroot/ROOT/default    220G    4.5G    216G     2%    /

(I have compress=lz4 set for everything)

So, the next question is: why?  Why is there a /usr and a /var, which
show up in zfs list with a mountpoint of /usr and /var, but which aren't
being mounted?  Why is canmount=off for these?  And if canmount=off, why
give it a mountpoint which looks rather misleading in a zfs list?

I promise to stop asking questions soon! :-)

Thanks,

John



More information about the freebsd-questions mailing list