Mounting network shares with autofs (alternative to fstab)

Just reread the original instructions.

2 Likes

Edit the file /etc/auto.smb.shares with your favorite editor

1 Like

Thanks both. Just edited w/Putty and did CTRL-O to save.

For those struggling with the smb credentials file not being read, make sure it is owned by root. Simply create it with sudo nano ~/.smbcredentials instead of nano ~/.smbcredentials. That did the trick for me.

Sorry that is totally not true and a wrong approach.
This is my smcredentials file and it works flawless

osmc@osmc-vero4k:~$ ls -lah .smbcredentials 
-rw------- 1 osmc osmc 39 Aug  5 18:36 .smbcredentials

If you had any problems with it owned by osmc then that must have been from something else then the smbcredentials file ownership

ok, not a solution then.
[Edit] Interestingly I when revert to osmc:osmc owner, mounting still works. Strange.

2Everyone struggling with some options and commas.
CISF protocol very often requires a domain option set to credentials.
So open your .smbcredentials file with a text editor and be sure it contains a third line with
domain=WORKGROUP
or it might be something else, you must consult Windows (which you are trying to connect to) to know the exact value for that property.
The command to use for exact value would be the
systeminfo | findstr /B /C:“Domain”
at Windows cmd.

You mean like a comma or another special character in a password? I ran across some posts on another forum where they were talking about this subject and I think it isn’t that it wants a domain but rather it needs something after the password so the special characters don’t get mixed in with mount options. Their suggestion was to just enter the password before the username in the credentials file, although inserting between the username and domain is providing the same function.

Thanks! Works like a charm with a NFS share.

Regards!

I had the exact same experience. Did you ever get this working using the credentials file? Mine is working great using the password method.

Looking at https://serverfault.com/questions/594742/what-is-the-correct-escaping-for-autofs-mount-credentials-files I wonder whether you ever tried using the credentials contained in the .smbcredentials file without escaping the “space” character.

1 Like

If I do not have a Username/Password for my mount … what should I do? Do I just leave the entries blank?
/mnt/Movies -fstype=cifs,rw,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0 ://192.168.1.101/Movies/

replace username=<>,password=<> with guest

Like: … -fstype=cifs,rw,guest,iocharset=utf8…

1 Like

Hey guys,

Hope everyone is doing alright.

If it’s alright, would someone be able to lend a hand with regards to autofs, please?

I believe I followed the steps correctly but might not have. (not really the best at all this stuff ahah)

After about a week of trying & being unsuccessful with NFS & SMB, by some luck last night I managed to mount one of my network shares (TV-Shows) using SMB however, was unable to mount any of the other shares……

Would someone mind looking over if I’m doing everything correctly, please? (Would prefer to try and use NFS if possible)

  • Installing the package: “sudo apt-get install autofs”
  • Editing the edit auto.master file: “sudo nano /etc/auto.master”
  • Adding: “/- /etc/auto.nfs.shares --timeout 15 browse”
  • Saving change: “CTLo & CTLx”
  • The mapping file: “sudo nano /etc/auto.nfs.shares” (Will only try to mount the share to rule out any sub folder issues)
    • /mnt/192.168.1.9/Movies 192.168.1.9:/Movies
    • /mnt/192.168.1.9/TV-Shows 192.168.1.9:/TV-Shows
  • Save and exit
  • “sudo systemctl restart autofs”

Running ls -lah /mnt/192.168.1.9/Share returns:
osmc@osmc:~$ ls -lah /mnt/192.168.1.9/Movies
ls: cannot open directory ‘/mnt/192.168.1.9/Movies’: No such file or directory
osmc@osmc:~$ ls -lah /mnt/192.168.1.9/TV-Shows
ls: cannot open directory ‘/mnt/192.168.1.9/TV-Shows’: No such file or directory

Using: “sudo rmdir /mnt/”* returned:
osmc@osmc:~$ sudo rmdir /mnt/*
rmdir: failed to remove ‘/mnt/192.168.1.9’: Directory not empty

Quite lost so any assistance would be greatly appreciated! :blush:
PS: my apologies in advance for any slow replies I do

Let’s start with the output of showmount -e 192.168.1.9/

Hi fiznken,
thanks for the super fast reply!

osmc@osmc:~$ showmount -e 192.168.1.9
Export list for 192.168.1.9:
/volume2/TV-Shows 192.168.1.100
/volume2/Music    192.168.1.100
/volume2/Movies   192.168.1.100
osmc@osmc:~$

They are the only network shares that I have enabled NFS on. If that helps.
Oh forgot to say; am running a Synology DS1621+ if that’s helpful at all

I assume 192.168.1.100 is the IP of your Vero? Can you confirm with ip addr?

ah yes thats correct :slight_smile: Static IP

Ah just saw it now, your exports are called /volume2/Movies
So your config should be

/mnt/192.168.1.9/Movies 192.168.1.9:/volume2/Movies
/mnt/192.168.1.9/TV-Shows 192.168.1.9:/volume2/TV-Shows

Ohh i see, ahah that would make sense.
Updating everything and running ls -lah /mnt/192.168.1.9/volume2/Movies:
osmc@osmc:~$ ls -lah /mnt/192.168.1.9/volume2/Movies
ls: cannot access ‘/mnt/192.168.1.9/volume2/Movies’: No such file or directory

Same for TV-Shows. Running showmount -e 192.168.1.9 returns:
osmc@osmc:~$ showmount -e 192.168.1.9
Export list for 192.168.1.9:
/volume2/TV-Shows 192.168.1.100
/volume2/Music 192.168.1.100
/volume2/Movies 192.168.1.100

Apologies for no responses, I do have to head out now. :confused: