Resolved - Cannot access automounted nas share

Issues related to configuring your network
zuser
Posts: 19
Joined: 2013/12/31 16:34:24

Resolved - Cannot access automounted nas share

Post by zuser » 2013/12/31 16:53:14

New to CentOS and just converted and older desktop to a server running 6.5_x86-64.
I am trying to mount a Buffalo NAS using the "Even-better method" explained in the wiki.
All seem to go ok and autofs restarts with no error messages.

The object is to mount "share" from the nas to /mnt/xl1b4/, which it appears to do as indicated below; however, when I try to access the share, it returns the "No such file" message.

[root@acer ~]# /sbin/service autofs restart
Stopping automount: [ OK ]
Starting automount: [ OK ]
[root@acer ~]# ls -l /mnt/xl1b4
total 0
dr-xr-xr-x. 2 root root 0 Dec 31 10:44 share
[root@acer ~]# ls -l /mnt/xl1b4/share
ls: cannot open directory /mnt/xl1b4/share: No such file or directory
[root@acer ~]#

I did not find any relevant messages in /var/log/messages.

Any suggestions to solve this issue and access the nas share?
Last edited by zuser on 2014/01/02 19:56:59, edited 1 time in total.

User avatar
toracat
Forum Moderator
Posts: 7349
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: Cannot access automounted nas share

Post by toracat » 2013/12/31 22:36:32

It will help if you post relevant lines from your /etc/auto.master and auto.misc (or whatever file you designated) and the actual command to mount the share.
CentOS Forum FAQ

zuser
Posts: 19
Joined: 2013/12/31 16:34:24

Re: Cannot access automounted nas share

Post by zuser » 2014/01/01 12:40:50

toracat wrote:It will help if you post relevant lines from your /etc/auto.master and auto.misc (or whatever file you designated) and the actual command to mount the share.
Thanks for reply. Mounting nas was attempted by restarting autofs as shown above after editing files as indicated below.
For what it's worth, can manually mount and access share with no problems.

Code: Select all

#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
/misc   /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#       "nosuid" and "nodev" options unless the "suid" and "dev"
#       options are explicitly given.
#
/net    -hosts
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
/mnt/xl1b4 /etc/auto.xl1b4 --timeout=600 --ghost

from 'auto.xl1b4'

Code: Select all

share   -fstype=cifs,rw,noperm,credentials=/etc/credentials.txt ://192.168.1.13/share

User avatar
TrevorH
Forum Moderator
Posts: 25057
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot access automounted nas share

Post by TrevorH » 2014/01/01 13:50:53

The directory /mnt/xl1b4 exists? Your /etc/credentials.txt exists and is owned root:root and chmod 600 with contents similar to

Code: Select all

username=myusername
password=mypassword
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

zuser
Posts: 19
Joined: 2013/12/31 16:34:24

Re: Cannot access automounted nas share

Post by zuser » 2014/01/01 18:17:44

Yes both exist and I believe in the right places

Code: Select all

   ls -l /etc/    
produces

Code: Select all

    -rw-r--r--.  1 root root     26 Dec 31 06:56 credentials.txt     
credentials.txt is as you describe

and

Code: Select all

   # ls -l /mnt     
produces

Code: Select all

    drwxr-xr-x. 1 root root    0 Dec 17 09:30 xl1b4   
I see permissions are different for xl1b4 , is that an issue?

User avatar
TrevorH
Forum Moderator
Posts: 25057
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot access automounted nas share

Post by TrevorH » 2014/01/01 19:46:13

Your credentials.txt needs to be chmod 600 not the current 644 as that's open to everyone to read. That may be enough to stop if from working depending what checks automount does.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

zuser
Posts: 19
Joined: 2013/12/31 16:34:24

Re: Cannot access automounted nas share

Post by zuser » 2014/01/01 20:22:47

Permissions changed but no help.

On reboot, "share" shows as mounted on /mnt/xl1b4 but on attempt to access, reported as no such file or directory.

Code: Select all

[root@localhost ~]# cd /mnt/xl1b4
[root@localhost xl1b4]# ls
share
[root@localhost xl1b4]# cd share
-bash: cd: share: No such file or directory
[root@localhost xl1b4]# 
Any other suggestions?

Whoever
Posts: 1058
Joined: 2013/09/06 03:12:10

Re: Cannot access automounted nas share

Post by Whoever » 2014/01/01 20:43:16

On reboot, "share" shows as mounted on /mnt/xl1b4 but on attempt to access, reported as no such file or directory.
You used the "--ghost" option for the automounter map, so the fact that "ls /mnt/xl1b4" returns "share" is no indication that the directory is mounted.

The "df" command will show you mounted filesystems and you can also look in /etc/mtab.

You should look in /var/log/messages just after you try accessing /mnt/xl1b4/share and just after restarting autofs. I think that it is unlikely that no relevent information is being logged -- I see that you did already look there, but perhaps you missed something?

zuser
Posts: 19
Joined: 2013/12/31 16:34:24

Re: Cannot access automounted nas share

Post by zuser » 2014/01/02 13:02:29

Ok, hopefully this will help.
Contents of "/etc/mtab"

Code: Select all

/dev/mapper/vg_acercentos-lv_root / ext4 rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs rw,rootcontext="system_u:object_r:tmpfs_t:s0" 0 0
/dev/sda1 /boot ext4 rw 0 0
/dev/mapper/vg_acercentos-lv_home /home ext4 rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
nfsd /proc/fs/nfsd nfsd rw 0 0
~                                 
Also, I did apparently miss messages in log. Following is log from this AM. "autofs" was restarted at 06:20

Code: Select all

Jan  2 05:27:55 localhost kernel: CIFS VFS: Error connecting to socket. Aborting operation
Jan  2 05:27:55 localhost kernel: CIFS VFS: cifs_mount failed w/return code = -111
Jan  2 05:30:59 localhost kernel: CIFS VFS: Error connecting to socket. Aborting operation
Jan  2 05:30:59 localhost kernel: CIFS VFS: cifs_mount failed w/return code = -111
Jan  2 05:32:37 localhost kernel: CIFS VFS: Error connecting to socket. Aborting operation
Jan  2 05:32:37 localhost kernel: CIFS VFS: cifs_mount failed w/return code = -111
Jan  2 06:03:19 localhost kernel: CIFS VFS: Error connecting to socket. Aborting operation
Jan  2 06:03:19 localhost kernel: CIFS VFS: cifs_mount failed w/return code = -111
Jan  2 06:20:25 localhost automount[6745]: lookup_read_master: lookup(nisplus): couldn't locate nis+ table auto.master
Also, FWIW, confirming share can be mounted manually as follows:

Code: Select all

[root@localhost ~]# mount -t cifs //192.168.1.15/share /mnt/xl1b4 -o user=wlz
Password: 
[root@localhost ~]# ls -l /mnt/xl1b4
total 1613252
-rwxr-xr-x. 0 root root      10701 Jul 26 12:56 2013-07-25 Quest-envelope.odt
drwxr-xr-x. 0 root root          0 Aug  2 07:51 backup
drwxr-xr-x. 0 root root          0 Oct 28  2012 Cards
drwxr-xr-x. 0 root root          0 Dec 29  2008 CBS

User avatar
TrevorH
Forum Moderator
Posts: 25057
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot access automounted nas share

Post by TrevorH » 2014/01/02 13:11:47

That's a different IP address in your mount command (192.168.1.15) vs the .13 you have in auto.xl1b4
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply