You are not logged in.
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
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
Offline
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
The wiki also says
https://wiki.archlinux.org/index.php/Fs … al_devicesrequires=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
systemctl list-unit-files --state=enabled
systemctl list-units | grep network-online
Offline
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
(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
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
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
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
[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
Just to be sure: w/o the parameter it works??
Offline
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:
So, I have error numbers now: -22, -2, -112 - Do these numbers tell you, why the mount does not work?
Offline
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
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
There seems an impressive pattern about the "vers" parameter here?
In part because I doubt you can specify "-o" several times.
Offline
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
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