Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mounting a network file system on boot?

20 views
Skip to first unread message

Philip

unread,
Feb 15, 2012, 4:10:11 PM2/15/12
to
I have a Windows ANT share network drive and I can mount it on the
command line, but I want to mount it on boot. The relevant line in my /
etc/fstab is:

//my_url.com/dir1 /home/myusername/ant-share cifs
auto,user,suid,credential=/home/
myusername/.CIFS.credentials,rw,file_mode=0666,dir_mode=0777
0 2

My ~/.CIFS.credentials file contains:

username=myusername
domain=ant
password=secret


How can I mount it automatically on boot?

Aragorn

unread,
Feb 16, 2012, 2:28:37 AM2/16/12
to
On Wednesday 15 February 2012 22:10, Philip conveyed the following to
comp.unix.admin...
My guess would be that your system is mounting the local filesystems
before your network is up [*], and as such, the share wouldn't get
mounted.

You have not told us what UNIX version or GNU/Linux distribution you're
using, but if you have a traditional System V init system, I would put a
mount command for it in "/etc/init.d/rc.local".


[*] Which itself comprises of several steps, i.e.:
- loading the network driver (if this is a GNU/Linux system with
udev and eventually ifplugd);
- bringing up the network interface;
- bringing up the daemons to connect to a Windows network; and
- mounting the Windows shares.

--
= Aragorn =
(registered GNU/Linux user #223157)

Doug Freyburger

unread,
Feb 16, 2012, 3:53:27 PM2/16/12
to
Aragorn guessed order of events at start up. I have CIFS mounts on
several Red Hat Enterprise 4 and 5 systems that work fine in the default
order with /etc/fstab entries like that. So I'll offer a different
thing to look at -

Is /home a static mount point on your system or an automount? If it is
a direct mount then all you need is for it to appear below the /home
entry in /etc/fstab and probably not even that. If it is an automount
you would need to switch /home to a static mount. Or /home/myusername
to a static mount. The reason is static mounts happen before automounts
in the boot sequence so Aragorn's reason applies in a different
variation.

Also check the boot logs (likely /etc/rc.log depending on your system
type) for the exact error message at boot time when it reaches that
point.

Stefaan A Eeckels

unread,
Feb 16, 2012, 5:52:09 PM2/16/12
to
No need to do a hard mount when booting - if the share is not available
the system might not boot.

This is what the automounter is for.

--
Stefaan

Philip

unread,
Feb 17, 2012, 2:52:47 PM2/17/12
to
Thank you all.

Aragorn's suggestion works. I added the mount command at the end of /
etc/rc.d/rc.local and the directory is mounted automatically.

The system is a Red Hat Enterprise 4. /home is within the / partition,
and / is listed in /etc/fstab before the CIFS volume. There is no
file rc.log in /etc or /var. dmesg does not list anything about
mounting, and the other log files do not show anything that seems
relevant to me. Only /var/log/messages lists some Ext3 mounts like:

kernel: EXT3-fs: mounted filesystem with ordered data mode.

but nothing about CIFS.
0 new messages