10 Replies Latest reply: Oct 15, 2012 11:28 AM by muvvas RSS

    Issue with NFS share over ZFS dataset not persisting after reboot

    968093
      I'm having an issue getting NFS shares to persist after a reboot on Solaris 11.

      Here's the commands that were used to share the ZFS dataset via NFS:

      zfs set sharenfs=on data/cp/zone1/pod1/cluster1/nfs
      zfs set share=name=data/cp/zone1/pod1/cluster1/nfs,path=/data/cp/zone1/pod1/cluster1/nfs,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 data/cp/zone1/pod1/cluster1/nfs

      The 'share' command shows the NFS share and clients are able to connect:

      # share
      data/cp/zone1/pod1/cluster1/nfs /data/cp/zone1/pod1/cluster1/nfs nfs anon=0,sec=sys,root=@10.1.0.0/16

      The ZFS share property does not seem to be set on the ZFS dataset:
      # zfs get share data/cp/zone1/pod1/cluster1/nfs
      # zfs get sharenfs data/cp/zone1/pod1/cluster1/nfs
      NAME PROPERTY VALUE SOURCE
      data/cp/zone1/pod1/cluster1/nfs sharenfs on local

      After rebooting the host the NFS share does not persist. We are running 'Oracle Corporation SunOS 5.11 11.0 August 2012'.

      Any suggestions?
        • 1. Re: Issue with NFS share over ZFS dataset not persisting after reboot
          muvvas
          File system shares that are shared by using the share -a command are persistent
          zfs share -a

          refer::: http://docs.oracle.com/cd/E23824_01/html/E24456/filesystem-6.html

          http://docs.oracle.com/cd/E23824_01/html/821-1448/gayne.html

          still not coming write a rc script include
          zfs share -a
          • 2. Re: Issue with NFS share over ZFS dataset not persisting after reboot
            Cindys-Oracle
            Are you saying that share doesn't persist or the mount doesn't persist?

            If the remote (shared) resource is not mounted after reboot on the NFS client system,
            you need to add an entry for the remote resource in the /etc/vfstab and enable this service:

            client# svcadm enable svc:/network/nfs/client:default

            As described in this doc:

            http://docs.oracle.com/cd/E23824_01/html/E24456/filesystem-10.html#gentextid-2481

            Thanks, Cindy
            • 3. Re: Issue with NFS share over ZFS dataset not persisting after reboot
              968093
              Saying that the share doesn't persist.
              • 4. Re: Issue with NFS share over ZFS dataset not persisting after reboot
                968093
                I have followed the documentation at http://docs.oracle.com/cd/E23824_01/html/821-1448/gayne.html, however its still not working correctly:

                root@deviaasnas1:~# zfs set share=name=data1/nfs,path=/data1/nfs,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 data1/nfs
                name=data1/nfs,path=/data1/nfs,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16
                root@deviaasnas1:~# zfs set sharenfs=on data1/nfs

                Note that 'zfs get share' returns no result, though the documentation says it should:

                root@deviaasnas1:~# zfs get share data1/nfs
                root@deviaasnas1:~#

                Why does 'zfs share' return no result?

                After rebooting the host the share does not persist.
                • 5. Re: Issue with NFS share over ZFS dataset not persisting after reboot
                  Cindys-Oracle
                  Okay, thanks. Just wanted to be sure. The mount problem is the easier one to solve.

                  Your syntax looks correct to so I wonder if you don't have the right packages installed,
                  but in that case I would expect an error when you create the share.

                  What is the result of this command:

                  # grep data1 /etc/dfs/sharetab

                  If the result is nothing, then it is not getting shared.

                  Tomorrow, I can check on what services should be running after you create the share
                  or what packages should be installed. Any clues in /var/adm/messages?

                  What happens when you use the legacy share, like this:

                  # share -F nfs /data1/nfs

                  Can you access this share from the client?

                  I wonder if nfs is a reserved term. Can you retry this by creating a new file system and share it, like:

                  # zfs create data1/fs1

                  Thanks, Cindy
                  • 6. Re: Issue with NFS share over ZFS dataset not persisting after reboot
                    968093
                    Hi Cindy,

                    To test whether the 'nfs' keyword in the path was causing an issue I've created and shared a second file system:


                    root@deviaasnas1:~# zfs create data1/test
                    root@deviaasnas1:~# zfs set share=name=data1/test,path=/data1/test,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 data1/test
                    name=data1/test,path=/data1/test,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16
                    root@deviaasnas1:~# zfs set sharenfs=on data1/test
                    root@deviaasnas1:~# grep data1 /etc/dfs/sharetab
                    /data1/nfs data1/nfs nfs anon=0,sec=sys,root=@10.1.0.0/16

                    Interestingly no share is present until I run 'zfs set share' again:

                    root@deviaasnas1:~# zfs set share=name=data1/test,path=/data1/test,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 data1/test
                    name=data1/test,path=/data1/test,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16
                    root@deviaasnas1:~# grep data1 /etc/dfs/sharetab
                    /data1/nfs data1/nfs nfs anon=0,sec=sys,root=@10.1.0.0/16
                    /data1/test data1/test nfs anon=0,sec=sys,root=@10.1.0.0/16

                    I can mount both shares without issues on a remote client.

                    'zfs get share' still returns no result on the new share:

                    root@deviaasnas1:~# zfs get share data1/test
                    root@deviaasnas1:~#

                    After rebooting the host the shares are gone:

                    root@deviaasnas1:~# reboot
                    Oracle Corporation SunOS 5.11 11.0 August 2012
                    You have new mail.
                    root@deviaasnas1:~# zfs get share data1/test
                    root@deviaasnas1:~# grep data1 /etc/dfs/sharetab
                    root@deviaasnas1:~#
                    • 7. Re: Issue with NFS share over ZFS dataset not persisting after reboot
                      968093
                      Just tested using the legacy sharing method. This works and persists across reboots. Strange stuff, still keen to get the new zfs share method working.
                      • 8. Re: Issue with NFS share over ZFS dataset not persisting after reboot
                        968093
                        I've found the issue, having a '/' in the share name prevents the share from persisting.

                        Changing the '/' character to an '_' character resolved the issue.

                        Works:

                        root@deviaasnas1:~# zfs create data1/test6
                        root@deviaasnas1:~# zfs set sharenfs=on data1/test6
                        root@deviaasnas1:~# zfs set share=name=data1_test6,path=/data1/test6,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 data1/test6
                        root@deviaasnas1:~# zfs get share
                        NAME PROPERTY VALUE SOURCE
                        data1/test2 share name=data1_test2,path=/data1/test2,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 local
                        data1/test3 share name=data1_test3,path=/data1/test3,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 local
                        data1/test5 share name=data1_test5,path=/data1/test5,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 local
                        data1/test6 share name=data1_test6,path=/data1/test6,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 local

                        Does not work:


                        root@deviaasnas1:~# zfs destroy data1/test7
                        root@deviaasnas1:~# zfs create data1/test7
                        root@deviaasnas1:~# zfs set sharenfs=on data1/test7
                        root@deviaasnas1:~# zfs set share=name=data1/test7,path=/data1/test7,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 data1/test7
                        name=data1/test7,path=/data1/test7,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16
                        root@deviaasnas1:~# zfs get share
                        NAME PROPERTY VALUE SOURCE
                        data1/test2 share name=data1_test2,path=/data1/test2,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 local
                        data1/test3 share name=data1_test3,path=/data1/test3,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 local
                        data1/test5 share name=data1_test5,path=/data1/test5,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 local
                        data1/test6 share name=data1_test6,path=/data1/test6,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 local

                        By the way, shares with nfs in the name work correctly:


                        root@deviaasnas1:~# zfs get share
                        root@deviaasnas1:~# zfs set sharenfs=on data1/nfs
                        root@deviaasnas1:~# zfs set share=name=data1_nfs,path=/data1/nfs,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 data1/nfs
                        name=data1_nfs,path=/data1/nfs,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16
                        root@deviaasnas1:~# zfs get share
                        NAME PROPERTY VALUE SOURCE
                        data1/nfs share name=data1_nfs,path=/data1/nfs,prot=nfs,anon=0,sec=sys,root=@10.1.0.0/16 local

                        Edited by: kristofferjon on Oct 14, 2012 3:21 PM
                        • 9. Re: Issue with NFS share over ZFS dataset not persisting after reboot
                          Cindys-Oracle
                          Nice work figuring out the / in the share name. I missed that.

                          The silent failure is not good. I will add this problem to our
                          share troubleshooting section.

                          Thanks, Cindy
                          • 10. Re: Issue with NFS share over ZFS dataset not persisting after reboot
                            muvvas
                            Thanks for sharing the info.