ZFS NFS Share Configuration_
ZFS NFS Share Configuration_
Bash
# zfs set share=name=data,prot=nfs,ro=*,anon=0 rpool/export/share/data
This command configures the desired NFS options for the rpool/export/share/data
filesystem. Let's break down each component:
● zfs set share=: This initiates the process of setting the share property for a ZFS
filesystem.
● name=data: This assigns a local name, "data," to this specific NFS share instance.1
This name serves as an identifier for managing this particular share and can be
chosen by the administrator. Naming the share provides a reference point for
potential future modifications or when managing multiple shares on the same
filesystem.
● prot=nfs: This explicitly defines that the share configuration is intended for the
NFS protocol.1 ZFS also supports other sharing protocols like SMB, which would
be configured using prot=smb. Specifying the protocol ensures that the
subsequent options are interpreted in the context of NFS sharing.
● ro=*: This option configures read-only access for all client hosts that attempt to
mount this share.1 The asterisk (*) acts as a wildcard, indicating that this
restriction applies universally to any client accessing the share. This directly
addresses the 'readonly' requirement of the user query, ensuring that clients can
only view and copy data but cannot make any modifications.
● anon=0: This setting controls the mapping of anonymous users, specifically
preventing them from being mapped to the root user ID (0) on the server.3 By
default, NFS might map anonymous requests to a non-privileged user like
'nobody'. Setting anon=0 further restricts access by ensuring that
unauthenticated users do not gain root privileges, enhancing the security posture
of the shared resource. It's worth noting that a more restrictive setting, anon=-1,
would deny access to unauthenticated users altogether.4
● rpool/export/share/data: This specifies the target ZFS filesystem for which this
NFS share configuration is being applied. This is the specific resource that the
user intends to share over the network with the defined options.
Table 1: ZFS Properties for NFS Sharing Configuration in Oracle Solaris 11.4
Bash
It is crucial to understand that both setting the share property with the desired
options and enabling the sharenfs property are necessary steps to establish a fully
functional NFS share with specific configurations in Oracle Solaris 11.4.
However, in certain situations, such as after the initial configuration of the NFS server
service or if changes are not immediately reflected, it might be necessary to manually
refresh the NFS server service using SMF.7 This prompts the NFS server to re-read its
configuration and recognize the newly enabled share. The command to refresh the
NFS server service is:
Bash
# svcadm refresh nfs/server
Additionally, it's important to ensure that the NFS server service is enabled and
running. The following commands can be used to check the status and enable the
service if it's not already active:
Bash
Bash
# svcs nfs/server
The svcs command will display the status of the nfs/server service, indicating whether
it is online and active. While the activation of NFS shares through ZFS properties is
generally automatic, understanding how to manage the NFS service via SMF is
essential for troubleshooting and ensuring the availability of the shared resource.
zfs get share Displays the configured NFS Output shows share
rpool/export/share/data share options. name=data,path=/rpool/expor
t/share/data,prot=nfs,anon=0,
sec=sys,ro=* local.
Conclusion
Configuring NFS shares with specific options like read-only access and controlled
anonymous access in Oracle Solaris 11.4 is efficiently managed through ZFS
properties. The process involves setting the desired NFS parameters using the share
property and then enabling the share using the sharenfs property for the target ZFS
filesystem. Thorough verification using server-side and client-side commands is
essential to ensure the configuration meets the intended requirements. While the
steps outlined provide a solution for the user's specific query, it is important to
consider broader security implications when managing NFS shares. For enhanced
security, using more restrictive options like anon=-1 to deny anonymous access
altogether is recommended where appropriate. Additionally, implementing
network-level security measures such as firewalls further strengthens the protection
of NFS-shared resources.
Works cited
1. Sharing and Unsharing ZFS File Systems - Oracle Solaris Administration, accessed
on April 1, 2025, https://docs.oracle.com/cd/E23824_01/html/821-1448/gayne.html
2. New ZFS Sharing Syntax - Oracle Help Center, accessed on April 1, 2025,
https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/manage-
zfs/new-zfs-sharing-syntax.html
3. Changes to sharenfs on ZFS in Solaris 11 :: growse.com, accessed on April 1, 2025,
https://www.growse.com/2012/02/11/changes-to-sharenfs-on-zfs-in-solaris-11.ht
ml
4. NFS-Specific share Options - Oracle Help Center, accessed on April 1, 2025,
https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/manage-
nfs/nfs-specific-share-options.html
5. Document Information - Oracle® Solaris 11.4 Network File Sharing Cheatsheet,
accessed on April 1, 2025,
https://docs.oracle.com/cd/E37838_01/html/E75575/index.html
6. Solaris 11 Creating NFS Exports with ZFS - YouTube, accessed on April 1, 2025,
https://www.youtube.com/watch?v=liKnAoqowNA
7. Repository Management Privileges - Creating Package Repositories in Oracle®
Solaris 11.4, accessed on April 1, 2025,
https://docs.oracle.com/cd/E37838_01/html/E60982/gmibm.html
8. Displaying ZFS Share Information - Oracle Help Center, accessed on April 1, 2025,
https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/manage-
zfs/displaying-zfs-share-information.html