How can I safely mount my home NFS shares while traveling?

0
0
Asked By MellowCedar42 On

I'm migrating my remaining laptop to Debian with KDE. At home, I have a Synology NAS with two folders that I currently access from Windows using mapped drives, while my Linux desktop mounts them through NFS in /etc/fstab. I'd like to use the same NFS setup on the laptop, but I'm concerned about what happens when I'm away from home and the NAS is unreachable. Will Debian still boot if the NFS mounts fail, or will it wait indefinitely or eventually time out? I plan to connect back home with a WireGuard VPN and would prefer to mount the shares manually only when needed. Is adding options such as nofail or systemd automount appropriate? I also want to keep using NFS rather than install SMB/Samba, and the NAS will only be reachable through the VPN.

3 Answers

Answered By PixelHarbor7 On

Add the `nofail` option to each NFS entry in `/etc/fstab`. That tells systemd not to treat an unavailable NAS as a boot failure, so the laptop should continue starting even when you’re traveling or the NAS is offline. Without it, boot may pause while the mount operation times out. You can then run `sudo mount /path/to/mountpoint` after bringing up the VPN.

MellowCedar42 -

That sounds like the behavior I want. I’ll use WireGuard to reach home and mount the shares manually only when I actually need them.

Answered By AmberKite19 On

You can also add `x-systemd.automount` to the fstab options. This creates an automount point and delays contacting the NAS until something actually accesses the directory, which can make boot and travel more convenient. `nofail` is still useful as a safeguard if the share remains unavailable.

Answered By NorthwindPanda6 On

Using NFS through a WireGuard tunnel is reasonable: the VPN provides encryption for the traffic, while NFS remains available only across the private tunnel. Don’t expose NFS directly to the internet. If you prefer manual control, bringing up the VPN first and then running the mount command is perfectly fine; a systemd or NetworkManager hook could automate that later if desired.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.