--- wikisrc/zfs.mdwn 2021/02/14 16:35:50 1.32 +++ wikisrc/zfs.mdwn 2021/02/17 17:25:45 1.33 @@ -109,6 +109,34 @@ areas to be included include: - disklabel partitions (e.g., /dev/sd0e) - wedges (e.g., /dev/dk0) +Information about created or imported pools is stored in +/etc/zfs/zpool.cache. + +## pool importing problems + +While one can "zpool pool0 /dev/wd0f" and have a working pool, this +pool cannot be exported and imported straigthforwardly. "zpool +export" works fine, and deletes zpool.cache. + +"zpool import", however, only looks at entire disks (e.g. /dev/wd0), +and might look at slices (e.g. /dev/dk0). It does not look at +partitions like /dev/wd0f, and there is no way on the command line to +ask that specific devices be examined. Thus, export/import fails for +pools with disklabel partitions. + +One can make wd0 be a link to wd0f temporarily, and the pool will then +be importable. However, "wd0" is stored in zpool.cache and on the +next boot that will attempt to be used. This is obviously not a good +approach. + +One an mkdir e.g. /etc/zfs/pool0 and in it have a symlink to +/dev/wd0f. Then, zpool import -d /etc/zfs/pool0 will scan +/etc/zfs/pool0/wd0f and succeed. The resulting zpool.cache will have +that path, but having symlinks in /etc/zfs/POOLNAME seems acceptable. + +\todo Determine a good fix, perhaps man page changes only, fix it +upstream, in curent, and in 9, before removing this discussion. + ## mount order NetBSD 9 mounts other file systems and then ZFS file systems. This can @@ -126,13 +154,15 @@ zfs filesystems can be exported via NFS, The "zfs share" command adds a line for each filesystem with the sharenfs property set to /etc/zfs/exports, and "zfs unshare" removes -it. \todo Explain if /etc/zfs/exports is used and whether this makes -any sense on NetBSD. +it. This file is ignored on NetBSD-9 and current before 20210216; on +current after 20210216 those filesystems should be exported (assuming +NFS is enabled). It does not appear to be possible to set options +like maproot and network restrictions via this method. -On current as of 20210214, a remote mkdir of a filesystem mounted via +On current before 20210216, a remote mkdir of a filesystem mounted via -maproot=0:10 causes a kernel NULL pointer dereference. This is now -understood and expected to be fixed very soon. See -[misc/55042](http://gnats.netbsd.org/55042). +fixed. + ## zvol