Mounting NFS

Mounting NFS

Postby cuz2000m » Oct 1st, '13, 12:11

HI All,
I am having a problem mounting an Western Digital NFS drive with CIFS during bootup. I can mount it after I log into the machine with mount -a command. the following entry is in my fstab.

//192.168.1.202/media /mnt/media cifs credentials=/home/corey/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0


The following is in my syslog during bootup. It seems to delay my startup as it tries to mount the drive sometimes for over 2 mins before continuing to boot. Note that sometimes it works but most of the time it fails and I have to manually mount it after I log into the system.


Code: Select all
Mounting /mnt/media...
Sep 30 18:30:02 Gaia systemd[1]: mnt-media.mount: Directory /mnt/media to mount over is not empty, mounting anyway. (To see the over-mounted files, please manually mount the underlying file system to a secondary location.)
Sep 30 18:30:02 Gaia smb[1381]: Starting SMB services: [  OK  ]
Sep 30 18:30:02 Gaia systemd[1]: Starting CUPS Printing Service...
Sep 30 18:30:02 Gaia kernel: Key type cifs.spnego registered
Sep 30 18:30:02 Gaia kernel: Key type cifs.idmap registered
Sep 30 18:30:02 Gaia kernel: ip_tables: (C) 2000-2006 Netfilter Core Team
Sep 30 18:30:02 Gaia systemd[1]: Started CUPS Printing Service.
Sep 30 18:30:03 Gaia smb[1381]: Starting NMB services: [  OK  ]
Sep 30 18:30:03 Gaia systemd[1]: Started LSB: Samba servers (nmbd and smbd).
Sep 30 18:30:03 Gaia shorewall[1382]: Compiling...
Sep 30 18:30:02 Gaia kernel: ip6_tables: (C) 2000-2006 Netfilter Core Team
Sep 30 18:30:03 Gaia shorewall6[1388]: Compiling...
Sep 30 18:30:03 Gaia mount[1390]: mount error(101): Network is unreachable
Sep 30 18:30:03 Gaia mount[1390]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Sep 30 18:30:03 Gaia systemd[1]: mnt-media.mount mount process exited, code=exited status=32
Sep 30 18:30:02 Gaia kernel: CIFS VFS: Error connecting to socket. Aborting operation
Sep 30 18:30:02 Gaia kernel: CIFS VFS: cifs_mount failed w/return code = -101
Sep 30 18:30:03 Gaia systemd[1]: Failed to mount /mnt/media.
Sep 30 18:30:03 Gaia systemd[1]: Dependency failed for Remote File Systems.
Sep 30 18:30:03 Gaia systemd[1]: Job remote-fs.target/start failed with result 'dependency'.


I appreciate a point in the right direction or any help.

Cuz.
Last edited by isadora on Oct 1st, '13, 12:51, edited 1 time in total.
Reason: Command-output placed between [CODE]-tags, to keep the forum readable. ;)
cuz2000m
 
Posts: 14
Joined: Feb 5th, '12, 14:26

Re: Mounting NFS

Postby isadora » Oct 1st, '13, 12:52

~topic moved by moderator
..........bird from paradise..........

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
—Antoine de Saint-Exupéry
User avatar
isadora
 
Posts: 2765
Joined: Mar 25th, '11, 16:03
Location: Netherlands

Re: Mounting NFS

Postby doktor5000 » Oct 1st, '13, 22:11

cuz2000m wrote:Mounting /mnt/media...
Sep 30 18:30:02 Gaia systemd[1]: mnt-media.mount: Directory /mnt/media to mount over is not empty, mounting anyway. (To see the over-mounted files, please manually mount the underlying file system to a secondary location.)
[...]
Sep 30 18:30:03 Gaia shorewall6[1388]: Compiling...
Sep 30 18:30:03 Gaia mount[1390]: mount error(101): Network is unreachable
Sep 30 18:30:03 Gaia mount[1390]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Sep 30 18:30:03 Gaia systemd[1]: mnt-media.mount mount process exited, code=exited status=32
Sep 30 18:30:02 Gaia kernel: CIFS VFS: Error connecting to socket. Aborting operation
Sep 30 18:30:02 Gaia kernel: CIFS VFS: cifs_mount failed w/return code = -101
Sep 30 18:30:03 Gaia systemd[1]: Failed to mount /mnt/media.
Sep 30 18:30:03 Gaia systemd[1]: Dependency failed for Remote File Systems.
Sep 30 18:30:03 Gaia systemd[1]: Job remote-fs.target/start failed with result 'dependency'.
[/code]


At first it seems you're overmounting some existing filesystem/mountpoint with this mount.

And your issue seems to be that it tries to mount this thing before network is up. Either you try to add _netdev to the fstab options
for this cifs mount, or you enable the network-auth service, which will wait the boot until the network is up.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18051
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mounting NFS

Postby wintpe » Oct 4th, '13, 15:12

the other alternative to this approach is not to use fstab for remote mounts, as has been seen in many posts
it makes the booting up of your machine depend upon something that is not on your machine, and liable to
fail independently, and therefore create an external dependency.

instead use automount.

automount or autofs as its better known nowadays, allows you to setup mount targets that will mount on demand.

the easiest way to see it in use, is to have an NFS server and enable /net in /etc/autofs/auto.master , after installing the autofs package.

then in Dolphin just put in servername in the toolbar and it will show the shares on that server.

but say for example you want /local/0 mounted on a remote server

craeate a setting in auto.master of
/local auto.local

this says anything with /local at the beginning of it, use the contents of the file auto.local to find out how to proceed.

then in auto.local put in the line

0 mynfsserver:/local/0

then with autofs started and running

cd /local/0

and it will throw the mount as needed.

any attempt to access /local/0 either via a path or dolphin browsing will kick in the remote mount.

5 mins on inactivity and it will drop out.

but here's the thing, your boot up wont depend on the remote machine being up.

sure if you try to access /local/0 when the machine is up, and the target server is down , it will cause all sorts of time outs etc,
as you would expect.

autofs also supports samba.

using the following syntax

mntpoint -fstype=cifs ://example.com/shrname

above example taken from

https://help.ubuntu.com/community/Autofs

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: Mounting NFS

Postby doktor5000 » Oct 4th, '13, 21:03

wintpe wrote:the other alternative to this approach is not to use fstab for remote mounts, as has been seen in many posts
it makes the booting up of your machine depend upon something that is not on your machine, and liable to
fail independently, and therefore create an external dependency.

With systemd you can just mark remote mounts with _netdev in fstab, so that they will not be mounted until your network is up,
and additionally you can use nofail if they are not critical. If you don't use nofail then normally desktop session login should only
proceed until those mounts are in place.

wintpe wrote:instead use automount.

That's another elegant way, and only mounts stuff when you need it.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18051
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron