-   Linux - Networking (
-   -   fstab entry does not mount nfs share (

nanbudh 09-13-2006 09:19 AM

fstab entry does not mount nfs share
hi to all. i have two machines 'A'( and 'B'( with dapper loaded.Both machines have two user accounts staff and student consequently i have a two directories /home/staff and /home/student on machine A as well as B.

Now i want these directories to be mounted by machine B at boot time in such way that if user logs in as staff on machine B he should have rw access to the mounted folder A:/home/staff and have no access to A:/home/student. similarly if user student logs in at B he should have rw access to A:/home/student but not to A:/home/staff.

i have installed and started portmap as well as nfs-kernel-server on A. i have also installed portmap and nfs-common on B. now everything works OK and if i mount thru terminal like this:
sudo mount /home/staff
it works ok.
but if i write this in /etc/fstab it does not mount the relevant files at boot time: /home/staff default 0 0
i mean i can mount manually but fstab entry is not working.

w3bd3vil 09-13-2006 09:27 AM


default 0 0
it should be
Quote: /home/staff nfs defaults 0 0

michaelk 09-13-2006 09:31 AM

Quote: /home/staff ntfs defaults 0 0
spotted a typo. Make sure the filesystem type is nfs not ntfs.

nanbudh 09-13-2006 09:34 AM

ntfs or nfs
should i write nfs or ntfs? and thanks for the defaults tip. Thanks a lot

w3bd3vil 09-13-2006 09:35 AM

nfs, nfs , nfs

nanbudh 09-13-2006 09:38 AM

ok nfs it shall be
:newbie: ok nfs it shall be. and thanks a lot for such a quick response. hope i can help out others like this some day.

nanbudh 09-14-2006 02:47 AM

no joy with fstab
i checked my system fstab entry, there is nothing wrong with it. here is exact entry: /home/staff nfs defaults 0 0 /home/student nfs defaults 0 0
and it is not working. i ran showmount -e on server the output was the exported directories. i ran showmount on client it showed the result ok. the portmap is running on client. i donot know how to check if nfs-common is running. but if run mount commond thru terminal the directories get mounted. whats happening here? please help.

avayah 11-30-2006 09:03 AM

Have you checked your hosts file. For some reason my dhcp is not answering for the server name soon enough

Dawn Light 07-11-2007 02:57 PM

I have the exact same problem. After boot mounting works, while putting it in fstab doesn't mount is successfully.

I've noticed that when I put the nfs line in fstab, portmap has a problem loading at boot.

Perhaps this happens because mount, when it reads the fstab line, acts different than typing mount ip:foo foo. Perhaps understanding how mount reads fstab will get me to the bottom of this... :study:

Dawn Light 07-11-2007 04:24 PM

I don't understand why this problem persists. I'm not looking further into this.

I've settled for the fstab line
Code: /home/dawn/gator nfs rw,noauto,user        0        0
This way it doesn't mount at boot and my desktop environment allows me to easily mount it as a user.


WSmart 01-21-2011 06:25 PM

Yes this thread is way old, but I have relevant info.

One thing to keep in mind when comparing commands in a virtual terminal to commands executed at startup from an fstab file is that the command syntax may be slightly different. So in a virtual terminal, if you had a dash(-) as part of a directory name, you might put it in quotes, /”Joe-Linux-NFS”/ . But with fstab, homey don't play that game-it might not won't work with the quotes, only without, /Joe-Linux-NFS/ .

I'm not sure how that plays with different issues like a space in the name. I think there you might have to put the entire directory in quotes with fstab. Trial and error, or get giggy with the manual.

Thanks all.

Be real, be sober.

DHambali 03-08-2011 08:22 PM

I'm going to assume that you're using some flavor of Red Hat. If that's the case your fstab isn't the heart of the problem.

Try this:

# chkconfig --list netfs
netfs 0: off 1: off 2:off 3: on 4: on 5: on 6: off

If 3, 4, and 5 are set to 'off' then you've not asked the OS to automatically mount the NFS file systems.

Run this and you should be able to persist across a reboot.

# chkconfig --level 345 netfs on

jschiwal 03-08-2011 08:55 PM

Having a dash in a directory name won't require escaping. You are right that bash isn't parsing the /etc/fstab file so you need to escape spaces in directory names as \040.

One could use the _netdev option in the fstab mount options. This allows the startup scripts to first mount local file mounts with "mount -a -O no_netdev", excluding nfs mounts. Then after the network is ready, it can mount those with _netdev entries.

Also be sure to check out automount, autofs and auto.master manpages. I think that autofs replaced netfs in recent kernels. Make sure you aren't using RH 9 which is obsolete and not secure.

mkeyes001 06-07-2012 02:05 PM

there is a bug in redhat where it doesn't mount the nfs partitions from fstab at reboot. add 'mount -a -t nfs' to /etc/rc.local.

All times are GMT -5. The time now is 02:30 PM.