Hello friends. I've been tinkering with AutoFS lately on my systems at home. I'm finding it's quite excellent. I have it auto mounting my CIFS/Samba shares from my server (Ubuntu Server 14.04), which just acts as a large data storage point as most of our systems run smaller SSDs (because price + speed). On top of that, it provides surprising speeds given it's basically mounting the shares via terminal instead of gvfs. I suppose it's cutting out some overhead and streamlining things a bit. (I'm talking to the tune of gvfs 13 MB/s average, autofs 22 MB/s average pulling the same ISO from server to laptop over wireless - nice!)
There's one thing in particular I'm curious about. Just know that everything seemingly works, so this is curiosity more than anything. In the example command I was provided that I tailored to match my needs using my own mount point, IP to server, etc etc., there's a wildcard used in the one path. Here are my files:
auto.master:
Code:
#
***** This area was snipped because it is many lines and I changed nothing in the default auto.master except the last two lines below *****
#
+auto.master
/media/jason/NAS /etc/auto.smb.nas.jason --timeout=60 --ghost
/media/jason/web /etc/auto.smb.web.jason --timeout=60 --ghost
auto.smb.nas.jason (auto.smb.web.jason is identical except different IP):
Code:
* -fstype=cifs,rw,credentials=/etc/.smbcredentials,uid=1000,gid=1000,file_mode=0700,dir_mode=0600,forceuid,forcegid ://192.168.1.20/&
Then of course /etc/.smbcredentials just contained username=username, password=password, and domain=workgroup (all on separate lines), owned by root:root with 660 permissions.
What I'm most curious about is the wildcard used in the -fstype line. I see in the man page:
Code:
Wildcard Key
A map key of * denotes a wild-card entry. This entry is consulted if the specified key does not exist in the map. A typical wild-card entry looks like this:
* server:/export/home/&
The special character '&' will be replaced by the provided key. So, in the example above, a lookup for the key 'foo' would yield a mount of server:/export/home/foo.
I'm curious if using a wildcard is safe, or advised? I figured if it's in the man page, I assume it provides some degree of purpose, but what features are available vs what's recommended could be two different things. I'm also having trouble understanding what "specified key" I would need to provide in the event I didn't want to use a wild card in that line.
Secondly, for bonus points I'm curious why /& is needed at the end of the IP address in auto.master. I tried without just to see what would happen but it errored out.
Overall I'm mostly curious about the functional purpose behind * in use with -fstype and /& in use at the end of the IP of auto.master. Thanks for any insight!
Bookmarks