LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 09-13-2006, 10:19 AM   #1
nanbudh
LQ Newbie
 
Registered: Sep 2006
Posts: 4

Rep: Reputation: 0
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.
Old 09-13-2006, 10:27 AM   #2
w3bd3vil
Senior Member
 
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,189

Rep: Reputation: 49
Quote:
default 0 0
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 10:36 AM.
 
Old 09-13-2006, 10:31 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,063

Rep: Reputation: 761Reputation: 761Reputation: 761Reputation: 761Reputation: 761Reputation: 761Reputation: 761
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.
 
Old 09-13-2006, 10:34 AM   #4
nanbudh
LQ Newbie
 
Registered: Sep 2006
Posts: 4

Original Poster
Rep: Reputation: 0
ntfs or nfs

should i write nfs or ntfs? and thanks for the defaults tip. Thanks a lot
 
Old 09-13-2006, 10:35 AM   #5
w3bd3vil
Senior Member
 
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,189

Rep: Reputation: 49
nfs, nfs , nfs
 
Old 09-13-2006, 10:38 AM   #6
nanbudh
LQ Newbie
 
Registered: Sep 2006
Posts: 4

Original Poster
Rep: Reputation: 0
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.
 
Old 09-14-2006, 03:47 AM   #7
nanbudh
LQ Newbie
 
Registered: Sep 2006
Posts: 4

Original Poster
Rep: Reputation: 0
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.
 
Old 11-30-2006, 10:03 AM   #8
avayah
LQ Newbie
 
Registered: Jun 2004
Location: no
Distribution: fc2
Posts: 3

Rep: Reputation: 0
Have you checked your hosts file. For some reason my dhcp is not answering for the server name soon enough
 
Old 07-11-2007, 03:57 PM   #9
Dawn Light
LQ Newbie
 
Registered: Mar 2007
Location: Israel
Distribution: Ubuntu
Posts: 13

Rep: Reputation: 0
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...
 
Old 07-11-2007, 05:24 PM   #10
Dawn Light
LQ Newbie
 
Registered: Mar 2007
Location: Israel
Distribution: Ubuntu
Posts: 13

Rep: Reputation: 0
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!
 
Old 01-21-2011, 07:25 PM   #11
WSmart
Member
 
Registered: Oct 2009
Posts: 31

Rep: Reputation: 0
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.
 
Old 03-08-2011, 09:22 PM   #12
DHambali
LQ Newbie
 
Registered: Mar 2011
Posts: 1

Rep: Reputation: 2
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 2ff 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.
Old 03-08-2011, 09:55 PM   #13
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
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 05:43 PM. Reason: file -> directory
 
Old 06-07-2012, 03:05 PM   #14
mkeyes001
LQ Newbie
 
Registered: Mar 2011
Posts: 1

Rep: Reputation: 1
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.
  


Reply

Tags
at, boot, fstab, mount, nfs


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NFS mount of smb mount of windows share: permission denied problem :( Bagatur Linux - Networking 4 07-07-2009 12:34 PM
FSTAB: My Win Share Wont Mount @ Boot, but will when I sudo mount -a...please help! TruANTOlogy Ubuntu 8 06-20-2006 09:00 AM
usb fstab entry won't mount r/w Kilka Linux - Hardware 4 07-27-2004 12:05 PM
Why a FSTAB entry will mount using -a switch but will not mount automatically at boot mjen Linux - Newbie 3 05-19-2004 08:45 AM
Help with fstab entry to connect to network share adamsjw2 Linux - Networking 6 02-15-2004 12:24 PM


All times are GMT -5. The time now is 05:03 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration