Automount Remote Shares.

Status
Not open for further replies.

J.P.

Cadet
Joined
Mar 14, 2014
Messages
4
Please add a feature to map / mount remote shares on freenas.
and maybe something that will have an automount at startup feature.

Thanks In Advance.
 
D

dlavigne

Guest
Please create a feature request at bugs.freenas.org and post the issue number here.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Uh.. you realize you could do this from a script?
 

andyclimb

Contributor
Joined
Aug 17, 2012
Messages
101
I'm in the same boat.... so far I've got close but not quite there...

This command will mount a samba share, prompting for a password...
Nas = name of server
media = user

Code:
mount_smbfs -I 192.168.1.80 //media@Nas/Multimedia /mnt/SSD/mounts/Multimedia-qnap


the -I flag overrides the lookup of Nas

if you use a -N flag as well then it does't prompt for a password but the problem is that you need to edit a ~/.nsmbrc file, which resides in the root home folder... which is obviously not writable... a cool way around this is to create a folder in a zfs pool and use an init/shutdown script to join them as shown below.. it needs to be a type: command + post-init
Code:
mount -t unionfs -o noatime /mnt/SSD/root /root


with that done create a .nsmbrc file in ~/ with the contents shown below. the computer:user MUST BE IN CAPS

[NAS:MEDIA]
# use persistent password cache for user 'joe'

password=xyz


Save the file... now when you run you mount_smbfs command with the -N it should mount without the password prompt.. mine works.

Now technically if this is run as a post-init command in freenas it should auto mount the share... mine does not though so not sure why.
any other ideas appreciated..

cheers
 
Status
Not open for further replies.
Top