Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
/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, 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
exit 0
2. I recall an old openSUSE thread where it was suggested to remount via crontab.
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.*
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
Although I have no experience (or need) with using this.
Ditto:-
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.
If you use NetworkManager you can do this by enabling NetworkManager-wait-online.service:
systemctl enable NetworkManager-wait-online.service
If you use systemd-networkd you can do this by enabling systemd-networkd-wait-online.service:
systemctl enable systemd-networkd-wait-online.service
Sorry gooner47 I'm not good with NAS and the process by which you'd have to set up to make it work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.