Need help automounting NAS storage?

Installed Truenas on my old computer. Enabled Unix (nfs) shares for linux and Windows (smb) shares for Windows 10.
If I run the following command,
sudo mount -t nfs 192.168.0.250:/mnt/network_1/NetworkData/secretdata network
I CAN access the storage on the NAS.

I cannot however get NAS storage to automount.
I have tried to edit fstab with
//192.168.0.250:/mnt/network_1/NetworkData/secretdata /home/aurora/network cifs username=NASusername,password=NASpassword,iocharset=utf8,sec=ntlm 0 0

but sudo mount -a gives the following error,
mount error: could not resolve address for 192.168.0.250:: Unknown error
and mount -a gives mount.cifs: permission denied

I have also tried
//192.168.0.250:/mnt/network_1/NetworkData/secretdata /home/aurora/network nfs username=user1,password=match,users 0 0

and both mount -a and sudo mount -a gives error, mount.nfs: Failed to resolve server //192.168.0.250: Name or service not known

system info:

System:    Kernel: 5.14.10-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0 Desktop: KDE Plasma 5.22.5 tk: Qt 5.15.2
           wm: kwin_x11 vt: 1 dm: SDDM Distro: Manjaro Linux base: Arch Linux
Machine:   Type: Laptop System: ASUSTeK product: ROG Strix G713QM_G713QM v: 1.0 serial: <filter>
           Mobo: ASUSTeK model: G713QM v: 1.0 serial: <filter> UEFI: American Megatrends LLC. v: G713QM.311 date: 06/27/2021
Battery:   ID-1: BAT0 charge: 56.6 Wh (62.1%) condition: 91.2/90.0 Wh (101.3%) volts: 15.8 min: 15.9 model: AS3GWAF3KC GA50358
           type: Li-ion serial: <filter> status: Unknown
           Device-1: hidpp_battery_0 model: Logitech Wireless Mouse MX Master 2S serial: <filter>
           charge: 100% (should be ignored) rechargeable: yes status: Discharging
Memory:    RAM: total: 15.06 GiB used: 2.43 GiB (16.1%)
           RAM Report: permissions: Unable to run dmidecode. Root privileges required.
CPU:       Info: 8-Core model: AMD Ryzen 7 5800H with Radeon Graphics bits: 64 type: MT MCP arch: Zen 3 rev: 0 cache:
           L2: 4 MiB bogomips: 102243
           Speed: 1197 MHz min/max: 1200/4462 MHz boost: enabled Core speeds (MHz): 1: 1197 2: 1198 3: 1197 4: 1197 5: 1197
           6: 1197 7: 1197 8: 1197 9: 1197 10: 1198 11: 1397 12: 1397 13: 1198 14: 1198 15: 1197 16: 1197
           Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1 bmi2 bpext cat_l3 cdp_l3 clflush
           clflushopt clwb clzero cmov cmp_legacy constant_tsc cpb cpuid cqm cqm_llc cqm_mbm_local cqm_mbm_total cqm_occup_llc
           cr8_legacy cx16 cx8 de decodeassists erms extapic extd_apicid f16c flushbyasid fma fpu fsgsbase fsrm fxsr fxsr_opt
           ht hw_pstate ibpb ibrs ibs invpcid irperf lahf_lm lbrv lm mba mca mce misalignsse mmx mmxext monitor movbe msr mtrr
           mwaitx nonstop_tsc nopl npt nrip_save nx ospke osvw overflow_recov pae pat pausefilter pclmulqdq pdpe1gb
           perfctr_core perfctr_llc perfctr_nb pfthreshold pge pku pni popcnt pse pse36 rapl rdpid rdpru rdrand rdseed rdt_a
           rdtscp rep_good sep sha_ni skinit smap smca smep ssbd sse sse2 sse4_1 sse4_2 sse4a ssse3 stibp succor svm svm_lock
           syscall tce topoext tsc tsc_scale umip v_spec_ctrl v_vmsave_vmload vaes vgif vmcb_clean vme vmmcall vpclmulqdq
           wbnoinvd wdt xgetbv1 xsave xsavec xsaveerptr xsaveopt xsaves
Graphics:  Device-1: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q] vendor: ASUSTeK driver: nvidia v: 470.63.01
           bus-ID: 01:00.0 chip-ID: 10de:2520 class-ID: 0300
           Device-2: Advanced Micro Devices [AMD/ATI] Cezanne vendor: ASUSTeK driver: amdgpu v: kernel bus-ID: 05:00.0
           chip-ID: 1002:1638 class-ID: 0300
           Display: x11 server: X.Org 1.20.13 compositor: kwin_x11 driver: loaded: modesetting,nvidia
           resolution: 1920x1200~60Hz s-dpi: 96
           OpenGL: renderer: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2 v: 4.6.0 NVIDIA 470.63.01 direct render: Yes
Audio:     Device-1: Advanced Micro Devices [AMD/ATI] vendor: ASUSTeK driver: snd_hda_intel v: kernel bus-ID: 05:00.1
           chip-ID: 1002:1637 class-ID: 0403
           Device-2: Advanced Micro Devices [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor vendor: ASUSTeK driver: N/A
           bus-ID: 05:00.5 chip-ID: 1022:15e2 class-ID: 0480
           Device-3: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel
           bus-ID: 05:00.6 chip-ID: 1022:15e3 class-ID: 0403
           Device-4: JMTek LLC. USB PnP Audio Device type: USB driver: hid-generic,snd-usb-audio,usbhid bus-ID: 3-2.3:6
           chip-ID: 0c76:1620 class-ID: 0300
           Sound Server-1: ALSA v: k5.14.10-1-MANJARO running: yes
           Sound Server-2: JACK v: 1.9.19 running: no
           Sound Server-3: PulseAudio v: 15.0 running: yes
           Sound Server-4: PipeWire v: 0.3.38 running: yes
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASUSTeK driver: r8169 v: kernel port: e000
           bus-ID: 02:00.0 chip-ID: 10ec:8168 class-ID: 0200
           IF: enp2s0 state: up speed: 100 Mbps duplex: full mac: <filter>
           IP v4: <filter> type: dynamic noprefixroute scope: global broadcast: <filter>
           IP v6: <filter> type: noprefixroute scope: link
           Device-2: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel bus-ID: 03:00.0 chip-ID: 8086:2723 class-ID: 0280
           IF: wlp3s0 state: down mac: <filter>
           IF-ID-1: virbr0 state: down mac: <filter>
           IP v4: <filter> scope: global broadcast: <filter>
           WAN IP: <filter>

Bluetooth: Device-1: Intel AX200 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 3-4:5 chip-ID: 8087:0029 class-ID: e001
           Report: rfkill ID: hci0 rfk-id: 1 state: down bt-service: enabled,running rfk-block: hardware: no software: yes
           address: see --recommends
Logical:   Message: No logical block device data found.
RAID:      Message: No RAID data found.
Drives:    Local Storage: total: 5.89 TiB used: 1.99 TiB (33.7%)
           ID-1: /dev/nvme0n1 vendor: SK Hynix model: HFM512GD3JX013N size: 476.94 GiB speed: 31.6 Gb/s lanes: 4 type: SSD
           serial: <filter> rev: 41000C20 temp: 46.9 C scheme: GPT
           ID-2: /dev/sda type: USB vendor: Western Digital model: WD My Passport 2627 size: 3.64 TiB type: N/A
           serial: <filter> rev: 4008 scheme: GPT
           ID-3: /dev/sdb type: USB vendor: Western Digital model: WDS480G2G0A-00JH30 size: 447.14 GiB type: SSD
           serial: <filter> scheme: GPT
           ID-4: /dev/sdc type: USB vendor: Western Digital model: WDS480G2G0A-00JH30 size: 447.13 GiB type: SSD
           serial: <filter> scheme: GPT
           ID-5: /dev/sdd type: USB vendor: Lenovo model: USB Hard Drive size: 931.51 GiB type: N/A serial: <filter> rev: 3U
           scheme: GPT
           Message: No optical or floppy data found.
Partition: ID-1: / size: 422.37 GiB used: 64.76 GiB (15.3%) fs: ext4 dev: /dev/sdc2 label: N/A
           uuid: 581c79c3-b5ca-4ee2-9d67-c226c64d502f
           ID-2: /boot/efi size: 299.4 MiB used: 288 KiB (0.1%) fs: vfat dev: /dev/sdc1 label: NO_LABEL uuid: 75B0-09E2
           ID-3: /home/<filter>/network size: 1.76 TiB used: 0 KiB (0.0%) fs: nfs
           remote: 192.168.0.233:/mnt/network_1/NetworkData/secretdata
           ID-4: /media/aurora/fastlinuxmedia size: 255.55 GiB used: 116.87 GiB (45.7%) fs: ext4 dev: /dev/sdb2
           label: linuxdata uuid: 3d658ccb-7e50-40f4-82dc-e0c74b3a2143
           ID-5: /media/aurora/fastmedia size: 187 GiB used: 171.8 GiB (91.9%) fs: ntfs dev: /dev/sdb1 label: fastDATA_1
           uuid: 42D6C57FD6C57427
           ID-6: /media/aurora/media size: 2.66 TiB used: 1.54 TiB (57.9%) fs: ntfs dev: /dev/sda1 label: Data4TB
           uuid: 3CBAA0BDBAA07554
           ID-7: /media/aurora/slowlinuxmedia size: 983.23 GiB used: 100.69 GiB (10.2%) fs: ext4 dev: /dev/sda2
           label: slowDatalinux uuid: a7749fa2-dbf5-4cdd-bfa3-6c32a947f6f3
Swap:      ID-1: swap-1 type: partition size: 16.64 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/sdc3 label: N/A
           uuid: ae036e38-c2e4-4d71-ac66-4cfc9e1b4d52
Unmounted: ID-1: /dev/nvme0n1p1 size: 260 MiB fs: vfat label: SYSTEM uuid: C839-BD33
           ID-2: /dev/nvme0n1p2 size: 16 MiB fs: <superuser required> label: N/A uuid: N/A
           ID-3: /dev/nvme0n1p3 size: 456.24 GiB fs: ntfs label: OS uuid: 48103B67103B5B60
           ID-4: /dev/nvme0n1p4 size: 750 MiB fs: ntfs label: RECOVERY uuid: FCE20CA0E20C616E
           ID-5: /dev/nvme0n1p5 size: 19.5 GiB fs: ntfs label: RESTORE uuid: C8D2C855D2C84A00
           ID-6: /dev/nvme0n1p6 size: 200 MiB fs: vfat label: MYASUS uuid: F0C8-80F8
           ID-7: /dev/sdd1 size: 931.51 GiB fs: ext4 label: N/A uuid: f8be4f07-2be3-446f-be1d-0ba2be4b50f8
USB:       Hub-1: 1-0:1 info: Full speed (or root) Hub ports: 4 rev: 2.0 speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
           Device-1: 1-3:2 info: ASUSTek N-KEY Device type: Keyboard driver: asus,usbhid interfaces: 1 rev: 2.0 speed: 12 Mb/s
           power: 100mA chip-ID: 0b05:1866 class-ID: 0301
           Hub-2: 2-0:1 info: Full speed (or root) Hub ports: 2 rev: 3.1 speed: 10 Gb/s chip-ID: 1d6b:0003 class-ID: 0900
           Device-1: 2-1:2 info: Western Digital My Passport 2627 type: Mass Storage driver: usb-storage interfaces: 1
           rev: 3.1 speed: 5 Gb/s power: 896mA chip-ID: 1058:2627 class-ID: 0806 serial: <filter>
           Hub-3: 3-0:1 info: Full speed (or root) Hub ports: 4 rev: 2.0 speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
           Hub-4: 3-1:2 info: Genesys Logic Hub ports: 4 rev: 2.1 speed: 480 Mb/s power: 100mA chip-ID: 05e3:0610
           class-ID: 0900
           Hub-5: 3-1.2:4 info: Terminus Hub ports: 4 rev: 2.0 speed: 480 Mb/s power: 100mA chip-ID: 1a40:0101 class-ID: 0900
           Device-1: 3-1.2.1:7 info: Logitech Unifying Receiver type: Keyboard,Mouse,HID driver: logitech-djreceiver,usbhid
           interfaces: 3 rev: 2.0 speed: 12 Mb/s power: 98mA chip-ID: 046d:c52b class-ID: 0300
           Device-2: 3-1.2.2:9 info: Microsoft Wired Keyboard 600 (model 1576) type: Keyboard,HID driver: hid-generic,usbhid
           interfaces: 2 rev: 2.0 speed: 1.5 Mb/s power: 100mA chip-ID: 045e:07f8 class-ID: 0300
           Device-3: 3-1.2.3:10 info: Microsoft Xbox360 Controller type: <vendor specific> driver: xpad interfaces: 4 rev: 2.0
           speed: 12 Mb/s power: 500mA chip-ID: 045e:028e class-ID: ff00 serial: <filter>
           Hub-6: 3-2:3 info: VIA Labs VL813 Hub ports: 4 rev: 2.1 speed: 480 Mb/s chip-ID: 2109:2813 class-ID: 0900
           Device-1: 3-2.3:6 info: JMTek LLC. USB PnP Audio Device type: Audio,HID driver: hid-generic,snd-usb-audio,usbhid
           interfaces: 4 rev: 1.1 speed: 12 Mb/s power: 100mA chip-ID: 0c76:1620 class-ID: 0300
           Device-2: 3-2.4:8 info: HP LaserJet M1005 MFP type: Printer driver: usblp interfaces: 2 rev: 2.0 speed: 480 Mb/s
           power: 98mA chip-ID: 03f0:3b17 class-ID: 0701 serial: <filter>
           Device-3: 3-4:5 info: Intel AX200 Bluetooth type: Bluetooth driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s
           power: 100mA chip-ID: 8087:0029 class-ID: e001
           Hub-7: 4-0:1 info: Full speed (or root) Hub ports: 2 rev: 3.1 speed: 10 Gb/s chip-ID: 1d6b:0003 class-ID: 0900
           Hub-8: 4-1:3 info: Genesys Logic Hub ports: 4 rev: 3.1 speed: 5 Gb/s chip-ID: 05e3:0612 class-ID: 0900
           Device-1: 4-1.1:4 info: Lenovo Portable HDD type: Mass Storage driver: usb-storage interfaces: 1 rev: 3.0
           speed: 5 Gb/s power: 8mA chip-ID: 17ef:455a class-ID: 0806 serial: <filter>
           Device-2: 4-1.3:5 info: ASMedia ASM1051E SATA 6Gb/s bridge ASM1053E SATA 6Gb/s bridge ASM1153 SATA 3Gb/s bridge
           ASM1153E SATA 6Gb/s bridge
           type: Mass Storage driver: uas interfaces: 1 rev: 3.0 speed: 5 Gb/s chip-ID: 174c:55aa class-ID: 0806
           serial: <filter>
           Device-3: 4-1.4:6 info: ASMedia ASM1051E SATA 6Gb/s bridge ASM1053E SATA 6Gb/s bridge ASM1153 SATA 3Gb/s bridge
           ASM1153E SATA 6Gb/s bridge
           type: Mass Storage driver: uas interfaces: 1 rev: 3.0 speed: 5 Gb/s chip-ID: 174c:55aa class-ID: 0806
           serial: <filter>
           Hub-9: 4-2:2 info: VIA Labs VL813 Hub ports: 4 rev: 3.0 speed: 5 Gb/s chip-ID: 2109:0813 class-ID: 0900
Sensors:   System Temperatures: cpu: 59.0 C mobo: N/A
           Fan Speeds (RPM): cpu: 0
           GPU: device: nvidia screen: :0.0 temp: 57 C device: amdgpu temp: 61.0 C
Info:      Processes: 403 Uptime: 1h 4m wakeups: 7 Init: systemd v: 249 Compilers: gcc: 11.1.0 alt: 10 clang: 12.0.1
           Packages: 1769 pacman: 1764 flatpak: 5 Shell: Zsh v: 5.8 running-in: konsole inxi: 3.3.08

I access my nas smb://192.168.0.250 then it’s not mounted but rather popup under network in Dolphin. That’s how I access my nas. Works for me, not sure if right or wrong.

That is because smb mounts uses windows unc

Using fstab with your current define - you will get problems - because the mount takes place before network is up.

1 Like

I can access my NAS. I just can’t get it to mount during boot.

When I run sudo systemctl enable --now home-aurora-network.automount
the directory /home/aurora/network becomes invisible in dolphin

cd network gives this error

cd: no such device: network

Becoming super user su and running ls gives this error

ls: cannot access 'network': No such device

I connected to the NAS with browser and was able to access it.

After hitting F5 on dolphin a couple of times, the directory network/ is visible again. I can access it but there are no files on it.

/etc/systemd/system/home-aurora-network.automount

[Unit]
Description=Automount NAS storage
ConditionPathExists=/home/aurora/network
[Automount]
Where=/home/aurora/network
TimeoutIdleSec=10

[Install]
WantedBy=multi-user.target

Permissions: -rw-r--r-- 1 root root 177 Nov 4 17:27 home-aurora-network.automount

/etc/systemd/system/home-aurora-netowrk.mount

[Unit]
Description=NAS Storage

[Mount]
What=//192.168.0.250/mnt/network_1/NetworkData/secretdata
Where=/home/aurora/network
Type=cifs
Options=_netdev,iocharset=utf8,rw,file_mode=0777,dir_mode=0777,credentials=/etc/smb.cred,vers=4
TimeoutSec=30

[Install]
WantedBy=multi-user.target

Permissions: -rw-r--r-- 1 root root 283 Nov 4 17:26 home-aurora-network.mount

/etc/smb/cred

user=NASusername
password=NASpassword
workgroup=NASgroupOfUsername

permissions: -rw------- 1 root root 43 Nov 4 17:21 smb.cred

I checked journalctl and didn’t find any errors.

Edit 1:

The fstab entry that @AJA provided in this post also has the same result as the automount and mount entries in the original post

192.168.1.98:/mnt/RAID/Torrent /home/john/NAS/Torrent/ nfs _netdev,noauto,x-systemd.automount,x-systemd.mount-timeout=10,timeo=14,x-systemd.idle-timeout=1min 0 0

I looked at another post somewhat related to NAS on manjaro, and the person in the post said to check mapall setting in the NAS configuration itself. I couldn’t find it. If that is the problem, then let me know.

Edit 2:

As a temp workaround,
I am running a systemd unit that runs a script. The script sleeps for 10 secs and then runs
sudo mount -t nfs 192.168.0.250:/mnt/network_1/NetworkData/secretdata network

I think I have found the solution.
I tested the connection by transferring a lot of data. And leaving system at idle, and it is working fine.

Firstly, I undid everything I did in previous post.
then I ran the following command
sudo systemctl enable NetworkManager-wait-online.service
sudo systemctl enable systemd-networkd-wait-online.service

People were saying you only need to do any one of the commands listed above; depending on what service the OS is running.

And finally appended this to fstab
192.168.0.250:/mnt/network_1/NetworkData/secretdata /home/aurora/network nfsusers,x-systemd.automount,rw,hard,intr,rsize=8192,wsize=8192,timeo=14 0 0

If you wanna use CIFS for automount, then use this:
//192.168.0.250/networkStorage /home/aurora/network/ cifs users,x-systemd.automount,username=NASuser,password=NASpassword,iocharset=utf8,gid=1000,uid=1000,file_mode=0777,dir_mode=0777 0 0

Super - good work :+1:

Thank you for sharing the result.

That is correct :slight_smile:

I would like to add a couple of notes

  1. The service -wait-online is now enabled when you enable the service it-self. It has been different in the past.
  2. Add the _netdev to your option list - this implies to systemd to wait until network is up (which the mentioned service signals).
1 Like

I had _netdev in the fstab at first. This didn’t work for me. I had to run mount -a everything after boot/reboot.
Then I came across this option x-systemd.automount. After removing _netdev and adding systemd.automount, the NAS drive was auto-mounting and I no longer needed to run mount -a.

P.S.
Sorry for the late response. I just saw my notification.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.