Booting without remote NFS mount

Status
Not open for further replies.

fbafkis

Dabbler
Joined
Dec 14, 2014
Messages
12
Hi everybody!

I have two freenas servers, that I use for different purposes: the first contains some disks, that I use for storage and backup. On this server are configured some plugins like Owncloud, BTSync, etc. and some nfs sharings. The second server runs only some multimedia plugins, such PlexMediaServer, Sickrage, Subsonic, etc. . Because multimedia files are stored on the first server, I used the "mount -t nfs 192.168.1.46:/mnt/mediadisk /mnt" command to mount remote directories from the first server to the multimedia server, and it works perfetly. But I needed an automatic mounting on startup. So I modified the /conf/base/etc/fstab adding a line like this:

192.168.1.46:/mnt/mediadisk /mnt nfs rw 0 0

It works perfectly, but only if the first server is online. If it is powered off the media server stuck during booting on :

"[tcp] 192.168.1.46:/mnt/mediadisk: RPCPROG_NFS: RPC: Port mapper failure - RPC: Timed out"

and doesn't finish bootup.

Now I would ask you if exist a way to configure startup auto-mounting that in case of connection's fail with remote server, the local server starts normally, only without mounting remote nfs share.


Thank you for the suggestions!
 
Last edited:

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Modifying the system in this manner is a very bad idea. Despite what you think, it doesn't "works perfectly" - as you yourself note later in the message.

If you have a jail, you should probably be performing the NFS mount from the jail.

You're also probably looking for an NFS soft mount, not the hard mount that you've configured.
 

fbafkis

Dabbler
Joined
Dec 14, 2014
Messages
12
Thank you for answering! So, how could I perform a soft mount on freenas? I searched around, but haven't found any guide!
 

fbafkis

Dabbler
Joined
Dec 14, 2014
Messages
12
Ok, thank you, but that's not an example of automatic on startup soft mounting. I tried to add the soft option in the fstab file, but nothing changes!
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Use a script that you put as an init script in the GUI ;)
 

fbafkis

Dabbler
Joined
Dec 14, 2014
Messages
12
Great idea! So it is enough to create a "command" type, post init task like :

mount -F nfs -o rw,soft 192.168.1.46:/mnt/mediadisk /mnt

?

Or should I add other options to the command?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Doing it as a post-startup command or script means it happens after system startup has occurred; this may be closer to what you want to happen. You probably don't want to be mounting it on /mnt though.
 
Status
Not open for further replies.
Top