Remote NFS mount

Status
Not open for further replies.

phreak

Cadet
Joined
Feb 20, 2013
Messages
7
Hello all,

I have just recently started using Freenas and for all account it is quite a good looking system. However, there is something I am trying to do that I as yet have not found a way to.

Basically, the freenas server is going to become my new file server for a site. However, a lot of our old archive files are stored on a NAS storage on a seperate server. What I want to do is mount these folders through to the freenas so that it is all in one place for the users to see.
I have managed to mount it ok with the following command.

mount_nfs 10.10.10.1:/share /mnt/sharepath

However, I want this to be a permanent mount and not get lost when or if the freenas server gets rebooted. I have seen that I can't just do it in fstab as that gets generated on boot. So, any ideas on how this would be achieved? I found /etc/rc.d/ix-fstab that seems to be the file that generates the fstab on boot. I wondered if there was a way to manipulate that to put my mount in on boot?

Or is there some other way to do what I need?

Thanks in advance.
 

phreak

Cadet
Joined
Feb 20, 2013
Messages
7
Oh and I also tried

mount_smbfs -N -I 10.10.1.1 -W workgroup //user@remote_system/share /path/to/local/mount

and then added the server and username/password details into /etc/nsmb.conf but that didn't seem to work as the file gets generated on boot again.

Just in case it makes a difference, the NAS I am trying to mount from is a Netgear Readynas.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
I'm not sure if sharing a share is really a good idea at all. I know there are potential performance issues when you are copying from one share to another share from your PC. Also things can get really screwed up(I've seen data loss) when you try to move a file from foldera to folderb but foldera is on the server and folderb is actually a file share to another server.

I think what you need to read up on is using /etc/fstab(at least, that's what you want to look at in linux). Keep in mind that the settings will be lost whenever you upgrade FreeNAS.

Another option if you are forced to share a share is to use a cronjob and make a .sh file with the commands you want. Put the .sh file on your zpool somewhere(preferably where nobody will see or mess with it). Then setup the cronjob to run at startup. There is a way to make it trigger only on startup.

But really, I think that trying to share a share is a VERY bad idea and won't end well for you in the end. I'd just let users deal with 2 separate drives or migrate the data over to FreeNAS(how much inconvenience can this honestly be?). Somehow I expect if you really do share a share you'll be back here in a few days asking why stuff is afu, there's weird errors when access files, and some files are corrupted. So if you do this, you need to make sure you are making religious backups of all of the data on all of the servers.
 

phreak

Cadet
Joined
Feb 20, 2013
Messages
7
Hi CJ,

Thanks for your advice, however, the archive folders I wish to mount through to this freenas box are purely for reference. They will not be having any data moved in or out of them. They will just be there so the users have all the necessary data available to them to view, not to change.

Mapping them through directly to the Readynas is not ideal to be honest. Currently we have Clearos, which is what Freenas will be taking over from, which does allow me to do this action without much fuss and as you state, through /fstab. But from what i have seen that file gets regenerated after a reboot of Freenas, so I would not be able to modify that to do what I need, unless I need to do something else to get any changes to stick?
 

phreak

Cadet
Joined
Feb 20, 2013
Messages
7
Also, you mention there is a way to get a script to run only on startup. Any clues as to how this might be done on a freenas box?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Also, you mention there is a way to get a script to run only on startup. Any clues as to how this might be done on a freenas box?

Yes, use a cronjob. Do a little googling and I'm sure you'll find the answer. I don't remember exactly how to do it off the top of my head.
 
Status
Not open for further replies.
Top