I am using a pool on both FreeBSD and Linux. Several filesystems are exported via NFS. So far I could not find a sharenfs line that would work for both operating systems. Instead, I am forced to use /etc/exports containing differing syntax like this:
For FreeBSD:
/z/SRC/FreeBSD/src/main -network 192.168.0.0/16
/z/SRC/FreeBSD/src/stable/15 -network 192.168.0.0/16
For Linux:
/z/SRC/FreeBSD/src/main 192.168.0.0/16(rw,root_squash,async) fec0:0:0:4d42::0/64(rw,root_squash,async)
/z/SRC/FreeBSD/src/stable/15 192.168.0.0/16(rw,root_squash,async) fec0:0:0:4d42::0/64(rw,root_squash,async)
The format described in the zfs man page seems to be for Solaris and is again different, although it also says that for FreeBSD, one could generate multiple definitions for a single pool by separating them with semicolons. This would allow me to also add the IPv6 network but is anyway incompatible with Linux.
It would be nice to have a common, mostly OS-agnostic format which gets translated to the needs of the specific OS automatically, with options not understood simply being ignored. Or maybe sharenfs_<OS> properties which override a pure sharenfs property, which might be more flexible but likely is uglier. I have even thought about using a user property and rewriting it dynamically into the sharenfs property by an OS-specific script during boot, but this would only work after a pool has been imported, and so the initial import would result in complaints from mountd whenever the other OS is booted.
If anybody is doing similar things, how are you dealing with this issue?
-- Martin
For FreeBSD:
/z/SRC/FreeBSD/src/main -network 192.168.0.0/16
/z/SRC/FreeBSD/src/stable/15 -network 192.168.0.0/16
For Linux:
/z/SRC/FreeBSD/src/main 192.168.0.0/16(rw,root_squash,async) fec0:0:0:4d42::0/64(rw,root_squash,async)
/z/SRC/FreeBSD/src/stable/15 192.168.0.0/16(rw,root_squash,async) fec0:0:0:4d42::0/64(rw,root_squash,async)
The format described in the zfs man page seems to be for Solaris and is again different, although it also says that for FreeBSD, one could generate multiple definitions for a single pool by separating them with semicolons. This would allow me to also add the IPv6 network but is anyway incompatible with Linux.
It would be nice to have a common, mostly OS-agnostic format which gets translated to the needs of the specific OS automatically, with options not understood simply being ignored. Or maybe sharenfs_<OS> properties which override a pure sharenfs property, which might be more flexible but likely is uglier. I have even thought about using a user property and rewriting it dynamically into the sharenfs property by an OS-specific script during boot, but this would only work after a pool has been imported, and so the initial import would result in complaints from mountd whenever the other OS is booted.
If anybody is doing similar things, how are you dealing with this issue?
-- Martin