Mounting network shares with autofs (alternative to fstab)

I entered as you adviced: sudo dpkg-reconfigure locales
Actually it was selected just en_US.UTF-8 . I scrolled all the way down and selected OK. On the next page I selected en_US.UTF-8

And here is my output actually not sure is it ok. I will reboot my Vero 4K and check will it mount automatically AUTOFS

Generating locales (this might take a while)…
en_US.UTF-8… done
Generation complete.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “lt_LT.UTF-8”,
LC_MONETARY = “lt_LT.UTF-8”,
LC_ADDRESS = “lt_LT.UTF-8”,
LC_TELEPHONE = “lt_LT.UTF-8”,
LC_NAME = “lt_LT.UTF-8”,
LC_MEASUREMENT = “lt_LT.UTF-8”,
LC_IDENTIFICATION = “lt_LT.UTF-8”,
LC_NUMERIC = “lt_LT.UTF-8”,
LC_PAPER = “lt_LT.UTF-8”,
LANG = “C”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “lt_LT.UTF-8”,
LC_MONETARY = “lt_LT.UTF-8”,
LC_ADDRESS = “lt_LT.UTF-8”,
LC_TELEPHONE = “lt_LT.UTF-8”,
LC_NAME = “lt_LT.UTF-8”,
LC_MEASUREMENT = “lt_LT.UTF-8”,
LC_IDENTIFICATION = “lt_LT.UTF-8”,
LC_NUMERIC = “lt_LT.UTF-8”,
LC_PAPER = “lt_LT.UTF-8”,
LANG = “C”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
osmc@osmc:~$ sudo systemctl enable autofs
Synchronizing state of autofs.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable autofs
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “lt_LT.UTF-8”,
LC_MONETARY = “lt_LT.UTF-8”,
LC_ADDRESS = “lt_LT.UTF-8”,
LC_TELEPHONE = “lt_LT.UTF-8”,
LC_NAME = “lt_LT.UTF-8”,
LC_MEASUREMENT = “lt_LT.UTF-8”,
LC_IDENTIFICATION = “lt_LT.UTF-8”,
LC_NUMERIC = “lt_LT.UTF-8”,
LC_PAPER = “lt_LT.UTF-8”,
LANG = “en_US.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to a fallback locale (“en_US.UTF-8”).
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “lt_LT.UTF-8”,
LC_MONETARY = “lt_LT.UTF-8”,
LC_ADDRESS = “lt_LT.UTF-8”,
LC_TELEPHONE = “lt_LT.UTF-8”,
LC_NAME = “lt_LT.UTF-8”,
LC_MEASUREMENT = “lt_LT.UTF-8”,
LC_IDENTIFICATION = “lt_LT.UTF-8”,
LC_NUMERIC = “lt_LT.UTF-8”,
LC_PAPER = “lt_LT.UTF-8”,
LANG = “en_US.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to a fallback locale (“en_US.UTF-8”).
osmc@osmc:~$

O it helped :slight_smile: Thanks very much!

Now after restart of vero 4k

osmc@osmc:~$ sudo systemctl status autofs
● autofs.service - Automounts filesystems on demand
Loaded: loaded (/lib/systemd/system/autofs.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-05-09 23:10:26 EEST; 1min 41s ago
Process: 392 ExecStart=/usr/sbin/automount $OPTIONS --pid-file /var/run/autofs.pid (code=exited, status=0/SUCCESS)
Main PID: 486 (automount)
CGroup: /system.slice/autofs.service
└─486 /usr/sbin/automount --pid-file /var/run/autofs.pid

May 09 23:10:26 osmc systemd[1]: Starting Automounts filesystems on demand…
May 09 23:10:26 osmc systemd[1]: Started Automounts filesystems on demand.
osmc@osmc:~$

Great! So after reboot, you are now finding your mounts in place and functioning?

Yes after reboot, I am finding my mounts in place and functioning.
Already restarted 3 times :slight_smile: and all 3 times is Ok. Really thanks ActionA:+1:

2 Likes

No problem! Enjoy OSMC!

1 Like

H @fzinken,
I suggest indicating in what syntax to add NFS mount options to the /etc/auto.nfs.shares - I had to Google it elsewhere. I tried to filter out the options that may be downgraded in the negotiation but will not limit the performance from the suggestions of @THEM in thread Consistently interrupted playback - #6 by THEM
My suggestion is:

/mnt/TV-F -fstype=nfs,noatime,nolock,local_lock=all,async,rsize=1048576,wsize=1048576 192.168.0.1:/TV-F

  • The rsize and wsize may be downgraded if server does not allow that big, but we mostly deal with streaming big files anyhow, so the bigger the better
  • Locking does not usually happen, but better just disable remote and local alike
  • async should be default, but let’s just try and force it
  • let’s not update atime at all (otherwise it defaults to relatime for me that I know is almost as efficient, but this is the most performant available)

All this and other choices helped me to get very close to the theoretical bandwith of Gigabit Ethernet in Buffering issues - #34 by petersasi. :slight_smile:

@fzinken is it possible to use credentials for nfs using autofs, the above examples only show using creds in smb

HI,

yes, but the NFS server would need to support it, probably kerberos.

Thanks Tom.

The IP address of one of my servers changed after it rebooted following a firmware update. What are the commands to edit the mapped/mounted share on Vero?

I can see the share I need to edit when I do ls -lah /mnt/ … but how do I edit? Thank you.

just edit the IP in your auto.smb.shares or auto.nfs.shares file depending on which one you use.

@fzinken to the rescue again, thank you sir. Simply typing auto.smb.shares returns a command not found error. Sorry, don’t know the exact commands to enter.

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!