Mount nfs shares help

Hi,

I’m trying to get my nfs shares working with autofs using this tutorial: Mounting network shares with autofs (alternative to fstab) - #109 by grahamh

When I check ls -lah /mnt/disk1/hd3, my files are listed correctly, but when I go to showmount -e 1 <my ip>, all I get is Export list for: and it’s blank.

It seems I’m missing a step - did I need to export the mnt shares after adding them? If I sftp in, I can see them all under ‘mnt’

Thanks

What’s the 1 for?

Typo.

You export from the source device via /etc/exports and systemctl restart nfs-server. Then your shares should show up in showmount -e <IP of source> whether or not autofs is engaged.

Sorry Graham, what command is used to export from etc/exports

Sorry, I just re-read that tutorial and it doesn’t say anything about the server side :roll_eyes: I think the assumption was you would set that up with a NAS webui. You can do this:

On the machine where your shared files are, you sudo apt-get update && sudo apt-get install nfs-server. Then you make /etc/exports on that server, which might look like this:

/media/2Tntfs 192.168.1.0/24(rw,sync,no_root_squash,no_subtree_check)
/mnt/1Text4 192.168.1.0/24(rw,sync,no_root_squash,no_subtree_check,insecure)
/home/osmc 192.168.1.0/24(rw,sync,no_root_squash,no_subtree_check)

Here, I’m sharing a drive that’s automounted, a drive that’s mounted with fstab and my home directory. I’ve forgotten what the insecure does but you can google the options. On the server I get

osmc@veroV:~$ showmount -e localhost
Export list for localhost:
/home/osmc    192.168.1.0/24
/mnt/1Text4   192.168.1.0/24
/media/2Tntfs 192.168.1.0/24

and from another device

osmc@veroV4:~$ showmount -e 192.168.1.1
Export list for 192.168.1.1:
/home/osmc    192.168.1.0/24
/mnt/1Text4   192.168.1.0/24
/media/2Tntfs 192.168.1.0/24

and that device has autofs running to access those shares.

HTH

1 Like

Thanks Graham, Will give it a shot this weekend. Appreciated.