On FreeBSD 10.0, when one creates zfs partitions and configures where they are mounted (permissions, etc.), where is this information stored? /etc/fstab
is largely empty.
i.e.:
$ zfs mount
zpool0/ROOT/default /
zpool0/home /home
zpool0/tmp /tmp
zpool0/usr /usr
zpool0/usr/local /usr/local
zpool0/usr/obj /usr/obj
zpool0/usr/ports /usr/ports
zpool0/usr/ports/distfiles /usr/ports/distfiles
zpool0/usr/ports/packages /usr/ports/packages
zpool0/usr/src /usr/src
zpool0/var /var
zpool0/var/crash /var/crash
zpool0/var/db /var/db
zpool0/var/db/pkg /var/db/pkg
zpool0/var/empty /var/empty
zpool0/var/log /var/log
zpool0/var/mail /var/mail
zpool0/var/run /var/run
zpool0/var/tmp /var/tmp
I have grepped thru /etc
and /var
for strings found above and I am not getting any hits.
ZFS pool information is not stored in a plain text file. Information about a pool is stored on the disks themselves. ZFS pool information can also be written to a ZFS cache file, but it does not contain mount point information.
If you want to get mount point values for your ZFS pools you can use the following:
If you want to change mount point values you can use the
zfs set
command. More information about managing mount points.Additionally, here are some other helpful commands you can use to get information about your ZFS pools:
If you would like to find out where your ZFS pool cache file is you can use the following command:
Specifically for your case:
If you want to read information from that file you can use the
zdb
command. Be careful using this command. It can be dangerous to use. More information.A ZFS pool can be created without a cache file, so if the
zpool get cachefile
command doesn't show one don't panic.Edit: I updated my answer, Michael is correct that the ZFS pool cache file doesn't contain informaiton about mount points. However, I'll still leave the information about the cache file just in case someone finds it useful.
As Gene points out, the list of file systems (not partitions!) in a ZFS pool is stored within the pool itself. Specifically, it is stored as a part of the pool metadata, which is not easily accessible in raw form.
You can access the metadata using
zdb
(the ZFS debugger tool), but you need to be careful as well as have some familiarity with the ZFS on-disk format to correctly interpret the output from some of the possible invocations of zdb. (It is, after all, a debugger.)You can also work with it using other ZFS commands, including the subcommands of the
zpool
andzfs
commands.Normally when working with ZFS file systems you will just use the
zfs
commands, likelyzfs create
,zfs destroy
(careful; this one really does do what it says on the tin!),zfs get
andzfs set
. In your specific case you will probably be most interested in themountpoint
attribute, which specifies two things:legacy
, that the file system is mounted "manually" (using non-ZFS-aware tools) such as plain oldmount
(possibly through /etc/fstab) while specifying a mount pointnone
, the file system cannot be mounted; this is similar to settingcanmount
tooff
ZFS cache files are not related to this, as the cache file only contains pool information, and you are asking about filesystem information. Filesystem metadata is always stored in the pool itself.