i have OSMC installed on a raspberry. I have a CIFS mounted on it, but the problem is the mount needs to be manually mounted each time after a reboot with “sudo mount -a”
My line in /etc/fstab:
\10.2.2.249\MEDIA /mnt/MEDIA cifs rw,file_mode=0777,dir_mode=0777,noperm,credentials=/home/secret.txt,_netdev,x-systemd.automount,iocharset=utf8 0 0
I know there are many similar threads already discussed over the past years. I have tried all the suggestions found, by adding “mount -a” in /etc/rc.local file, also added a similar line in crontab -e, but none of those help.
Is there a way to automount CIFS?
Try this in /etc/fstab:
//10.2.2.249/MEDIA /mnt/MEDIA cifs rw,file_mode=0777,dir_mode=0777,noperm,credentials=/home/secret.txt,noauto,x-systemd.automount,iocharset=utf8 0 0
Add the “noauto” parameter to your list of parameters for the shares…
Restart services afterwards or simply reboot.
guys, it worked.
@dillthedog: i added exactly the line posted by you and now it auto mounts. Thank you very much.
In my previous attempts i remember i tried these parameters (noauto, x-systemd.automount) also without _netdev, but i always used backslash for //10.2.2.249/MEDIA, as in \10.2.2.249\MEDIA. Does the slash instead of backslash in this case, make any difference?
Thanks again guys,
The forward slash is the correct method for Linux systems.
_netdev is redundant when using x-systemd.automount.
[quote=“Radu_Iamandi, post:6, topic:38682”]
but i always used backslash[/quote]
That’s wrong. Didn’t see it in your initial post…
Only Windows uses a backslash instead of a slash. Goes back to the first MS-DOS version which had no support for directories. But since directories where introduced with MSDOS 2.0 you can use both characters for directories because it annoyed the programmers and customers back then as well (official documentation always said use “” even though “/” worked as well).
Even on Windows these days you can use a slash instead of a backslash in a path.Only exception is the “\” at the start of an UNC path. But \\SERVER/Share still works.
That is the problem with the holy cow of backwards compatibility. People still stumble across an unnecessary problem that was created in March 1983…
If you care for a story about this: https://blogs.msdn.microsoft.com/larryosterman/2005/06/24/why-is-the-dos-path-character/