LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automated mounting of NFS connected NAS to IC-3173 RTC upon bootup within Linux

Solved!
Go to solution

I am attempting to have my IC-3173 Real Time Controller automatically mount my NAS drive within Linux during boot up.

 

I have successfully used the following manual command to get it visible and communicating with my 3173:

 

"mount -t nfs 192.168.9.12:/volume1/SHDAS /mnt/SHNFS"

 

This allows me to navigate within Linux to /mnt/SHNFS (I created this directory under the existing mnt directory) to be able to see the contents of the shared folder "SHDAS" at that IP address location.

 

However, upon power cycle of the RTC, this mounting is lost.  I need it to be there all the time even after boot up, so i want the controller to self-mount this same ethernet connected NAS drive to make it accessible with Labview.

 

After googling this topic to death for two days and getting nowhere, I am needing further advice.

 

I have amended the "fstab" file to contain the following lines:

 

# <file system>                            <mount point> <type> <options> <dump> <pass>
//192.168.9.12:/volume1/SHDAS /mnt/SHNFS nfs defaults 0 0

 

I know this is ok, because if i go to the route directory within linux (it has to be the route directory or it doesn't work!) and type:

 

"mount -a"

 

The remote shared folder "SHDAS" becomes visible within the /mnt/SHNFS directory.  But the point is, i need to type "mount -a" every time within Linux to make this the case.  Without this manual command in Linux, /mnt/SHNFS remains empty (cannot see the contents of "SHDAS").

 

How can i auto "mount -a" upon boot up of the controller?

 

If I am making life harder for myself than necessary, then any advice of a better way to do what i am trying to do would be most welcome and well received.

 

Thank you.

0 Kudos
Message 1 of 2
(272 Views)
Solution
Accepted by topic author Rissy

I FINALLY got this working today.

 

The solution was to type an extra command line into a file called "crontab" located under /etc (same location as the fstab file discussed previously)

 

The line reads:

 

@reboot root /bin/bash -c 'sleep 10 && /bin/mount -a'

 

This is basically a command to the controller to conduct an execution of the "mount -a" command upon a reboot or power up of the controller and works in harmony with the previously added line in the "fstab" file.

 

So now the NAS drive i have connected is automatically mounted every time at boot up.

 

 

0 Kudos
Message 2 of 2
(154 Views)