Hi all!
I'm trying to set up autofs on my C7 netbook so I can automount a cifs share (actually two) from my NAS box, and because when I'm not at home I don't want it attempting to mount it.
so I've read several howtos on it, including the one on the CentOS Wiki. but what I've got isn't working right, and I don't know why.
I'm trying to follow the "even-better method", but am finding I don't understand the syntax of entries, so I'm flailing around trying different things.
so, here's what I have now:
in /etc/auto.master:
/mnt/syno-fredex /etc/auto.syno-fredex
I added /etc/auto.syno-fredex:
/mnt/syno-fredex -fstype=cifs,rw,credentials=/root/.smbcred,defaults,uid=fredex,gid=fredex,noauto,users,exec,vers=3.0 ://nasbox/home
my goal is to mount //nasbox/home as /mnt/syno-fredex
so I do systemctl restart autofs
and it appears to restart (no messages appear).
when I then do "ls /mnt/syno-fredex" it doesn't appear to actually get mounted, and /var/log/messages doesn't show anything.
I'd appreciate advice on this matter.
thanks in advance!
Fred
On 6/8/2017 11:03 AM, Fred Smith wrote:
I'm trying to set up autofs on my C7 netbook so I can automount a cifs share (actually two) from my NAS box, and because when I'm not at home I don't want it attempting to mount it.
Automounting is now done through systemd. You just have to create two "unit files" to describe the mount. One holds the information for a static mount in fstab and the other is the automount entry that launches the first when its mount point is accessed.
http://blog.tomecek.net/post/automount-with-systemd/
So you'd need two files, mnt-syno\x2dfredex.mount and mnt-syno\x2dfredex.automount, both in /etc/systemd/system. You'll need an Options= clause in the .mount file for your CIFS mount options.
Note that the .mount file is not enabled, so it doesn't mount at boot time. Enable the .automount file to start at boot and it will start the .mount file on access.
--- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
On Thu, Jun 08, 2017 at 04:02:05PM -0700, Kenneth Porter wrote:
Kenneth:
thanks for the heads-up. I was stuck on looking for autofs tutorials, having forgotten (if I ever knew) that systemd had subsumed that feature.
thanks again!
Fred
On 6/8/2017 11:03 AM, Fred Smith wrote:
I'm trying to set up autofs on my C7 netbook so I can automount a cifs share (actually two) from my NAS box, and because when I'm not at home I don't want it attempting to mount it.
Automounting is now done through systemd. You just have to create two "unit files" to describe the mount. One holds the information for a static mount in fstab and the other is the automount entry that launches the first when its mount point is accessed.
http://blog.tomecek.net/post/automount-with-systemd/
So you'd need two files, mnt-syno\x2dfredex.mount and mnt-syno\x2dfredex.automount, both in /etc/systemd/system. You'll need an Options= clause in the .mount file for your CIFS mount options.
Note that the .mount file is not enabled, so it doesn't mount at boot time. Enable the .automount file to start at boot and it will start the .mount file on access.
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
On Thu, 8 Jun 2017, Kenneth Porter wrote:
Automounting is now done through systemd.
Can be done through systemd, not has to be done via systemd. It'd be news to me that there's anything stopping you using autofs.
I see no way to replicate most of the functionality of autofs with this.
jh
On Fri, June 9, 2017 2:56 am, John Hodrien wrote:
On Thu, 8 Jun 2017, Kenneth Porter wrote:
Automounting is now done through systemd.
Can be done through systemd, not has to be done via systemd. It'd be news to me that there's anything stopping you using autofs.
Indeed. At least on one CentOS 7 box I set up mounting NFS via autofs (automounter) exactly the same way I was setting them up on CentOS 6, 5,... Didn't even think it might have to be done differently before reading this thread ;-)
Valeri
I see no way to replicate most of the functionality of autofs with this.
jh
++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++
On Thu, Jun 08, 2017 at 04:02:05PM -0700, Kenneth Porter wrote:
Automounting is now done through systemd.
In my use, we continue to use autofs for automounts of CIFS volumes, because as best I can tell, systemd doesn't support using the request-key infrastructure to use a user's kerberos ticket to set up the automount.
On Fri, Jun 09, 2017 at 08:25:31AM -0400, Jonathan Billings wrote:
On Thu, Jun 08, 2017 at 04:02:05PM -0700, Kenneth Porter wrote:
Automounting is now done through systemd.
In my use, we continue to use autofs for automounts of CIFS volumes, because as best I can tell, systemd doesn't support using the request-key infrastructure to use a user's kerberos ticket to set up the automount.
Glad to know it still works.
Could any of you look back at my first post and give me a hint what I'm doing wrong? (I can repost if necessary.)
thanks!
On Fri, Jun 9, 2017 at 6:18 AM, Fred Smith fredex@fcshome.stoneham.ma.us wrote:
On Fri, Jun 09, 2017 at 08:25:31AM -0400, Jonathan Billings wrote:
On Thu, Jun 08, 2017 at 04:02:05PM -0700, Kenneth Porter wrote:
Automounting is now done through systemd.
In my use, we continue to use autofs for automounts of CIFS volumes, because as best I can tell, systemd doesn't support using the request-key infrastructure to use a user's kerberos ticket to set up the automount.
Glad to know it still works.
Could any of you look back at my first post and give me a hint what I'm doing wrong? (I can repost if necessary.)
Your current setup does not agree with the instructions. May I suggest you follow the example in the wiki exactly as it is written? If you confirm that works, you can replace the name etc to fit your situation.
Akemi
On Fri, Jun 09, 2017 at 08:45:26AM -0700, Akemi Yagi wrote:
On Fri, Jun 9, 2017 at 6:18 AM, Fred Smith fredex@fcshome.stoneham.ma.us wrote:
On Fri, Jun 09, 2017 at 08:25:31AM -0400, Jonathan Billings wrote:
On Thu, Jun 08, 2017 at 04:02:05PM -0700, Kenneth Porter wrote:
Automounting is now done through systemd.
In my use, we continue to use autofs for automounts of CIFS volumes, because as best I can tell, systemd doesn't support using the request-key infrastructure to use a user's kerberos ticket to set up the automount.
Glad to know it still works.
Could any of you look back at my first post and give me a hint what I'm doing wrong? (I can repost if necessary.)
Your current setup does not agree with the instructions. May I suggest you follow the example in the wiki exactly as it is written? If you confirm that works, you can replace the name etc to fit your situation.
Akemi
Akemi:
thanks for the reply!
I was struggling with the instructions because some things are not defined, and left to the reader to figure out. Not blaming you, all the other instructions I saw have the same issue. but if, for example, there was a clear statement of how/where the name of the local mount point was defined I might have gotten it right, but as it is I had to guess.
But I'll go do what you suggest and see what happens.
thanks again!
On Fri, Jun 09, 2017 at 01:58:25PM -0400, Fred Smith wrote:
On Fri, Jun 09, 2017 at 08:45:26AM -0700, Akemi Yagi wrote:
On Fri, Jun 9, 2017 at 6:18 AM, Fred Smith fredex@fcshome.stoneham.ma.us wrote:
On Fri, Jun 09, 2017 at 08:25:31AM -0400, Jonathan Billings wrote:
On Thu, Jun 08, 2017 at 04:02:05PM -0700, Kenneth Porter wrote:
Automounting is now done through systemd.
In my use, we continue to use autofs for automounts of CIFS volumes, because as best I can tell, systemd doesn't support using the request-key infrastructure to use a user's kerberos ticket to set up the automount.
Glad to know it still works.
Could any of you look back at my first post and give me a hint what I'm doing wrong? (I can repost if necessary.)
Your current setup does not agree with the instructions. May I suggest you follow the example in the wiki exactly as it is written? If you confirm that works, you can replace the name etc to fit your situation.
Akemi
Akemi:
thanks for the reply!
I was struggling with the instructions because some things are not defined, and left to the reader to figure out. Not blaming you, all the other instructions I saw have the same issue. but if, for example, there was a clear statement of how/where the name of the local mount point was defined I might have gotten it right, but as it is I had to guess.
But I'll go do what you suggest and see what happens.
thanks again!
OK, I've got it working, and Akemi's suggestion helped me figure it out.
This is in /etc/auto.master:
/mnt /etc/auto.mnt
and this is in /etc/auto.mnt:
# # mounts public and home shares on the NasBox. # . syno-public -fstype=cifs,rw,credentials=/root/.smbcred,defaults,uid=fredex,gid=fredex,noauto,users,exec,vers=3.0 ://nasbox/public
syno-fredex -fstype=cifs,rw,credentials=/root/.smbcred,defaults,uid=fredex,gid=fredex,noauto,users,exec,vers=3.0 ://nasbox/home
trying to access /mnt/syno-fredex, then, mounts my home directory on the Nasbox there, and access of /mnt/syno-public mounts the public share from the Nasbox there.
It all makes sense now.
thanks Akemi!
PS, would it be worth documenting the systemd automount feature in the same wiki article?
On Fri, Jun 9, 2017 at 12:54 PM, Fred Smith fredex@fcshome.stoneham.ma.us wrote:
On Fri, Jun 09, 2017 at 01:58:25PM -0400, Fred Smith wrote:
Your current setup does not agree with the instructions. May I suggest you follow the example in the wiki exactly as it is written? If you confirm that works, you can replace the name etc to fit your situation.
Akemi
Akemi:
thanks for the reply!
I was struggling with the instructions because some things are not defined, and left to the reader to figure out. Not blaming you, all the other instructions I saw have the same issue. but if, for example, there was a clear statement of how/where the name of the local mount point was defined I might have gotten it right, but as it is I had to guess.
But I'll go do what you suggest and see what happens.
thanks again!
OK, I've got it working, and Akemi's suggestion helped me figure it out.
This is in /etc/auto.master:
/mnt /etc/auto.mnt
and this is in /etc/auto.mnt:
# # mounts public and home shares on the NasBox. #
. syno-public -fstype=cifs,rw,credentials=/root/.smbcred,defaults,uid=fredex,gid=fredex,noauto,users,exec,vers=3.0 ://nasbox/public
syno-fredex -fstype=cifs,rw,credentials=/root/.smbcred,defaults,uid=fredex,gid=fredex,noauto,users,exec,vers=3.0 ://nasbox/home
trying to access /mnt/syno-fredex, then, mounts my home directory on the Nasbox there, and access of /mnt/syno-public mounts the public share from the Nasbox there.
It all makes sense now.
thanks Akemi!
PS, would it be worth documenting the systemd automount feature in the same wiki article?
Glad to hear you've got it working.
Sure, your contribution to the wiki article is much appreciated. :)
Akemi