Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

export ZFS filesystem over NFS

Featured Replies

I currently have a zpool of a few SSDs with a few ZFS volumes on there.  I need to export one of the volumes over NFS.  The problem is that, unlike the SMB settings where you can add extra config, there is no such option for NFS.  Unassigned devices won't recognize ZFS volumes, so I can't use that.  If I use the zfs set sharenfs=on command, it will work then, but will not stay shared after a reboot or if any changes are made to any share setting.

 

My solution was to write a script that runs when the array is 1st started that echos the lines of config I need into /etc/exports and then restarts nfsd.  The problem is that whenever some config changes are made, it results in /etc/exports getting blown away, regenerated and a restart of nfsd.  

 

Any thoughts on how I could get the two extra lines I need added every time /etc/exports get regenerated?

 

TIA,

-dev

  • 3 years later...

Super old thread, but I have the same problem. I just do exactly that myself. Sometimes it drops out because of another config somewhere in Unraid. And Samba I wanna use less possible.

  • 4 months later...

i created 3 scripts for this problem

one to regenerate shares from zfs

#!/bin/bash -e

zfs get sharenfs -H -o name,value,source -t filesystem | grep -v off |  grep -v "inherited from" | while IFS=$'\n' read LINE;
do
        LINE=($LINE)
        NAME=${LINE[0]}
        SHARENFS=${LINE[1]}
        echo regenerating share $NAME with $SHARENFS
        zfs set sharenfs=off $NAME
        zfs set sharenfs=$SHARENFS $NAME
done

 

second one to run on every shutdown of array to backup zfs nfs shares to $BACKUPLOCATION

#!/bin/bash -e

BACKUPLOCATION=/mnt/tank/storage/unraid/zfs-nfs/backup/

rsync --verbose --archive --human-readable --progress --partial --checksum --delete-after /etc/exports.d/ $BACKUPLOCATION

 

and last one to restore backup on every start of array

#!/bin/bash -e

BACKUPLOCATION=/mnt/tank/storage/unraid/zfs-nfs/backup/

rsync --verbose --archive --human-readable --progress --partial --checksum  $BACKUPLOCATION /etc/exports.d

exportfs -ra

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.