Sample Header Ad - 728x90

NFS Share on Centos 7 Fails to automount

3 votes
2 answers
2215 views
I have a fresh install of Centos 7. I cannot seem to auto mount an NFS share located on 192.168.254.105:/srv/nfsshare from the Centos client. Mounting the share manually however, works perfectly. **/etc/auto.master** has been commented out completely to simplify the problem, save for the following line: /- /etc/auto.nfsshare **/etc/auto.nfsshare** holds the following line: /tests/nfsshare -fstype=nfs,credentials=/etc/credentials.txt 192.168.254.105:/srv/nfsshare **/etc/credentials.txt** holds: user=user password=password The expected behavior is that when I ls -l /tests/nfsshare, I will see a few files that my fileserver's **/srv/nfsshare** directory holds. It does not. Instead, it shows nothing. The logs from **sudo journalctl --unit=autofs.service** shows this when it starts (debug enabled): Nov 20 00:25:38 localhost.localdomain systemd: Starting Automounts filesystems on demand... Nov 20 00:25:38 localhost.localdomain automount: Starting automounter version 5.0.7-48.el7, master map auto.master Nov 20 00:25:38 localhost.localdomain automount: using kernel protocol version 5.02 Nov 20 00:25:38 localhost.localdomain automount: lookup_nss_read_master: reading master files auto.master Nov 20 00:25:38 localhost.localdomain automount: parse_init: parse(sun): init gathered global options: (null) Nov 20 00:25:38 localhost.localdomain automount: spawn_mount: mtab link detected, passing -n to mount Nov 20 00:25:38 localhost.localdomain automount: spawn_umount: mtab link detected, passing -n to mount Nov 20 00:25:38 localhost.localdomain automount: lookup_read_master: lookup(file): read entry /- Nov 20 00:25:38 localhost.localdomain automount: master_do_mount: mounting /- Nov 20 00:25:38 localhost.localdomain automount: automount_path_to_fifo: fifo name /run/autofs.fifo-- Nov 20 00:25:38 localhost.localdomain automount: lookup_nss_read_map: reading map file /etc/auto.nfsshare Nov 20 00:25:38 localhost.localdomain automount: parse_init: parse(sun): init gathered global options: (null) Nov 20 00:25:38 localhost.localdomain automount: spawn_mount: mtab link detected, passing -n to mount Nov 20 00:25:38 localhost.localdomain automount: spawn_umount: mtab link detected, passing -n to mount Nov 20 00:25:38 localhost.localdomain automount: mounted direct on /tests/nfsshare with timeout 300, freq 75 seconds Nov 20 00:25:38 localhost.localdomain automount: do_mount_autofs_direct: mounted trigger /tests/nfsshare Nov 20 00:25:38 localhost.localdomain automount: st_ready: st_ready(): state = 0 path /- Nov 20 00:25:38 localhost.localdomain systemd: Started Automounts filesystems on demand. The following appears in my logs when I attempt to force mounting of the nfs share via **ls -l /tests/nfsshare**: Nov 20 00:48:05 localhost.localdomain automount: handle_packet: type = 5 Nov 20 00:48:05 localhost.localdomain automount: handle_packet_missing_direct: token 21, name /tests/nfsshare, request pid 22057 Nov 20 00:48:05 localhost.localdomain automount: attempting to mount entry /tests/nfsshare Nov 20 00:48:05 localhost.localdomain automount: lookup_mount: lookup(file): looking up /tests/nfsshare Nov 20 00:48:05 localhost.localdomain automount: lookup_mount: lookup(file): /tests/nfsshare -> -fstype=nfs,credentials=/etc/credenti...fsshare Nov 20 00:48:05 localhost.localdomain automount: parse_mount: parse(sun): expanded entry: -fstype=nfs,credentials=/etc/credentials.tx...fsshare Nov 20 00:48:05 localhost.localdomain automount: parse_mount: parse(sun): gathered options: fstype=nfs,credentials=/etc/credentials.txt Nov 20 00:48:05 localhost.localdomain automount: [90B blob data] Nov 20 00:48:05 localhost.localdomain automount: dev_ioctl_send_fail: token = 21 Nov 20 00:48:05 localhost.localdomain automount: failed to mount /tests/nfsshare Nov 20 00:48:05 localhost.localdomain automount: handle_packet: type = 5 Nov 20 00:48:05 localhost.localdomain automount: handle_packet_missing_direct: token 22, name /tests/nfsshare, request pid 22057 Nov 20 00:48:05 localhost.localdomain automount: dev_ioctl_send_fail: token = 22 Additionally, **ls -l /tests/nfsshare** actually produces the error: ls: cannot access nfsshare/: No such file or directory How can I fix this issue? As stated before, manual mounting the share works fine. -------------------- EDIT: as requested, output of ls -la /etc/auto.nfsshare -rw-r--r--. 1 root root 99 Nov 20 00:25 /etc/auto.nfsshare
Asked by steelmonkey (53 rep)
Nov 19, 2015, 08:49 PM
Last activity: May 7, 2025, 02:10 AM