Mount SMBFS through fstab

Status
Not open for further replies.

talon42

Dabbler
Joined
May 15, 2012
Messages
33
I don't seem to be able to find clear instructions on how to mount smbfs shares within or (to jails) using fstab. It seems like it should be fairly straight forward or at least should be an option from within the freenas gui. I'm using 9.2.1.6. After spending too much time on this, I'm hoping the community can help.

I have tried:
1) modifying the /conf/base/etc/fstab. This does append the share mounts to /etc/fstab, however, the shares try to mount before the jail volume mounts and the NAS boot process fails out to shell.
'here's an excerpt from my fstab:
/dev/ufs/FreeNASs2a / ufs ro 1 1
/dev/ufs/FreeNASs3 /cfg ufs rw,noauto 2 2
/dev/ufs/FreeNASs4 /data ufs rw,noatime 2 2

//svc.music@mxserver/music /mnt/Vol0/firefly_1/mnt/music smbfs ro,-I192.168.1.10 0 0

/dev/ufs/Vol0 /mnt/Vol0 ufs rw,nfsv4acls,late 2 2
/dev/da1p1.eli none swap sw 0 0"

I do know that the syntax works as I can manually append the share to fstab once I get to shell and successfully run "mount -a". I do have a /root/.nsmbrc file with the credentials.

2) modifying each jails /etc/fstab but that doesn't seem to work (with their own /root/.nsmbrc) either. If I do a mount -a from within the jail I get this error
"mount_smbfs: kldload(smbfs): Operation not permitted".
This seems to indicate a problem with root needing to load modules but running as su doesn't seem to work either. I'm not entirely sure I want to modify the super user privileges.

Here's an excerpt from the jails /etc/fstab:
//svc.music@mxserver/music /mnt/music smbfs ro,-I192.168.1.10 0 0

3) setting the mount point folder permissions to 777 and changing the user/group to anything else user/group I've seen. Doesn't do any good.

4) writing a .sh to launch these mounts using the pre (before filesystems mount) and post init (before services start) from the gui. The post init seems to be what I would assume should work but doesn't seem to be doing the job. Do the services need to be started to mount to them?

5) using a cron task from the gui. This works with the .sh script. I'm not entirely happy about using a cron for this as it takes too long for it to kick in.

Any ideas, pointers, suggestions, best practices with this?
 

talon42

Dabbler
Joined
May 15, 2012
Messages
33
Are you able to use mount_smbfs to mount the share in your host enviroment and use the "add storage" gui for the jail to nullfs mount it?
I've tried that method in the past. I seem to recall some permissions issues. I believe at least 1 jail kept losing its read/write access because the program required different permissions then what the share was giving it. I'd have to go back and try it again to remember.
I'd really prefer the mounts were isolated to the jails though. That way they are only mapped if the jail is running.
 

Osiris

Contributor
Joined
Aug 15, 2013
Messages
148
deleted.
 
Last edited:
Status
Not open for further replies.
Top