1

I have a samba share entitles "scrolls" set up. Listing the samba share works just fine:

[root@rhel7-client ~]# smbclient -L 192.168.1.2
Enter root's password:


Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.1]

Sharename       Type      Comment
---------       ----      -------
scrolls         Disk      Ancient Scrolls
IPC$            IPC       IPC Service (Samba 4.1.1)
root            Disk      Home Directories
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.1]

Server               Comment
---------            -------

Workgroup            Master

Mounting the samba share also works:

[root@rhel7-client /]# mount.cifs //192.168.1.2/scrolls -o credentials=/etc/creds.txt /mnt

[root@rhel7-client /]# grep scrolls /etc/mtab|tail -n1
//192.168.1.2/scrolls /mnt cifs   rw,relatime,vers=1.0,cache=strict,username=root,domain=RHEL7SERVER,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.2,unix,posixpaths,serverino,acl,rsize=1048576,wsize=65536,actimeo=1 0 0

Mounting the Samba share via Autofs after un-mounting the previous share does not work:

[root@rhel7-client /]# cat /etc/auto.shares
scrolls         -cifs,credentials=/etc/creds.txt                //192.168.1.2/scrolls

[root@rhel7-client scrolls]# grep shares /etc/auto.master
/mnt/shares /etc/auto.shares

[root@rhel7-client /]# grep shares /etc/mtab
/etc/auto.shares /mnt/scrolls autofs rw,relatime,fd=-1,pgrp=2548,timeout=300,minproto=5,maxproto=5,indirect 0 0
/etc/auto.shares /mnt/shares autofs rw,relatime,fd=12,pgrp=2730,timeout=300,minproto=5,maxproto=5,indirect 0 0

[root@rhel7-client /]# cd /mnt/shares/scrolls
-bash: cd: /mnt/shares/scrolls: No such file or directory

Any ideas?

[root@rhel7-client scrolls]# systemctl status autofs
autofs.service - Automounts filesystems on demand
   Loaded: loaded (/usr/lib/systemd/system/autofs.service; enabled)
   Active: active (running) since Wed 2015-01-07 21:30:09 UTC; 6min ago
  Process: 2728 ExecStart=/usr/sbin/automount $OPTIONS --pid-file /run/autofs.pid (code=exited, status=0/SUCCESS)
 Main PID: 2730 (automount)
   CGroup: /system.slice/autofs.service
           └─2730 /usr/sbin/automount --pid-file /run/autofs.pid

Jan 07 21:30:09 rhel7-client systemd[1]: Starting Automounts filesystems on demand...
Jan 07 21:30:09 rhel7-client systemd[1]: Started Automounts filesystems on demand.

2 Answers 2

1

It should be due to this on your automount configuration:

You have to add ://192.168.1.2/scrolls the : is required for smb shares when using autofs

[root@rhel7-client /]# cat /etc/auto.shares

scrolls         -cifs,credentials=/etc/creds.txt              ://192.168.1.2/scrolls
0

In the /etc/auto.master use the option --ghost. I didn't find it in a documentation, but it works on my environment.

/mnt/shares /etc/auto.shares --ghost

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .