Where are zfs settings written?
Solution 1:
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:
zfs get mountpoint <pool name>
zfs get mountpoint <pool name>/<dataset>
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:
zfs list
zpool list
zpool status
If you would like to find out where your ZFS pool cache file is you can use the following command:
zpool get cachefile <pool name>
Specifically for your case:
zpool get cachefile zpool0
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.
Solution 2:
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
and zfs
commands.
Normally when working with ZFS file systems you will just use the zfs
commands, likely zfs create
, zfs destroy
(careful; this one really does do what it says on the tin!), zfs get
and zfs set
. In your specific case you will probably be most interested in the mountpoint
attribute, which specifies two things:
- If set as a path, the mount point of that ZFS file system in the overall file system hierarchy, and automatic mounting
- If set to
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 point - If set to
none
, 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.