OpenZFS – OpenZFS For HPC Clusters
Discover how OpenZFS can provide cost-effective and reliable storage for high-performance computing (HPC) workloads in this comprehensive write-up.
If you’ve configured NFS on FreeBSD before, you’ve used this configuration workflow:
You may have heard that OpenZFS provides its own sharenfs property. How does this property change the NFS configuration workflow and why would you use it? In a nutshell, it changes step #2 as you specify your configuration options using zfs set sharenfs instead of by editing /etc/exports directly.
Today’s article answers some common questions about why you would use the sharenfs property for NFS configuration and how to do so.
To understand why, consider what sharenfs and exports actually are:
While it is convenient to not have to remember to reload mountd, there are other benefits that come from sharenfs being a ZFS property:
If you already have a working NFS configuration on a FreeBSD system with OpenZFS filesystems, it is easy to recreate your configuration using zfs set. For example, this line from /etc/exports:
/usr/ports -maproot=root 192.168.15.0/24
is equivalent to this command:
zfs set sharenfs=’on,-maproot=root,192.168.15.0/24’ mypool/usr/ports
This means you can simply run the equivalent zfs set sharenfs=’on,REPLACE_WITH_YOUR_OPTIONS’ poolname/filesystem command for each line in your /etc/exports file.
You probably don’t want to run zfs set sharenfs=on on a dataset without including some restrictions, since the unspecified default is to allow rw access to any client on any network. In this example, /usr/ports is restricted to the specified network but /usr/home is wide open to anyone on any network:
zfs get sharenfs | grep on
mypool/usr/home sharenfs on local
mypool/usr/ports sharenfs on,maproot=root,192.168.15.0/24 local
If you see entries with no maproot setting in your own configuration, you should evaluate if you need to add restrictions to that filesystem’s sharenfs property.
The zfs share and zfs unshare commands can be used to enable or disable NFS sharing. Some points to keep in mind:
FreeBSD’s built-in integration of OpenZFS and NFS makes it easy for an administrator to configure and manage NFS shares. By using OpenZFS’ sharenfs property, managing NFS shares can be added to your arsenal of scripts and procedures for monitoring and maintaining the data stored on OpenZFS filesystems.
Discover how OpenZFS can provide cost-effective and reliable storage for high-performance computing (HPC) workloads in this comprehensive write-up.
The most common category of ZFS questions is “how should I set up my pool?” Sometimes the question ends “… using the drives I already have” and sometimes it ends with “and how many drives should I buy.” Either way, today’s article can help you make sense of your options.
OpenZFS is a cost-effective open source storage solution for Educational institutions. Learn how universities & system administrators can maximize its benefits.
Pingback: NFS Shares with ZFS - The web development company Lzo Media - Senior Backend Developer
Pingback: Valuable News – 2022/02/28 | 𝚟𝚎𝚛𝚖𝚊𝚍𝚎𝚗
The documentation does not work under FreeBSD 13.0
The command
zfs set sharenfs=’on,-maproot=root,172.29.2.0/24′ tank/home
gives
Apr 21 09:39:43 bsdfs01 mountd[2547]: can’t get address info for host on
Apr 21 09:39:43 bsdfs01 mountd[2547]: bad host on, skipping
Apr 21 09:39:43 bsdfs01 mountd[2547]: can’t get address info for host 172.29.2.0/24
Apr 21 09:39:43 bsdfs01 mountd[2547]: bad host 172.29.2.0/24, skipping
Apr 21 09:39:43 bsdfs01 mountd[2547]: bad exports list line ‘/tank/home on -maproot’: no valid entries
Apr 21 09:39:43 bsdfs01 mountd[2547]: can’t get address info for host on
Apr 21 09:39:43 bsdfs01 mountd[2547]: bad host on, skipping
Apr 21 09:39:43 bsdfs01 mountd[2547]: can’t get address info for host 172.29.2.0/24
Apr 21 09:39:43 bsdfs01 mountd[2547]: bad host 172.29.2.0/24, skipping
Apr 21 09:39:43 bsdfs01 mountd[2547]: bad exports list line ‘/tank/home/willi on -maproot’: no valid entries
and showmount -e is empty
thats right, I am having similar problems