Trying to automount my network drives. Mount -a works fine but putting it in fstab and putting a mount -a in rc.local didn’t do it. It appears that the wired eth0 is the last thing to come ready according to dmesg. Is there a way to make it wait for the network before trying to connect the drives. I have a Pi3 and have the internal wifi blacklisted and connected with a cable. I have the latest OSMC. I have done apt-get update; apt-get dist-upgrade ok.
It will be fixed in the next update. See [How to] Use systemd to mount remote shares - #44 by sam_nazarko.
GS put this in rc.local:
#GS notes: a minimum of sleep 10 is required for the mount below to work on the Pi 3; it failed with sleep 5, but worked with sleep 10, sleep 15, and sleep 30
_IP=$(hostname -I) || true
if [ “$_IP” ]; then
printf “My IP address is %s\n” “$_IP”
mount -a #GS: mount all drives in /etc/fstab
and it works for now.
Can you show your /etc/fstab?
Are you using x-systemd.automount?
//192.168.0.32/Volume_1 /mnt/y cifs credentials=/root/.smbcredentials,rw,user 00
//192.168.0.32/Volume_2 /mnt/x cifs credentials=/root/.smbcredentials,rw,user 0 0
//192.168.0.34/Volume_1 /mnt/w cifs credentials=/root/.smbcredentials,rw,user 0 0
//192.168.0.34/vol_1 /mnt/z cifs credentials=/root/.smbcredentials,rw,user 0 0
No, not using x-systemd.automount. is howto finished for it?
You just need to update your fstab entry, for example:
//192.168.0.32/Volume_1 /mnt/y cifs credentials=/root/.smbcredentials,x-systemd.automount,rw,user 00
no other changes?
That should do it.
Seems that it worked just fine…Thanks
Glad to hear its sorted.