problem with network drive mount on boot

Hi, It’s my first post here and I searched and tried for hours…but I didn’t find a solution.

I have an ASUS Wireless Router which shares a usb drive over network. It runs without any problems and it had run on my old openSUSE too.

I edited my fstab and “mount -a” after boot works…I tried to delay it in rc.d/boot.local and I tried to add an auto boot item in gnome (yes, I would have to input the root pw every boot, but that would be ok…). But an auto boot item cannot be executed in a terminal (don’t know why…it just don’t work) so sudo isn’t possible. Gnomesu can’t be used with mount -a, so what can I do to?

Thank you

Pillus666

You can make a cron job containing this line in the cron table:

@reboot sleep 10;mount -a

Here is more about cron: Cron Tables (Crontab) in Suse / openSUSE [Event Scheduler for 10.x, 11.x]
The command line I gave you is created as root user, execute this command as root:

 crontable -e

and put the line in, you can adjust the sleep time, 10 (seconds) to suit.

For years I have used that technique to get cifs mounts to work, here are some thoughts on that puzzle: http://opensuse.swerdna.org/susesambacifs.html#slow

Create a script called ‘after.local’ in the the /etc/init.d/ directory. You’ll need root privileges for this

sudo nano /etc/init.d/after.local
#! /bin/sh
mount -a

make it executable with

sudo chmod a+x /etc/init.d/after.local

It will take effect next boot.

Pillus666 wrote:
> Hi, It’s my first post here and I searched and tried for hours…but I
> didn’t find a solution.
>
> I have an ASUS Wireless Router which shares a usb drive over network.
> It runs without any problems and it had run on my old openSUSE too.
>
> I edited my fstab and “mount -a” after boot works…I tried to delay it
> in rc.d/boot.local and I tried to add an auto boot item in gnome (yes, I
> would have to input the root pw every boot, but that would be ok…).
> But an auto boot item cannot be executed in a terminal (don’t know
> why…it just don’t work) so sudo isn’t possible. Gnomesu can’t be used
> with mount -a, so what can I do to?

Before setting up cron jobs or after.local, please show us what you have
tried. What is in your fstab? Does it contain the _netdev option? If
not, please try that first.

My fstab (I added the _netdev, but it doesn’t wor :frowning: ):

192.168.1.1:aidisk_a1 /home/NetworkData cifs _netdev,credentials=/home/myname/.smbcredentials,uid=myname    0 0

An mount -a after boot works, but I don’t want to do this every time…

So what’s better? Cron job or after.local? (I’m new at linux)

Thank you for your answers!
Pillus666

IMHO after.local is more elegant.

Knurpht wrote:
> IMHO after.local is more elegant.

How so?

Thank you guys! My problem is fixed :wink: The after.local works without problems…

is there a “thanks” button or something similar?

FWIW: No question in my mind: after.local is the way to go, easier by far than a cron job.

FYI I’ve noticed that _netdev lets us down in openSUSE for cifs mounts, for maybe the last few years it has been dodgy.

When I upgrage 11.3 to 12.1 I must enable start cifs on runlevel 3 an 5
It is work fine width _netdev option in fstab.
Not use mount -a in after.local

That is good to know. Thanks for your post.