You are not logged in.

#1 2018-01-06 17:50:48

linefader
Member
Registered: 2018-01-06
Posts: 14

problems with mounting my NAS via /etc/fstab

Hello, I have 3 NAS in my network which I can mount as follows:

1) mount //ip1/Public /mnt/mybook -o username=admin,rw -t cifs -o vers=1.0
2) mount //ip2/Public /mnt/qnap -o username=admin,rw -t cifs
3) mount //ip3/public /mnt/synology -o username=admin,rw -t cifs -o vers=1.0

Since, I'ld like to mount the drives automatically at boot time, I put (according to the ArchWiki) the following into my /etc/fstab

//ip1/Public /mnt/mybook cifs username=admin,password=password,defaults,nofail,x-systemd.device-timeout=1 0 2

//ip2/public /mnt/synology cifs username=admin,password=password,defaults,nofail,x-systemd.device-timeout=1 0 2

//ip3/Public /mnt/qnap cifs username=admin,password=password,defaults,nofail,x-systemd.device-timeout=1 0 2

unfortunately, this does not work (for any of the drives). Does anybody see what I am doing wrong?

Offline

#2 2018-01-06 17:59:38

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: problems with mounting my NAS via /etc/fstab

The issue is probably that the network isn't up yet when fstab tries to mount the shares. You could try using a systemd service instead...
https://wiki.archlinux.org/index.php/Sa … stemd_unit


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2018-01-06 18:05:37

seth
Member
Registered: 2012-09-03
Posts: 59,609

Re: problems with mounting my NAS via /etc/fstab

The wiki also says
https://wiki.archlinux.org/index.php/Fs … al_devices

requires=network-online.target

Alternatively

x-systemd.automount

(will be mounted when you attempt to access it, might fit you even better)

Offline

#4 2018-01-07 12:44:50

linefader
Member
Registered: 2018-01-06
Posts: 14

Re: problems with mounting my NAS via /etc/fstab

seth wrote:

The wiki also says
https://wiki.archlinux.org/index.php/Fs … al_devices

requires=network-online.target

since I added this, I get the error

couldn't chdir to /mnt/<nas-name>

whenever I try to read from any of the devices (or when I try to re-mount it manually).
Do you see, what is still wrong from the error message or should I post my fstab?
thanks and regards.

Offline

#5 2018-01-07 14:18:26

seth
Member
Registered: 2012-09-03
Posts: 59,609

Re: problems with mounting my NAS via /etc/fstab

systemctl list-unit-files --state=enabled
systemctl list-units | grep network-online

Offline

#6 2018-01-07 17:57:17

linefader
Member
Registered: 2018-01-06
Posts: 14

Re: problems with mounting my NAS via /etc/fstab

the output for

systemctl list-unit-files --state=enabled

is

UNIT FILE        STATE  
autovt@.service  enabled
dhcpcd.service   enabled
getty@.service   enabled
remote-fs.target enabled

4 unit files listed.

and the output for

systemctl list-units | grep network-online

is

  network-online.target                                                                          loaded active active    Network is Online

Last edited by linefader (2018-01-07 18:57:44)

Offline

#7 2018-01-07 18:00:35

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: problems with mounting my NAS via /etc/fstab

(Please use code tags for terminal output. See the link called "BBCode" below the text entry area for information on BBCode tags. Thanks. Good luck and I hope your problem is resolved soon.)


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#8 2018-01-07 20:24:05

seth
Member
Registered: 2012-09-03
Posts: 59,609

Re: problems with mounting my NAS via /etc/fstab

Yes, please paste the updated fstab, the output of mount and the output of a manual attempt to explicitly mount that path (ie. invoking the fstab config - I'll tell you the command from your actual fstab if you're not sure how this is done)

Offline

#9 2018-01-07 22:09:44

linefader
Member
Registered: 2018-01-06
Posts: 14

Re: problems with mounting my NAS via /etc/fstab

here's my fstab:

# /dev/sda3 UUID=b15764d7-a119-4a0f-a31c-8522881112cb
LABEL=p_arch            /               ext4            rw,relatime,data=ordered
        0 1

# /dev/sda1 UUID=8160-07C9
LABEL=EFIBOOT           /boot           vfat            rw,relatime,fmask=0022,d
mask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2

# /dev/sda2 UUID=56f9ab9a-526d-46c0-b705-3b05b24aeb96
LABEL=p_swap            none            swap            defaults        0 0

//192.168.178.26/Public /mnt/mybook cifs username=admin,password=<password>,x-systemd.automount,defaults,nofail,x-systemd.device-timeout=1 0 2

//192.168.178.28/public /mnt/synology cifs username=admin,password=<password>,x-systemd.automount,defaults,nofail,x-systemd.device-timeout=1 0 2

//192.168.178.116/Public /mnt/qnap cifs username=admin,password=<password>,x-systemd.automount,defaults,nofail,x-systemd.device-timeout=1 0 2

the output of mount is

proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=4017164k,nr_inodes=1004291,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
/dev/sda3 on / type ext4 (rw,relatime,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=24,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=548)
systemd-1 on /mnt/qnap type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=551)
systemd-1 on /mnt/mybook type autofs (rw,relatime,fd=35,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=574)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
systemd-1 on /mnt/synology type autofs (rw,relatime,fd=43,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=12538)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
/dev/sda1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=804760k,mode=700,uid=1000,gid=100)

and when I try to manually mount the synology by typing

mount //192.168.178.28/public /mnt/synology -o username=admin,rw -t cifs -o vers=1.0

the output is

Couldn't chdir to /mnt/synology: No such device

when I try to mount the WD mybook by typing

mount //192.168.178.26/Public /mnt/mybook -o username=admin,rw -t cifs -o vers=1.0

the output is

Couldn't chdir to /mnt/mybook: No such device

The qnap is now successfully mounted, it's only the WD mybook and the Synology which I cannot access from Arch

Offline

#10 2018-01-07 23:01:18

seth
Member
Registered: 2012-09-03
Posts: 59,609

Re: problems with mounting my NAS via /etc/fstab

Ah, so you went for the automount, not the wait-online.target?

ls -l /mnt

Edit: actually include persmissions

Last edited by seth (2018-01-07 23:01:53)

Offline

#11 2018-01-08 20:30:52

linefader
Member
Registered: 2018-01-06
Posts: 14

Re: problems with mounting my NAS via /etc/fstab

[me@arch ~]$ ls -l /mnt/
total 3
drwxr-xr-x 2 root root    0 Jan  8 21:23 mybook
drwxr-xr-x 2 root root    0 Jan  8 21:23 qnap
drwxr-xr-x 2 root root    0 Jan  8 21:23 synology

I can hear the synology's engine starting when I type 'ls' but the output still is 'No such device'

Offline

#12 2018-01-08 21:19:15

seth
Member
Registered: 2012-09-03
Posts: 59,609

Re: problems with mounting my NAS via /etc/fstab

Just to be sure: w/o the parameter it works??

Offline

#13 2018-01-09 09:32:01

linefader
Member
Registered: 2018-01-06
Posts: 14

Re: problems with mounting my NAS via /etc/fstab

without what parameter? The '-l'? no - no matter how I try to access the drives ('cd', 'ls', 'ls -l', ..), only the qnap gets mounted automatically.
Yesterday, I made an interesting observation:
I was logged in via ssh from another computer, when I was typing 'ls -l /mnt/' and the arch machine was still showing the login prompt. After I typed 'l -ls /mnt/' - and the drives should have been mounted automatically - the display of the arch machine was showing some error messages:
error.jpg
So, I have error numbers now: -22, -2, -112 - Do these numbers tell you, why the mount does not work?

Offline

#14 2018-01-09 09:43:12

seth
Member
Registered: 2012-09-03
Posts: 59,609

Re: problems with mounting my NAS via /etc/fstab

W/o "x-systemd.automount" (and mounting explicitly) - your initial post sounded as if this was a timing issue; mount would fail on boot, but succeed later one.
Now I'm not sure whether mounting those NAS' did ever work.

Offline

#15 2018-01-09 10:01:06

linefader
Member
Registered: 2018-01-06
Posts: 14

Re: problems with mounting my NAS via /etc/fstab

yes, I could mount all three drives by typing

mount //192.168.178.26/Public /mnt/mybook -o username=admin,rw -t cifs -o vers=1.0
mount //192.168.178.116/Public /mnt/qnap -o username=admin,rw -t cifs
mount //192.168.178.28/public /mnt/synology -o username=admin,rw -t cifs -o vers=1.0

every time after logging in.

Since I added

//192.168.178.26/Public /mnt/mybook cifs username=admin,password=<password>,x-systemd.automount,defaults,nofail,x-systemd.device-timeout=1 0 2
//192.168.178.28/public /mnt/synology cifs username=admin,password=<password>,x-systemd.automount,defaults,nofail,x-systemd.device-timeout=1 0 2
//192.168.178.116/Public /mnt/qnap cifs username=admin,password=<password>,x-systemd.automount,defaults,nofail,x-systemd.device-timeout=1 0 2

to my /etc/fstab, the qnap gets mounted automatically (once, it is accessed for the first time) but when I try to access the synology or the WD mybook (e.g. by typing 'ls -l /mnt/mybook') I get the error message:

couldn't chdir to /mnt/mybook 

The same error is printed, when I try to mount the WD mybook (or the synology) manually again (as it was working before) by typing

mount //192.168.178.26/Public /mnt/mybook -o username=admin,rw -t cifs -o vers=1.0

after booting with the new /etc/fstab

Any more ideas? I'll also try the wait-online.target option now and tell you what happens.

Last edited by linefader (2018-01-09 10:06:15)

Offline

#16 2018-01-10 13:04:18

seth
Member
Registered: 2012-09-03
Posts: 59,609

Re: problems with mounting my NAS via /etc/fstab

There seems an impressive pattern about the "vers" parameter here?
In part because I doubt you can specify "-o" several times.

Offline

#17 2018-01-10 17:28:40

linefader
Member
Registered: 2018-01-06
Posts: 14

Re: problems with mounting my NAS via /etc/fstab

wait-online.target has the same result as requires=network-online.target for me:
nothing is mounted

I am now mounting the qnap via fstab and mount the other drives manually via the shown mount commands.

the vers parameter is necessary. W/o that parameter the synology says

mount error(112): Host is down

and the WD mybook says

mount error(22): Invalid argument

mount obviously allows using -o twice (since the other parameters - username etc. - are also not ignored).

Offline

#18 2018-01-10 19:13:50

seth
Member
Registered: 2012-09-03
Posts: 59,609

Re: problems with mounting my NAS via /etc/fstab

the vers parameter is necessary

Thats's waht I assumed, yes.

//192.168.178.26/Public /mnt/mybook cifs username=admin,password=<password>,x-systemd.automount,defaults,nofail,x-systemd.device-timeout=1 0 2
//192.168.178.28/public /mnt/synology cifs username=admin,password=<password>,x-systemd.automount,defaults,nofail,x-systemd.device-timeout=1 0 2
//192.168.178.116/Public /mnt/qnap cifs username=admin,password=<password>,x-systemd.automount,defaults,nofail,x-systemd.device-timeout=1 0 2

Offline

Board footer

Powered by FluxBB