trying to setup automounting for nfs shares. cannot find autofs.service after installing storage-utils package. is this by design or a bug? there is also no documentation for this scenerio. can anyone share steps to get autofs working. thanks.
currently have systemd auto/mount units setup, but not satisfactory. it automounts fine if the server is already online. but if server is offline to begin with, the mount stays empty even after the server comes online.
I would look into whether this service is being started with systemctl using the sub commands
list-units [PATTERN…] List units currently in memory
This what I just ran on my system. The clear-linux distribution may handles the autofs.services task a different way? I did not see that service listed, but I know that auto mounting takes place when a
a usb drive is plugged in. You will see a mount appear under /run/media//
WHAT WHERE MOUNTED IDLE TIMEOUT UNIT
binfmt_misc /proc/sys/fs/binfmt_misc no 0 proc-sys-fs-binfmt_misc.automount
1 automounts listed.
Pass --all to see loaded but inactive automounts, too
You’re right nfs is for mounting remote Unix/Linux servers. I used that years ago with Cent-OS and Red-Hat. I have no occasion to use that service now, so I have not chased down how to make that work in Clear Linux, but I know it must be supported. I believe a feature like mounting remote Linux servers is baked into the Linux Kernal, Check distribution like Ubuntu and see how they support
that feature. Seem like Clear Linux has borrowed some of how system administration is handled from
Ubuntu. i.e. things like systemctl tool.
thankyou for looking. i came across that post before. the issue is not the same, as i have no problem manually moutning the share, and no problem automounting the share as long as the server is up before the client.
Bing the way I remember setting up nfs being mounted on client when I had multiple linux machines, was that I had lines in the fstab that referenced the server name on the left and on the right mount point on the client and the file options defined. The nfs server had to be up and running. The client
mount points would be empty until the nfs server was running. What you’re describing is bad behavior
and needs to be remedied somehow, either it’s a bug or there is some kind of acceptable work around
available to make it work.
What you could do, once you have an nfs mount point fully mounted type:
mount | grep -i and see what you could add to your manually maintained. /etc/fstab on your client machine(s). See if once the client reboots you get the behavior back you expect about nfs mount points.
I am thinking there should be a way to get this to work for people who want to set up a small lab
in a college with a cluster of linux workstations using a common nfs server, running Clear Linux.
@rfkspada what you describe is how I remembered administrating nfs, but better.
Thanks for this input, hopefully. @bing will be able to make use of your how-to.
I know I am keeping your post for future reference.
Thankyou for the detailed instructions. i have indeed used similar steps setting up nfs share for both server and client, but forgoing with fstab instead created mount and automount units directly for the share. I use slightly different options, and everything works except:
my server is a desktop that is online sometimes, the client is a laptop. as taken from my first post, the client cannot automount the share if the server comes online after. And i have since discovered, the laptop hangs at shutdown and reboot, if the share that was mounted is not there anymore (server going offline before laptop reboot/shutdown).
thankyou for showing your setup. i have an systemd.automount unit file, which i think is equivalent to x-systemd.automount option in fstab.
i understand the thread has shifted focus from my original title (as there really is no autofs.service and none of the devs care to explain). trying to figure out function fom systemd.mount/automount that mirror autofs functions. part of the hurdle is to figure out the options in the mounts that allow the laptop to reboot or shutdown cleanly if the share is not present - some kind of auto detect when server goes offline and auto unmount. otherwise the laptop hangs.