# Help with /etc/fstab file for automatic mounting during boot

**URL:** <https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124>\
**Category:** SLES Install-Boot\
**Created:** [April 27, 2016, 8:17pm UTC](https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124 "2016-04-27T20:17:21Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![vlee93](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@vlee93](https://forums.suse.com/u/vlee93)\
**Post date:** [April 27, 2016, 8:17pm UTC](https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124/1 "2016-04-27T20:17:21Z")

</div>

Hello All,

I have been following this documentation to get these drives to automatically mount during boot.  
[https://www.novell.com/support/kb/doc.php?id=7000932](https://www.novell.com/support/kb/doc.php?id=7000932)  
I am using SUSE Linux Enterprise Server 11(x86\_64)  
Version = 11  
Patch Level = 3

However, I can only get the drives to mount if I enter the "Sudo mount -a " command into the terminal.

This is the current format of the line I am working on in the /etc/fstab file.

```auto
//IP/charts /media/nss/MEDIA/charts cifs auto,user=xxxxxx,password=xxxxxxx 0 0
```

I also tried adding \_netdev and this did not work.

```auto
//IP/charts /media/nss/MEDIA/charts cifs [COLOR="#FF0000"]_netdev[/COLOR],auto,user=xxxxxx,password=xxxxxxx 0 0
```

Please advise.  
Thank you.

- Victoria

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [April 27, 2016, 8:40pm UTC](https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124/2 "2016-04-27T20:40:40Z")

</div>

Hi  
Sounds like the network is not up in time…

Add a cronjob for root;

```auto
@reboot /usr/bin/mount -a
```

Or create an init script to run after the network is up to add the mount points.

---

<div class="post-metadata">

**Author:** ![vlee93](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@vlee93](https://forums.suse.com/u/vlee93)\
**Post date:** [April 27, 2016, 10:36pm UTC](https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124/3 "2016-04-27T22:36:30Z")

</div>

[QUOTE]Add a cronjob for root;  
Code:

@reboot /usr/bin/mount -a

[/QUOTE]

Hello,  
Sorry I am a bit new to linux.  
Where should I be adding this code?

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [April 28, 2016, 1:06am UTC](https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124/4 "2016-04-28T01:06:51Z")

</div>

> [@](#):
>
> On Wed 27 Apr 2016 07:44:02 PM CDT, vlee93 wrote:  
> [color=blue]
> 
> > Add a cronjob for root;  
> > Code:
> > 
> > @reboot /usr/bin/mount -a
> > 
> > [/color]
> 
> Hello,  
> Sorry I am a bit new to linux.  
> Where should I be adding this code?
> 
> Thanks for your help.

Hi  
As root user in a terminal run;

```auto
crontab -e
```

press i (to insert) then add the line indicated, then press esc : w q  
that will write the change and quit the crontab vi type editor, to  
check all is good, run;

```auto
crontab -l

# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.5AyYqv installed on Wed Apr 27 17:05:34 2016)
# (Cronie version 4.2)
@reboot	/usr/bin/mount -a
```

Then try your reboot and see if the remote shares mount.

–  
Cheers Malcolm Â°Â¿Â° LFCS, SUSE Knowledge Partner (Linux Counter #276890)  
openSUSE Leap 42.1|GNOME 3.16.2|4.1.20-11-default  
If you find this post helpful and are logged into the web interface,  
please show your appreciation and click on the star below… Thanks!

---

<div class="post-metadata">

**Author:** ![smflood](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/smflood/32/10576_2.png) [@smflood](https://forums.suse.com/u/smflood)\
**Post date:** [April 28, 2016, 1:57am UTC](https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124/5 "2016-04-28T01:57:52Z")

</div>

vlee93 Wrote in message:  
[color=blue]

> I have been following this documentation to get these drives to  
> automatically mount during boot.  
> [https://www.novell.com/support/kb/doc.php?id=7000932](https://www.novell.com/support/kb/doc.php?id=7000932)  
> I am using SUSE Linux Enterprise Server 11(x86\_64)  
> Version = 11  
> Patch Level = 3
> 
> However, I can only get the drives to mount if I enter the "Sudo mount  
> -a " command into the terminal.
> 
> This is the current format of the line I am working on in the /etc/fstab  
> file.
> 
> ## Code:
> 
> ```
> //IP/charts /media/nss/MEDIA/charts cifs auto,user=xxxxxx,password=xxxxxxx 0 0
> 
> ```
> 
> * * *
> 
> I also tried adding \_netdev and this did not work.
> 
> ## Code:
> 
> ```
> //IP/charts /media/nss/MEDIA/charts cifs _netdev,auto,user=xxxxxx,password=xxxxxxx 0 0
> 
> ```
> 
> * * *
> 
> Please advise.[/color]

Given your reference to “/media/nss/MEDIA/charts” is the server  
you’re trying this on running Novell Open Enterprise Server (OES)  
11? Please post the output from “cat /etc/\*release”.

## HTH.

Simon Flood  
SUSE Knowledge Partner

----Android NewsGroup Reader----  
[http://usenet.sinaapp.com/](http://usenet.sinaapp.com/)

---

<div class="post-metadata">

**Author:** ![vlee93](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@vlee93](https://forums.suse.com/u/vlee93)\
**Post date:** [April 28, 2016, 6:02pm UTC](https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124/6 "2016-04-28T18:02:10Z")

</div>

[QUOTE=malcolmlewis;32394]Hi  
As root user in a terminal run;

```auto
crontab -e
```

press i (to insert) then add the line indicated, then press esc : w q  
that will write the change and quit the crontab vi type editor, to  
check all is good, run;

```auto
crontab -l

# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.5AyYqv installed on Wed Apr 27 17:05:34 2016)
# (Cronie version 4.2)
@reboot	/usr/bin/mount -a
```

Then try your reboot and see if the remote shares mount.  
[/QUOTE]

Hello again,  
Thank you for the clear instructions. However, after a reboot they did not mount. ☹  
I’m not sure where to go from here. It just seems like they don’t want to stay mounted after a reboot!

---

<div class="post-metadata">

**Author:** ![vlee93](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@vlee93](https://forums.suse.com/u/vlee93)\
**Post date:** [April 28, 2016, 6:17pm UTC](https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124/7 "2016-04-28T18:17:37Z")

</div>

[QUOTE=smflood;32396]vlee93 Wrote in message:  
[color=blue]

> I have been following this documentation to get these drives to  
> automatically mount during boot.  
> [https://www.novell.com/support/kb/doc.php?id=7000932](https://www.novell.com/support/kb/doc.php?id=7000932)  
> I am using SUSE Linux Enterprise Server 11(x86\_64)  
> Version = 11  
> Patch Level = 3
> 
> However, I can only get the drives to mount if I enter the "Sudo mount  
> -a " command into the terminal.
> 
> This is the current format of the line I am working on in the /etc/fstab  
> file.
> 
> ## Code:
> 
> ```
> //IP/charts /media/nss/MEDIA/charts cifs auto,user=xxxxxx,password=xxxxxxx 0 0
> 
> ```
> 
> * * *
> 
> I also tried adding \_netdev and this did not work.
> 
> ## Code:
> 
> ```
> //IP/charts /media/nss/MEDIA/charts cifs _netdev,auto,user=xxxxxx,password=xxxxxxx 0 0
> 
> ```
> 
> * * *
> 
> Please advise.[/color]

Given your reference to “/media/nss/MEDIA/charts” is the server  
you’re trying this on running Novell Open Enterprise Server (OES)  
11? Please post the output from “cat /etc/\*release”.  
[/QUOTE]

Hello,

Yes it is Novell Open Enterprise Server 11

[CODE]# cat /etc/\*release  
LSB\_VERSION=“core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86\_64:core-3.2-x86\_64:core-4.0-x86\_64”  
Novell Open Enterprise Server 11 (x86\_64)  
VERSION = 11.2  
PATCHLEVEL = 2  
SUSE Linux Enterprise Server 11 (x86\_64)  
VERSION = 11  
PATCHLEVEL = 3

[/CODE]

---

<div class="post-metadata">

**Author:** ![smflood](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/smflood/32/10576_2.png) [@smflood](https://forums.suse.com/u/smflood)\
**Post date:** [April 28, 2016, 7:35pm UTC](https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124/8 "2016-04-28T19:35:14Z")

</div>

On 28/04/16 16:24, vlee93 wrote:  
[color=blue]

> Yes it is Novell Open Enterprise Server 11
> 
> ## Code:
> 
> ```
> # cat /etc/*release
> 
> ```
> 
> LSB\_VERSION=“core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86\_64:core-3.2-x86\_64:core-4.0-x86\_64”  
> Novell Open Enterprise Server 11 (x86\_64)  
> VERSION = 11.2  
> PATCHLEVEL = 2  
> SUSE Linux Enterprise Server 11 (x86\_64)  
> VERSION = 11  
> PATCHLEVEL = 3
> 
> --------------------[/color]

So you want to mount //IP/charts to the sub-directory charts of the  
mounted NSS volume MEDIA (/media/nss/MEDIA/charts)?

I suspect that during server startup the mount via /etc/fstab is  
attempted before the NSS volume has mounted.

## HTH.

Simon  
SUSE Knowledge Partner

* * *

## If you find this post helpful and are logged into the web interface, please show your appreciation and click on the star below. Thanks.

---

<div class="post-metadata">

**Author:** ![vlee93](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@vlee93](https://forums.suse.com/u/vlee93)\
**Post date:** [April 28, 2016, 7:46pm UTC](https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124/9 "2016-04-28T19:46:13Z")

</div>

Perhaps you can point me in the right direction of the other suggestion about the init script?

---

<div class="post-metadata">

**Author:** ![vlee93](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@vlee93](https://forums.suse.com/u/vlee93)\
**Post date:** [April 28, 2016, 7:48pm UTC](https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124/10 "2016-04-28T19:48:42Z")

</div>

[QUOTE=smflood;32402]On 28/04/16 16:24, vlee93 wrote:  
[color=blue]

> Yes it is Novell Open Enterprise Server 11
> 
> ## Code:
> 
> ```
> # cat /etc/*release
> 
> ```
> 
> LSB\_VERSION=“core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86\_64:core-3.2-x86\_64:core-4.0-x86\_64”  
> Novell Open Enterprise Server 11 (x86\_64)  
> VERSION = 11.2  
> PATCHLEVEL = 2  
> SUSE Linux Enterprise Server 11 (x86\_64)  
> VERSION = 11  
> PATCHLEVEL = 3
> 
> --------------------[/color]

So you want to mount //IP/charts to the sub-directory charts of the  
mounted NSS volume MEDIA (/media/nss/MEDIA/charts)?

I suspect that during server startup the mount via /etc/fstab is  
attempted before the NSS volume has mounted.  
[/QUOTE]

Yes. It gets mounted when I do it manually using sudo mount -a but during a reboot it does not work automatically.

---

<div class="post-metadata">

**Author:** ![Jens-U](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jens-U](https://forums.suse.com/u/Jens-U)\
**Post date:** [April 29, 2016, 1:54pm UTC](https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124/11 "2016-04-29T13:54:47Z")

</div>

Hi Victoria,

> [@vlee93;32404](#):
>
> Yes. It gets mounted when I do it manually using sudo mount -a but during a reboot it does not work automatically.

I guess the question is: When working through the /etc/fstab file, is /media/nss/MEDIA already available when the fstab entry for /media/nss/MEDIA/charts is processed.

Either /media/nss/MEDIA is the result of some later startup of a subsystem, or it even may be as simple as a question of ordering in /etc/fstab.

As a work-around you could place an according mount statement (a simple “mount /media/nss/MEDIA/charts”) into /etc/init.d/after.local, which is run after all services for a runlevel have been started.

Regards,  
Jens

---

<div class="post-metadata">

**Author:** ![vlee93](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@vlee93](https://forums.suse.com/u/vlee93)\
**Post date:** [May 5, 2016, 5:31pm UTC](https://forums.suse.com/t/help-with-etc-fstab-file-for-automatic-mounting-during-boot/28124/12 "2016-05-05T17:31:16Z")

</div>

Hello everyone,

This issue was fixed after adding a sudo mount-a command into the init.d file.  
Thank you for all your help.
