Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
09-13-2006, 09:19 AM
|
#1
|
|
LQ Newbie
Registered: Sep 2006
Posts: 4
Rep:
|
fstab entry does not mount nfs share
hi to all. i have two machines 'A'(192.168.100.20) and 'B'(192.168.100.21) 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 192.168.100.20:/home/staff /home/staff
it works ok.
but if i write this in /etc/fstab it does not mount the relevant files at boot time:
192.168.100.20:/home/staff /home/staff default 0 0
i mean i can mount manually but fstab entry is not working.
PLEASE HELP I HAVE BEEN ON THIS FOR A WEEK NOW.
|
|
|
|
|
Click here to see the post LQ members have rated as the most helpful post in this thread.
|
09-13-2006, 09:27 AM
|
#2
|
|
Senior Member
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,189
Rep:
|
it should be
Quote:
192.168.100.20:/home/staff /home/staff nfs defaults 0 0
edited
|
Last edited by w3bd3vil; 09-13-2006 at 09:36 AM.
|
|
|
|
09-13-2006, 09:31 AM
|
#3
|
|
Moderator
Registered: Aug 2002
Posts: 10,691
|
Quote:
|
192.168.100.20:/home/staff /home/staff ntfs defaults 0 0
|
spotted a typo. Make sure the filesystem type is nfs not ntfs.
|
|
|
|
09-13-2006, 09:34 AM
|
#4
|
|
LQ Newbie
Registered: Sep 2006
Posts: 4
Original Poster
Rep:
|
ntfs or nfs
should i write nfs or ntfs? and thanks for the defaults tip. Thanks a lot
|
|
|
|
09-13-2006, 09:35 AM
|
#5
|
|
Senior Member
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,189
Rep:
|
nfs, nfs , nfs
|
|
|
|
09-13-2006, 09:38 AM
|
#6
|
|
LQ Newbie
Registered: Sep 2006
Posts: 4
Original Poster
Rep:
|
ok nfs it shall be
 ok nfs it shall be. and thanks a lot for such a quick response. hope i can help out others like this some day.
|
|
|
|
09-14-2006, 02:47 AM
|
#7
|
|
LQ Newbie
Registered: Sep 2006
Posts: 4
Original Poster
Rep:
|
no joy with fstab
i checked my system fstab entry, there is nothing wrong with it. here is exact entry:
192.168.100.20:/home/staff /home/staff nfs defaults 0 0
192.168.100.20:/home/student /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.
|
|
|
|
11-30-2006, 09:03 AM
|
#8
|
|
LQ Newbie
Registered: Jun 2004
Location: no
Distribution: fc2
Posts: 3
Rep:
|
Have you checked your hosts file. For some reason my dhcp is not answering for the server name soon enough
|
|
|
|
07-11-2007, 02:57 PM
|
#9
|
|
LQ Newbie
Registered: Mar 2007
Location: Israel
Distribution: Ubuntu
Posts: 13
Rep:
|
woot
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... 
|
|
|
|
07-11-2007, 04:24 PM
|
#10
|
|
LQ Newbie
Registered: Mar 2007
Location: Israel
Distribution: Ubuntu
Posts: 13
Rep:
|
I don't understand why this problem persists. I'm not looking further into this.
I've settled for the fstab line
Code:
192.168.34.2:/home/gator /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.
Cheers!
|
|
|
|
01-21-2011, 06:25 PM
|
#11
|
|
Member
Registered: Oct 2009
Posts: 31
Rep:
|
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.
|
|
|
|
03-08-2011, 08:22 PM
|
#12
|
|
LQ Newbie
Registered: Mar 2011
Posts: 1
Rep:
|
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  ff 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
|
|
|
2 members found this post helpful.
|
03-08-2011, 08:55 PM
|
#13
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
Last edited by jschiwal; 03-10-2011 at 04:43 PM.
Reason: file -> directory
|
|
|
|
06-07-2012, 02:05 PM
|
#14
|
|
LQ Newbie
Registered: Mar 2011
Posts: 1
Rep:
|
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.
|
|
|
1 members found this post helpful.
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:41 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|