Trying to mount AUTOFS NFS... need help

I am following:

Installed the autofs package sucessfully.

Then output of “master” (added on the end /- /etc/auto.nfs.shares --timeout 15 browse):
sudo nano /etc/auto.master

#
#/net -hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
+dir:/etc/auto.master.d
#
# 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
/- /etc/auto.nfs.shares --timeout 15 browse

Then the output of shares:
sudo nano /etc/auto.nfs.shares

/mnt/192.168.1.5/USB/USB1_d2/Nuotraukos 192.168.1.5:/Nuotraukos

Now myproblem is
If I go to

**osmc@osmc** : **~** $ ls -lah /mnt/192.168.1.5/USB/USB1_d2

total 8.0K

dr-xr-xr-x 3 root root 4.0K Feb 17 14:26 **.**

dr-xr-xr-x 3 root root 4.0K Feb 17 13:34 **..**

drwxr-xr-x 2 root root 0 Feb 17 14:26 **Nuotraukos**


But if I go
**osmc@osmc** : **~** $ ls -lah /mnt/192.168.1.5/USB/USB1_d2/Nuotraukos

ls: cannot open directory '/mnt/192.168.1.5/USB/USB1_d2/Nuotraukos': No such file or directory


**osmc@osmc** : **~** $ sudo systemctl stop autofs

**osmc@osmc** : **~** $ sudo automount -f -v -d

Starting automounter version 5.1.2, master map /etc/auto.master

using kernel protocol version 5.02

lookup_nss_read_master: reading master file /etc/auto.master

do_init: parse(sun): init gathered global options: (null)

lookup_read_master: lookup(file): read entry +dir:/etc/auto.master.d

lookup_nss_read_master: reading master dir /etc/auto.master.d

lookup(dir): dir map /etc/auto.master.d missing or not readable

lookup(file): failed to read included master map dir:/etc/auto.master.d

lookup_read_master: lookup(file): read entry +auto.master

lookup_nss_read_master: reading master files auto.master

do_init: parse(sun): init gathered global options: (null)

lookup(file): failed to read included master map auto.master

lookup_read_master: lookup(file): read entry /-

master_do_mount: mounting /-

automount_path_to_fifo: fifo name /var/run/autofs.fifo--

lookup_nss_read_map: reading map file /etc/auto.nfs.shares

do_init: parse(sun): init gathered global options: (null)

mounted direct on /mnt/192.168.1.5/USB/USB1_d2/Nuotraukos with timeout 15, freq 4 seconds

do_mount_autofs_direct: mounted trigger /mnt/192.168.1.5/USB/USB1_d2/Nuotraukos

st_ready: st_ready(): state = 0 path /-

st_expire: state 1 path /-

expire_proc: exp_proc = 4103074896 path /-

expire_cleanup: got thid 4103074896 path /- stat 0

expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1

st_ready: st_ready(): state = 2 path /-

st_expire: state 1 path /-

expire_proc: exp_proc = 4103074896 path /-

expire_cleanup: got thid 4103074896 path /- stat 0

expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1

st_ready: st_ready(): state = 2 path /-

st_expire: state 1 path /-

expire_proc: exp_proc = 4103074896 path /-

expire_cleanup: got thid 4103074896 path /- stat 0

expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1

st_ready: st_ready(): state = 2 path /-

st_expire: state 1 path /-

expire_proc: exp_proc = 4103074896 path /-

expire_cleanup: got thid 4103074896 path /- stat 0

expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1

st_ready: st_ready(): state = 2 path /-

st_expire: state 1 path /-

What do you get when you run

showmount -e 192.168.1.5

(I edited your post for you to make it easier to read)

Thanks Bmillham

There is

osmc@osmc:~$ showmount -e 192.168.1.5
Export list for 192.168.1.5:
/mnt/USB/USB1_c2 *
/mnt/USB/USB1_d2 *

Your share is /mnt/USB/USB1_d2

so your auto.nfs.shares should look like

/mnt/192.168.1.5/USB/USB1_d2 192.168.1.5:/mnt/USB/USB1_d2

Using the server as distinction was just my own view so you also could do
/mnt/USB/USB1_d2 192.168.1.5:/mnt/USB/USB1_d2
which would make the path identical.

Thanks Fzinken

Followed your advice and it works now :slight_smile:

sudo nano /etc/auto.nfs.shares
and write there:

/mnt/192.168.1.5/USB/USB1_d2/Nuotraukos 192.168.1.5:/mnt/USB/USB1_d2/Nuotraukos

Then restarted autofs

and now I see files in my share “Nuotraukos”
osmc@osmc : ~ $ ls -lah /mnt/192.168.1.5/USB/USB1_d2/Nuotraukos

total 6.5M

-rwxrwxrwx 1 500 osmc 6.1K Feb 17 13:59 .DS_Store

-rwxrwxrwx 1 500 osmc 3.5M Aug 28 21:30 20190821_114214.jpg

-rwxrwxrwx 1 500 osmc 3.1M Aug 28 21:32 20190824_170358.jpg

osmc@osmc : ~ $

Now I AM HAPPY :slight_smile:

As mentioned, if you want to have identical path just leave out the IP to distinguish the server.