Can't get a CIFS network drive to mount on boot
I have added a share in fstab to access a network drive with all my files on... fstab looks like:
Code:
proc /proc proc defaults 0 0 However, after rebooting the pi when I cd to that location and run ls again, nothing is there. I have to manually run sudo mount -a again, which then mounts the drive. I have seen this reported many times, and the consensus seems to be that the mounts in fstab are happening too early - before the network has been established. I've tried to implement the things I understand - but to be honest a lot of it is way over my head. I've added _netdev to the line in fstab, I've added rootdelay=10 into /boot/cmdline.txt, I've installed networkmanager... none of this has helped. And so I turn to you, about ready to throw the pi out the window - followed by myself. Any help, much appreciated. |
The '_netdev' option is not always sufficient for slow networks. In particular, if Network Manager is involved, and systemd there can be problems. So, you might want to tell us the OS and version. Are you using Network Manager? There are solutions for coping with that situation.
There are a number of possible options (depending on answers to the above). Anyway, 2 to start with... 1. You could try adding the 'noauto' option, so that the samba mounting does not occur at boot, but later on. For example, add the mount via /etc/rc.local Code:
mount /media/disk1 |
Hi & Welcome to Linux Questions.
Sorry you have to keep running the mount -a cmd over and over again. I'm sure there is a way to make this permanent but I don't have experience with that. I think you need udev. http://linuxconfig.org/automatically...ve-with-autofs Don't throw your pi out the window and most certainly don't even think of jumping out yourself. -::-Hang in there gooner47 until a member with more experience can chime in to help you.-::- *You might want to include what distribution you are using and post the output of lsusb to see if the device is showing up.* In the meantime look here. https://wiki.archlinux.org/index.php...torage_devices |
@Ztcoracat: The NAS is not a usb device, it's on the network. The network isn't available when the fstab mounting takes place, so it must be delayed.
|
Quote:
How do you delay the process? |
That can depend on the init system and the network manager in use. The crontab approach (mentioned above) does work for some. Others use auofs to do the mounting.
Where systemd is employed, it is possible to use the x-systemd.automount option http://www.freedesktop.org/software/...emd.mount.html https://wiki.archlinux.org/index.php....2Fetc.2Ffstab For those using system and Network Manager, there is the NetworkManager-wait-online.service freedesktop http://www.freedesktop.org/wiki/Soft...NetworkTarget/ https://wiki.archlinux.org/index.php...er_Wait_Online Although I have no experience (or need) with using this. |
Similar thread here
http://raspberrypi.stackexchange.com...as-drive-fails where a script runs 'mount -a' later in the boot process. If necessary, an additional delay can be included using the sleep command eg 'sleep 10' |
Good links ferrari; thanks.
Quote:
If I'm not mistaken systemd has some control over the start and stop services so it may not be a walk in the park to make the delay happen. I'll re-read the links you posted.:) |
It looks like it boils down to this:
Code:
If you use NetworkManager you can do this by enabling NetworkManager-wait-online.service: |
Firstly apologies for the time taken to respond to this thread, I've literally only just had time to sit down and have a play around with this again.
Secondly thanks for all your input and help. In the end, I followed some very clear instructions provided in a response to another post I made elsewhere: http://raspberrypi.stackexchange.com...-mount-on-boot Thanks again for all your help. |
Very good.... that uses the crontab method to re-mount as I suggested in post #2. :)
|
All times are GMT -5. The time now is 02:41 AM. |