I have been reading up on systemd and automount.automount to attempt to start replacing my use of autofs on the Fedora 19 laptops in my home network.
I am a bit confused about the use of /etc/systemd/system/foo.mount use before putting the automount.automount in fstab.
https://wiki.archlinux.org/index.php/Systemd#Automount
Quote:
If you have a large /home partition, it might be better to allow services that do not depend on /home to start while /home is checked by fsck. This can be achieved by adding the following options to the /etc/fstab entry of your /home partition:
noauto,x-systemd.automount
This will fsck and mount /home when it is first accessed, and the kernel will buffer all file access to /home until it is ready.
Note: This will make your /home filesystem type autofs, which is ignored by mlocate by default. The speedup of automounting /home may not be more than a second or two, depending on your system, so this trick may not be worth it.
The same applies to remote filesystem mounts. If you want them to be mounted only upon access, you will need to use the noauto,x-systemd.automountparameters. In addition, you can use the x-systemd.device-timeout=# option to specify a timeout in case the network resource is not available.
If you have encrypted filesystems with keyfiles, you can also add the noauto parameter to the corresponding entries in /etc/crypttab. systemd will then not open the encrypted device on boot, but instead wait until it is actually accessed and then automatically open it with the specified keyfile before mounting it. This might save a few seconds on boot if you are using an encrypted RAID device for example, because systemd does not have to wait for the device to become available. For example:
/etc/crypttab
data /dev/md0 /root/key noauto
|
so if i follow this correctly first i need to create a file in /etc/systemd/system/exports.mount and it should have something along the following:
Code:
[Unit]
Description = NFS media share
[Mount]
What = LABEL=exports
Where = /home/user/NFS
Type = nfsv4
[Install]
WantedBy = user.target
do i need that at all or can i just use the
x-systemd.device-timeout=#
and
noauto,x-systemd.automount
in fstab:
Code:
server_name:/exports /home/user/NFS nfs noauto,x-systemd.automount,x-system.device-timeout=5,soft,rsize=16384,wsize=16384 0 0
or something like that.