Difference between revisions of "Fstab - Use SystemD automount"
Views
Actions
Namespaces
Variants
Tools
(Marked this version for translation) |
m |
||
Line 34: | Line 34: | ||
<!--T:12--> | <!--T:12--> | ||
noauto,x-systemd.automount,x-systemd.device-timeout=10 | {{File|file=/etc/fstab|content=<pre>noauto,x-systemd.automount,x-systemd.device-timeout=10</pre>}} | ||
<!--T:13--> | <!--T:13--> | ||
Line 40: | Line 41: | ||
<!--T:14--> | <!--T:14--> | ||
192.168.1.15:/media-2 | {{File|file=/etc/fstab|content=<pre>192.168.1.15:/media-2 /mnt/NAS-media-2 nfs noauto,x-systemd.automount,x-systemd.device-timeout=10,timeo=14,hard,intr,noatime 0 0</pre>}} | ||
<!--T:15--> | <!--T:15--> | ||
Line 55: | Line 57: | ||
<!--T:19--> | <!--T:19--> | ||
UUID=<id.number> /home noauto,x-systemd.automount,ext4 defaults 0 1 | {{File|file=/etc/fstab|content=<pre>UUID=<id.number> /home noauto,x-systemd.automount,ext4 defaults 0 1</pre>}} | ||
<!--T:20--> | <!--T:20--> |
Latest revision as of 14:34, 22 September 2021
I found a combination of systemd options (on the ArchWiki [1]) that can be used in the /etc/fstab when mounting storage devices --be they internal, external, or network shares.
The magic (to me) that these mount options bring is that if a network share or an external drive that is being called via /etc/fstab is not present, they save your machine from hanging for a minute or two during the boot process.
A device called this way via /etc/fstab is mounted the first time data is attempted to be accessed from it. Only on this first mount is there any (minor) noticeable delay, when compared to having the device mounted the "old" way.A problem that this causes is that if I forget to comment out the NFS share(s) that I'm using from the /etc/fstab file, I have to wait for a minute or two during the boot process whilst the system repetitively tries to make a connection.
I attempted to get AutoFS [2]to work for me. I got close but I just wasn't allowed to see the files on the NFS NAS share.
So then I found the following extremely simple & effective solution. (Wish I had of done this one first, as it would have saved me a couple of hours of a loosing battle!)noauto,x-systemd.automount,x-systemd.device-timeout=10
After I added the above to the following line in my fstab:
192.168.1.15:/media-2 /mnt/NAS-media-2 nfs noauto,x-systemd.automount,x-systemd.device-timeout=10,timeo=14,hard,intr,noatime 0 0
I could boot Manjaro whilst the ReadyNAS' Cat-6 network cable was unplugged, & there was NO noticeable delay. After the system was booted, I plugged the cable in & then called the NFS share /media-2 in Worker & it read the drive & listed the contents.
UUID=<id.number> /home noauto,x-systemd.automount,ext4 defaults 0 1