NFS mount problem at startup on my new laptop

Hi there,

I've been using Garuda on my desktop computer for around 6 months now and i very much like it.
I have a NFS server at home which i automatically mount at startup on this main computer, using fstab with the _netdev option. It has always worked fine on my main computer, as well as on another Manjaro computer i have at home.

However, when trying to do the same on my new laptop which i freshly installed on Garuda too, it ends up not working with a strange behavior.
I tried with fstab/_netdev, and with a systemd Mount with a dependency to network-online.target and both solutions ended up having the same issue.

In journalctl, i can see that systemd does wait for the network-online target to be reached before attempting the mount, but even after network-online is reached it seems like the network interfaces are not completely up; so the mount fails with a 'network unreachable' error.

Doing sudo mount -a or systemctl restart my-mount.mount after login does work so its likely not a misconfiguration;

Being on a wired or wireless network doesn't make any difference.

I found some ideas for a workaround looking around the internet, but it feels strange to me that the same configuration would work flawlessly on several desktop computers but not on the laptop ?!? Maybe wifi is getting in the way for some reason ?

Could use any ideas there, thanks a lot for reading :wink:

Garuda-inxi

System:
Kernel: 6.4.3-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.1.1
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=93c200b2-f7d6-44e0-b4da-8a779d0679f4 rw rootflags=subvol=@
quiet quiet rd.udev.log_priority=3 vt.global_cursor_default=0
resume=UUID=60c3e298-c385-4adf-8796-820ae4ebfa38 loglevel=3 ibt=off
Desktop: KDE Plasma v: 5.27.6 tk: Qt v: 5.15.10 wm: kwin_x11 dm: SDDM
Distro: Garuda Linux base: Arch Linux
Machine:
Type: Laptop System: LENOVO product: 21D4002TFR v: ThinkPad Z16 Gen 1
serial: <filter> Chassis: type: 10 serial: <filter>
Mobo: LENOVO model: 21D4002TFR serial: <filter> UEFI: LENOVO
v: N3GET57W (1.57 ) date: 05/10/2023
Battery:
ID-1: BAT0 charge: 57.4 Wh (79.5%) condition: 72.2/72.2 Wh (100.0%)
volts: 16.9 min: 15.5 model: Celxpert 5B10W51888 type: Li-poly
serial: <filter> status: not charging cycles: 1
CPU:
Info: model: AMD Ryzen 7 PRO 6850H with Radeon Graphics socket: FP7 bits: 64
type: MT MCP arch: Zen 3+ gen: 4 level: v3 note: check built: 2022
process: TSMC n6 (7nm) family: 0x19 (25) model-id: 0x44 (68) stepping: 1
microcode: 0xA404102
Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB
L3: 16 MiB desc: 1x16 MiB
Speed (MHz): avg: 1800 high: 3200 min/max: 1600/4784 boost: enabled
base/boost: 3200/4750 scaling: driver: acpi-cpufreq governor: schedutil
volts: 1.2 V ext-clock: 100 MHz cores: 1: 3200 2: 1600 3: 1600 4: 1600
5: 3200 6: 1600 7: 1600 8: 1600 9: 1600 10: 1600 11: 1600 12: 1600
13: 1600 14: 1600 15: 1600 16: 1600 bogomips: 102203
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Vulnerabilities: <filter>
Graphics:
Device-1: AMD Rembrandt [Radeon 680M] vendor: Lenovo driver: amdgpu
v: kernel arch: RDNA-2 code: Navi-2x process: TSMC n7 (7nm) built: 2020-22
pcie: gen: 4 speed: 16 GT/s lanes: 16 ports: active: DP-10,eDP-1
empty: DP-1, DP-2, DP-3, DP-4, DP-5, DP-6, DP-7, DP-8, DP-9
bus-ID: e4:00.0 chip-ID: 1002:1681 class-ID: 0300 temp: 37.0 C
Device-2: Luxvisions Innotech Integrated RGB Camera driver: uvcvideo
type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 5-1:2
chip-ID: 30c9:0052 class-ID: fe01 serial: <filter>
Device-3: Logitech Webcam C270 driver: snd-usb-audio,uvcvideo type: USB
rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 7-1.3.2.1:12
chip-ID: 046d:0825 class-ID: 0102 serial: <filter>
Display: server: X.Org v: 21.1.8 with: Xwayland v: 23.1.2
compositor: kwin_x11 driver: X: loaded: amdgpu unloaded: modesetting
alternate: fbdev,vesa dri: radeonsi gpu: amdgpu display-ID: :0 screens: 1
Screen-1: 0 s-res: 4480x1682 s-dpi: 96 s-size: 1183x444mm (46.57x17.48")
s-diag: 1264mm (49.75")
Monitor-1: DP-10 mapped: DisplayPort-9 pos: primary,top-left
model: AOC Q3279WG5B serial: <filter> built: 2017 res: 2560x1440 hz: 60
dpi: 90 gamma: 1.2 size: 725x428mm (28.54x16.85") diag: 842mm (33.1")
ratio: 15:9 modes: max: 2560x1440 min: 720x400
Monitor-2: eDP-1 mapped: eDP pos: bottom-r model: BOE Display 0x0a30
built: 2021 res: 1920x1200 hz: 60 dpi: 141 gamma: 1.2
size: 345x215mm (13.58x8.46") diag: 407mm (16") ratio: 16:10
modes: 1920x1200
API: OpenGL v: 4.6 Mesa 23.1.3 renderer: AMD Radeon Graphics (rembrandt
LLVM 15.0.7 DRM 3.52 6.4.3-zen1-1-zen) direct-render: Yes
Audio:
Device-1: AMD Rembrandt Radeon High Definition Audio vendor: Lenovo
driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
bus-ID: e4:00.1 chip-ID: 1002:1640 class-ID: 0403
Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Lenovo
driver: snd_pci_acp6x v: kernel alternate: snd_pci_acp3x, snd_rn_pci_acp3x,
snd_pci_acp5x, snd_acp_pci, snd_rpl_pci_acp6x, snd_pci_ps,
snd_sof_amd_renoir, snd_sof_amd_rembrandt pcie: gen: 4 speed: 16 GT/s
lanes: 16 bus-ID: e4:00.5 chip-ID: 1022:15e2 class-ID: 0480
Device-3: AMD Family 17h/19h HD Audio vendor: Lenovo driver: snd_hda_intel
v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: e4:00.6
chip-ID: 1022:15e3 class-ID: 0403
Device-4: Logitech Webcam C270 driver: snd-usb-audio,uvcvideo type: USB
rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 7-1.3.2.1:12
chip-ID: 046d:0825 class-ID: 0102 serial: <filter>
Device-5: Realtek USB Audio driver: snd-usb-audio type: USB rev: 2.0
speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 7-1.3.4:6 chip-ID: 0bda:402e
class-ID: 0102 serial: <filter>
API: ALSA v: k6.4.3-zen1-1-zen status: kernel-api tools: N/A
Server-1: PipeWire v: 0.3.74 status: n/a (root, process) with:
1: pipewire-pulse status: active 2: wireplumber status: active
3: pipewire-alsa type: plugin 4: pw-jack type: plugin
tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Qualcomm QCNFA765 Wireless Network Adapter vendor: Lenovo
driver: ath11k_pci v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 1 link-max:
gen: 3 speed: 8 GT/s bus-ID: 01:00.0 chip-ID: 17cb:1103 class-ID: 0280
IF: wlp1s0 state: up mac: <filter>
Device-2: Realtek RTL8153 Gigabit Ethernet Adapter driver: r8152 type: USB
rev: 3.0 speed: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 bus-ID: 8-1.4:5
chip-ID: 0bda:8153 class-ID: 0000 serial: <filter>
IF: enp229s0f3u1u4 state: up speed: 1000 Mbps duplex: full mac: <filter>
Bluetooth:
Device-1: USI driver: btusb v: 0.8 type: USB rev: 1.1 speed: 12 Mb/s
lanes: 1 mode: 1.1 bus-ID: 3-2:2 chip-ID: 10ab:9309 class-ID: e001
Report: bt-adapter ID: hci0 rfk-id: 1 state: up address: <filter>
Drives:
Local Storage: total: 476.94 GiB used: 6.2 GiB (1.3%)
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital model: WD PC
SN810 SDCQNRY-512G-1001 size: 476.94 GiB block-size: physical: 512 B
logical: 512 B speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter>
fw-rev: 61540101 temp: 37.9 C scheme: GPT
SMART: yes health: PASSED on: 37 hrs cycles: 421
read-units: 3,768,499 [1.92 TB] written-units: 1,082,955 [554 GB]
Partition:
ID-1: / raw-size: 460.25 GiB size: 460.25 GiB (100.00%)
used: 6.19 GiB (1.3%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p2
maj-min: 259:2
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 576 KiB (0.2%) fs: vfat block-size: 512 B dev: /dev/nvme0n1p1
maj-min: 259:1
ID-3: /home raw-size: 460.25 GiB size: 460.25 GiB (100.00%)
used: 6.19 GiB (1.3%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p2
maj-min: 259:2
ID-4: /var/log raw-size: 460.25 GiB size: 460.25 GiB (100.00%)
used: 6.19 GiB (1.3%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p2
maj-min: 259:2
ID-5: /var/tmp raw-size: 460.25 GiB size: 460.25 GiB (100.00%)
used: 6.19 GiB (1.3%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p2
maj-min: 259:2
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: partition size: 16.39 GiB used: 0 KiB (0.0%)
priority: -2 dev: /dev/nvme0n1p3 maj-min: 259:3
ID-2: swap-2 type: zram size: 14.9 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 41.0 C mobo: N/A gpu: amdgpu temp: 39.0 C
Fan Speeds (RPM): fan-1: 2659 fan-2: 2428
Info:
Processes: 356 Uptime: 22m wakeups: 5117 Memory: total: 16 GiB note: est.
available: 14.9 GiB used: 3.19 GiB (21.4%) Init: systemd v: 253
default: graphical tool: systemctl Compilers: gcc: 13.1.1 Packages:
pm: pacman pkgs: 1210 libs: 326 tools: octopi,paru Shell: garuda-inxi (sudo)
default: Bash v: 5.1.16 running-in: konsole inxi: 3.3.28
Garuda (2.6.16-1):
System install date:     2023-07-15
Last full system update: 2023-07-15
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut
Windows dual boot:       No/Undetected
Failed units:```

I use "x-systemd.automount" in fstab - it doesn't try to mount the volume until the first access.

as in:
192.168.0.130:/home/center/server /mnt/Server nfs _netdev,noauto,x-systemd.automount

4 Likes

Seems to work, thanks a lot

1 Like

I still have an error message failed to mount /nas at startup, but after that it behaves as intended.

I noticed tho, that whenever i access my /nas mount during any session, then the shutdown sequence hangs for ~30s which is kind of annoying.

If i don't access /nas (then i assume it doesn't get mounted at all with x-systemd.automount), my system shuts down instantly.

Thx

After more attempts, I can say that :

  • x-systemd.automount works properly at startup but causes the shutdown sequence to hang on a black screen for ~2min ;
  • not using it causes the share to not be mounted at startup, but doesn't cause shutdown delay even if manually mounted during the session

I read recently that once you have set the x-systemd.automount option, auto and noauto no longer have any effect–systemd just kind of takes over I guess.

Use of the x-systemd.automount mount option in /etc/fstab | Support | SUSE

When x-systemd.automount is used, systemd will enable an “automount unit”, also known as a automount trap, or a mount point (path) where a file system may later be mounted. The file system itself is a separate unit (a “mount unit”) and will only be mounted if there is a subsequent demand to use that path.

Attempts to alter the above behavior by setting either “auto” or “noauto” will have no effect.

In other words, all of the following combinations of options in /etc/fstab will yield the same result:

x-systemd.automount
auto,x-systemd.automount
noauto,x-systemd.automount

@Azerist, give a try with just the noauto option and leave off the systemd bit, and let us know if it works better/doesn’t work/seems the same.

1 Like

I finally found this workaround idea around the internet :

  • Use a simple noauto fstab definition
  • Use a systemd service to handle the automount :
[Unit]
Description=Service to mouns NFS share on /nas
Requires=network-online.target
After=network-online.target

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/bin/mount /nas
ExecStop=/usr/bin/umount /nas
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

It works fine, thos it feels a bit strange having to do all that just to mount a network share.
I still don't get, for instance, why NetworkManager reports network to be online while it actually isn't.

1 Like

This may sound strange, but I have found in the past that the kernel version can drastically affect how NFS works. Sometimes simply testing different kernels can resolve NFS startup and shutdown issues.

Might be, but I'm pretty sure my desktop and laptop use the same kernel (latest zen) and one is working different than the other

Different hardware can behave differently using the same kernel.

2 Likes