I'm trying to automount a sambashare as CIFS, as documented here: https://help.ubuntu.com/community/Autofs#CIFS
This seems so simple, I'm running out of things to google. It's probably something very obvious. Let me speak in commands:
sudo apt-get install autofs
sudo nano /etc/auto.master.d/myserver.autofs
files -fstype=cifs,rw ://server/files
sudo automount -f -v
Starting automounter version 5.0.7, master map /etc/auto.master
using kernel protocol version 5.02
syntax error in map near [ files -fstype=cifs,rw : ]
no mounts in table
I didn't do a whole lot, but I still did something wrong. How do I get this working?
edit @Jos
updated myserver.autofs
:
/media/server/files -fstype=cifs,rw ://server/files
Output from sudo automount -f -v
:
Starting automounter version 5.0.7, master map /etc/auto.master
using kernel protocol version 5.02
:
/
/
/
file map /etc/-fstype=cifs not found
mounted indirect on /media/server/files with timeout 300, freq 75 seconds
statemachine:1363: got unexpected signal 28!
Now we have a directory in /media
! But it's empty.
Try inserting a direct map line in "/etc/auto.master" - something like:
Where "/etc/auto.data" contains the "direct" mount point and your cifs mount info that you previously had in "myserver.autofs" - i.e.:
I am new to autofs and was not able to get an "indirect" mapping working for a cifs mount but the above "direct" mapping method works for me.
I was having a similar problem until I figured out reading a lot of pages. Try this:
Make a sub-directory for automount in
/media
like/media/auto
(I wanted to automount two different servers/files here and/media
is available for other stuffs)Edit
/etc/auto.master
with:(You can give another name to file "auto.cifs-shares" and change timeout to another value if you want to)
Create a file for store your config (as I wrote above I've written in
/etc/auto.cifs-shares
)(if you don't give credentials it will automount as anonymous, it depends on permission)
You have to restart service for having changes taking effect:
That's it! Next try:
(should give you what you want)