Help with AutoFS for NFS mount

I have setup an NFS share so that my Manjaro laptop can easily copy files to an ubuntu plex server…

I noticed that when I boot - I lose the NFS mount - and am attempting to set up autofs to auto-mount that NFS share.

To be honest - reading the arch linux forums - I seem to be a bit over my head on how to do this in autofs…

Here is the mount I am using in CLI - any help on how to set this up in autofs (which I was able to install) - would be greatly appreciated!

>> sudo mount -t nfs 192.168.1.xxx:/mnt/nfs_share nfs_plex/server

You don’t need autofs

two systemd units - one .mount and one .automount - and you are in business

2 Likes

Thanks for this - I’m close but am getting this error:

Failed to start nfs_share.mount: Unit nfs_share.mount has a bad unit file setting.

Here is my mount file:
[Unit]
Description=nfs_share devices
After=network.target

[Mount]
What=192.168.1.119:/mnt/nfs_share
Where=/home/dir/nfs_share
Type=nfs
Options=_netdev,auto

[Install]
WantedBy=multi-user.target

My remote folder is at: mnt/nfs_share (IP=192.168.1.119)
My local folder is in my home directory: /home/dir/nfs_share

Not sure what I’m doing wrong?
(here are errors when looking at status):
   /etc/systemd/system  systemctl status nfs-share.mount  1 ✘
○ nfs-share.mount - nfs_share devices
Loaded: bad-setting (Reason: Unit nfs-share.mount has a bad unit file setting.)
Active: inactive (dead)
Where: /home/dklabunde/nfs_share
What: 192.168.1.119:/mnt/nfs_share

Aug 12 11:26:45 HP-Elitebook systemd[1]: nfs-share.mount: Where= setting doesn’t match unit name. Refusing.
Aug 12 11:26:47 HP-Elitebook systemd[1]: nfs-share.mount: Where= setting doesn’t match unit name. Refusing.
Aug 12 12:00:41 HP-Elitebook systemd[1]: nfs-share.mount: Where= setting doesn’t match unit name. Refusing.
Aug 12 12:04:28 HP-Elitebook systemd[1]: nfs-share.mount: Where= setting doesn’t match unit name. Refusing.
Aug 12 12:06:06 HP-Elitebook systemd[1]: nfs-share.mount: Where= setting doesn’t match unit name. Refusing.

You did not read the links above, did you?

yes I did - but reading them and understanding them are not the same thing for me.

So i will repeat the tutorial…keep it simple, do not put it under Home. Make a new dir under root, for example shares.
Then where will be /shares/nfs and your service name will be shares-nfs.mount

1 Like

Thanks so much - that did it…

This is working great… once the ‘home’ issue was brought to my attention (thanks Teo), I was off and running.

I’ve been able to easily setup multiple shares - and can now ‘manage’ my plex server 100% from my remote computer…

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.