-
-
Save miigotu/c7df712997cd8745bd7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If all shares only contain files owned by the same user and group, it is simplified: | |
# Create /export and a dir inside of it for each nfs share you want to export. | |
sudo mkdir -p --mode=777 /export/Videos /export/Movies /export/Music /export/Pictures | |
# Remove other exports, and just add this line to /etc/exports, | |
# change anonuid=1000 and anongid=1000 to the userr and group id who owns files in those shares. | |
# Change async to sync if you plan to write important data over these shares, Kodi only writes to them on exporting your library, # and async is faster. Don't remove nohide, all_squash, insecure, crossmnt, or fsid=0. they are needed for the one liner to work, # on EVERY setup doing it this way. | |
/export 192.168.10.0/24(rw,nohide,no_subtree_check,all_squash,anonuid=1000,anongid=1000,async,insecure,crossmnt,fsid=0) | |
# Bind the dirs you want to share from those mountpoints in /etc/fstab, one line for each subdir of /export | |
/media/2TB/Videos /export/Videos none bind 0 0 | |
/media/2TB/Movies /export/Movies none bind 0 0 | |
/media/2TB/Music /export/Music none bind 0 0 | |
/media/2TB/Pictures /export/Pictures none bind 0 0 | |
# Mount all mounts | |
sudo mount -a | |
# Export the shares | |
sudo exportfs -ra | |
# Restart the nfs server | |
sudo service nfs-kernel-server restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment