I have a PR4100 running 5.27.157. Works great.
One thing I’d like to change, tho: when I create an nfs share, it puts something like this in
I want to change some of the settings, mostly the
anongid. I can edit the file and apply the changes with
exports -ra, but I’ll lose them when it regenerates the file.
How can I apply those changes permanently?
Simply install any My Cloud OS5 NAS app, then edit it’s start.sh script, and append code to make the necessary changes during the startup process.
If the NFS share settings are changed via the dashboard, the app will need to be turned “OFF” then “ON” again to reapply the changes.
sed -i 's/anonuid=501/anonuid=1001/g' /etc/exports;
sed -i 's/anongid=1000/anongid=1002/g' /etc/exports;
sed -i 's/rw,all_squash/ro,all_squash/g' /etc/exports;
Finally, to “refresh” the exports, the following command must be executed.
Thanks! That’s exactly what I was looking for. I may add a cron job too.
Note to future self:
exportfs -r reloads nfs exports.
Correct, but I changed my mind and decided that simply using the OS5 script to restart the NFS server was best, because it handles everything in one shot. I added a footnote about it, just in case anyone may need to use it.
I just uploaded a Boot Script app that may make the job a lot easier. I finished creating and testing it a few weeks ago, but hadn’t got around to uploading it yet.
Thanks. I was able to make an app of my own and install it. I made a Docker image to help me run the build: docker/mksapkg: A simple docker image to help building apps for Western Digital MyCloud devices. - mksapkg - Gitea: Git with a cup of tea
nfs restart wipes out the changes to
/etc/exports, so I had to do a
exportfs -ra to get it to work.
Now that I think about it, that makes sense, because the WD NFS script would restore the default settings. I’ll change my previous post accordingly.