Auto Mount NFS Export in unRAID


Recommended Posts

Is there a reliable way in unRAID to mount and NSF volume during or shortly after boot? I'm relatively new to unRAID and have been searching and compiling a few things in an effort to make this work.

 

I have an existing NAS that stores my main data set and it needs to stay where it is. I want to access the existing data via NFS inside unRAID. This is easy enough to accomplish once the unRAID server has booted, but it appears that unRAID will overwrite any changes to the fstab file upon system boot. I have tried my hand at writing a few go scripts, but they don't appear to do anything...likely because I didn't set them up right or place them in the correct directory. I tried to replace the FSTAB file at boot with a script, but had trouble mounting it's contents in an automated manner afterward.

 

I've tried a few different ways to accomplish what I want, but none seem to work as intended. This was my last attempt:

 

1. Create a script that checks to see if the NFS volume is mounted: If not then it will mount (on bootup), if already mounted then it will unmount (on shutdown). I've read that by placing the script in the '/usr/emhttp/plugins/scripts/event' folder it will run on boot and shutdown. Below is what I was using:

 

#!/bin/bash
# if doesn't exist mount, otherwise unmount
#
if grep "Movies" /etc/mtab &>/dev/null; then
    umount /mnt/user/Media/Movies
else
    mount 192.168.1.113:/volume1/Movies /mnt/user/Media/Movies -o rw,hard,intr,nolock,addr=192.168.1.113
fi

 

2. Now invoke the above script by adding a line to the /boot/config/go file. The lines added will copy the script to the event folder and make it executable:

 

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &

#Copy my scripts and set permissions by making them executable
mkdir -p /usr/local/emhttp/plugins/scripts/event/
cp -a /boot/scripts/. /usr/local/emhttp/plugins/scripts/event/
chmod +x /usr/local/emhttp/plugins/scripts/event/.

 

I have tested the script manually and it works great, but can't get it working automatically. I must be placing it in the wrong folder or perhaps I've fat fingered something in my scripting.

 

Any assistance is greatly appreciated!

Link to comment

Unassigned Devices plugin has the ability to mount network shares.

 

Interesting...thanks for the info. Appears that it lets you mount SMB shares, but not very clear if remote NFS shares can be mounted with it. I'll give it a try.

 

-----------------

Edit: It appears from the following posts that mounting remote NFS exports is possible as well:

https://lime-technology.com/forum/index.php?topic=44113.msg421817#msg421817

http://lime-technology.com/forum/index.php?topic=45807.msg438617#msg438617

Link to comment

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.