I have added a share in fstab to access a network drive with all my files on... fstab looks like:
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
//192.168.1.73/disk1 /media/disk1 cifs username=pi,password=raspberry,_netdev,uid=1000,gid=1000,iocharset=utf8, 0 0
# a swapfile is not a swap partition, so no using swapon|off from here on, use dphys-swapfile swap[on|off] for that
When I run sudo mount -a
the network drive mounts successfully and I can do cd /media/disk1
then ls
which correctly gives me a list of all the folders on said network drive.
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 on other forums, 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.