Fedora Linux Support Community & Resources Center
  #1  
Old 6th April 2012, 09:02 PM
ablen Offline
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 51
windows_7ie
fstab / NFS question under FC16

Hello everyone,

I used the following document as a guide when setting up NFS:
http://www.server-world.info/en/note?os=Fedora_16&p=nfs

I have three machines in my test environment - one server and two clients.

I got NFS working which is good. But to do it I had to comment out one of the lines in each client's /etc/fstab file like so:

Code:
#
# /etc/fstab
# Created by anaconda on Wed Mar 28 15:14:35 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=c732a798-4289-41b4-b7ed-512bd3b3b061 /                       ext4    defaults        1 1
UUID=4d790f8a-6b80-4fe8-a0c9-10515cf7fad0 /boot                   ext4    defaults        1 2
# UUID=518efdb7-ff91-4e86-8117-f8d6bc90bd30 /home                   ext4    defaults        1 2
UUID=9488d5a4-3b27-486b-b1cc-c713c0a7f63b swap                    swap    defaults        0 0

thelinuxsrv:/home /home        nfs     defaults        0 0
You will also notice that I added my own mount command to the end of the file where the server's /home directory is imported onto the client. I need this for NIS.

So the reason I had to comment out the UUID line is because it was causing a conflict with my mount which was preventing NFS from working properly on both of my clients. Both were trying to mount into the /home directory.

Now, at the moment everything seems to be working great. But since the UUID line I commented out did originally appear by default on each of my clients following the nfs installation I am wondering now if I am begging for a new problem by commenting out that line.

Does anyone have advice? Can anyone tell me what that line is doing and whether it is OK to comment it out as I have done?

Thanks everyone. I since installed NIS and that works great as well with this solution (as far as I can tell). All three of my systems are running FC16 64-bit.

Thanks all,
ablen
Reply With Quote
  #2  
Old 6th April 2012, 09:37 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,150
linuxfirefox
Re: fstab / NFS question under FC16

That line is mounting a local partition for the /home mountpoint.

Until union mounts become available, you can only have one mount for a mountpoint, therefore the local partition entry for /home must be commented out.
Reply With Quote
  #3  
Old 7th April 2012, 01:42 PM
ablen Offline
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 51
windows_xp_2003ie
Re: fstab / NFS question under FC16

jpollard,

Thanks for your reply. I think you are saying that I am not breaking anything by doing this. Is that correct? Thanks for the explanation.
Reply With Quote
  #4  
Old 7th April 2012, 02:12 PM
stoggy Offline
Registered User
 
Join Date: Dec 2006
Location: Dallas, TX
Posts: 123
linuxfirefox
Re: fstab / NFS question under FC16

correct you are not breaking something. You fixed something. The previous /home partition on the local machine could be used for something else now.

You cant have 2 mounts of any kind to the same mount point.

You can have a mount point and mount point under it though.

/home
/home/username
/home/username/Download
/home/user2name

You could have all 4 as mount points with seperate partitions being mounted to each. This would also allow you to have other users under home. but username and username2 would have their very own partitions.

Normally when someone does nfs home partitions each user will get their own mount point not just 1 giant one for all users. You can use automount for this too. So if the partition is not already mounted when the user logs in the system will mount the partition for you.

try googling autofs home dirs
Reply With Quote
  #5  
Old 7th April 2012, 03:38 PM
glennzo's Avatar
glennzo Online
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Posts: 13,974
linuxfirefox
Re: fstab / NFS question under FC16

One question for the OP. Does the nfs mount actually "mount" at boot?
__________________
Glenn
The Bassinator © ®


Laptop: Toshiba Satellite / Intel Core 2 Duo 1.73 GHz / 2GB / 160GB / Intel Mobile 945GM/GMS/GME/943/940GML Integrated Graphics
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / 1TB SATA / 500GB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
  #6  
Old 7th April 2012, 05:48 PM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,346
linuxfirefox
Re: fstab / NFS question under FC16

The explanation given by jpollard is wrong.

It is perfectly possible to mount multiple filesystems on top of each other without problems, and this has NOTHING to do with union file systems. For example:

Code:
[root@crucibulum ~]# ls /home
common	lopt  lost+found  opt  ryyyyyy  sxxxxx  stevea
[root@crucibulum ~]# mount | grep /home
/dev/sda3 on /home type ext4 (rw,noatime,user_xattr,barrier=1,data=writeback,discard)
gvfs-fuse-daemon on /home/stevea/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=1020,group_id=1020)
[root@crucibulum ~]# mount /dev/sda5 /home
[root@crucibulum ~]# ls /home
Desktop  linux
[root@crucibulum ~]# mount | grep /home
/dev/sda3 on /home type ext4 (rw,noatime,user_xattr,barrier=1,data=writeback,discard)
gvfs-fuse-daemon on /home/stevea/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=1020,group_id=1020)
/dev/sda5 on /home type btrfs (rw,relatime,ssd,nospace_cache)
I can also mount an nfs on top of those two mounts
Code:
[root@crucibulum ~]# mount hypoxylon:/common /home -t nfs
[root@crucibulum ~]# mount | grep /home
/dev/sda3 on /home type ext4 (rw,noatime,user_xattr,barrier=1,data=writeback,discard)
gvfs-fuse-daemon on /home/stevea/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=1020,group_id=1020)
/dev/sda5 on /home type btrfs (rw,relatime,ssd,nospace_cache)
hypoxylon:/common on /home type nfs4 (rw,relatime,vers=4,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.42.115,minorversion=0,local_lock=none,addr=192.168.42.103)
[root@crucibulum ~]# ls /home/
alug	cellphone  Dox	   hobby	 music	    orders   root	       Tech  usb
backup	CUPS-PDF   .....


Quote:
Code:
#
# /etc/fstab
# Created by anaconda on Wed Mar 28 15:14:35 2012
....
# UUID=518efdb7-ff91-4e86-8117-f8d6bc90bd30 /home                   ext4    defaults        1 2
....
thelinuxsrv:/home /home        nfs     defaults        0 0
You will also notice that I added my own mount command to the end of the file where the server's /home directory is imported onto the client. I need this for NIS.

So the reason I had to comment out the UUID line is because it was causing a conflict with my mount which was preventing NFS from working properly on both of my clients. Both were trying to mount into the /home directory.
That should NOT be a problem. Please post the output of the server /etc/exports file and the client
'exportfs -v'. also post the output of "mount | grep home" while the NFS is mounted.


Quote:
Does anyone have advice? Can anyone tell me what that line is doing and whether it is OK to comment it out as I have done?
What you are doing can be done - was part of the ancient Sun NIS/Yellowpages way of doing things. However making /home an NFS mount means that you can't login as a user or with a gui unless the mount has already succeeded.

Of course the simple solution is to UNcomment the UUID /home line you have commented out and make that work. (and it should). Then you can have a small vestigial /home directory locally in case the nfs mount fails.

---------- Post added at 12:48 PM ---------- Previous post was at 12:12 PM ----------

=========== SOLUTION ================

The problem is NOT having two mounts at the same point - that has been supported for years.

The problem is that the systemd package analyzes the /etc/fstab and then starts exactly one unit per mount point, and that unit only mounts the first fstab entry for that mountpoint. The 'mount -a' command will mount all entries. I *think* this is a systemd bug.


The workaround is to fool systemd by creating different string name for the second mountpoint (still referring to the same directory).


The OP should do this .....

sudo ln -s /home /also-home
then edit /etc/fstab like ....
Code:
#
# /etc/fstab
# Created by anaconda on Wed Mar 28 15:14:35 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=c732a798-4289-41b4-b7ed-512bd3b3b061 /                       ext4    defaults        1 1
UUID=4d790f8a-6b80-4fe8-a0c9-10515cf7fad0 /boot                   ext4    defaults        1 2
UUID=518efdb7-ff91-4e86-8117-f8d6bc90bd30 /home                   ext4    defaults        1 2
UUID=9488d5a4-3b27-486b-b1cc-c713c0a7f63b swap                    swap    defaults        0 0

thelinuxsrv:/home /also-home        nfs     defaults        0 0
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe

Last edited by stevea; 7th April 2012 at 05:50 PM.
Reply With Quote
  #7  
Old 9th April 2012, 09:26 PM
ablen Offline
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 51
windows_7ie
Re: fstab / NFS question under FC16

Quote:
Originally Posted by glennzo View Post
One question for the OP. Does the nfs mount actually "mount" at boot?
Yes, as far as I can see my method is working perfectly. I just didn't know why it wanted (by default) to mount something else to a client's home directory or what that exactly meant. After observing a conflict for some time (the /home directory I wanted wouldn't mount) I finally just commented out the offending line of code. I reasoned that if the client's home directory ended up looking just like my server's home directory that this was fine with me - what ever that other command wanted to mount to the client's home directory (whatever it was) wasn't important to me.

stevea, there is a lot in your post. Thanks for your attention. Here's what my system produces:

Code:
[root@linuxsrv ~]# cat /etc/exports
/home linux*(rw,sync)

/NFS4exports linux*(rw,insecure,sync,wdelay,no_subtree_check,no_root_squash,fsid=0)
/NFS4exports/home linux*(rw,insecure,sync,wdelay,no_subtree_check,nohide,no_root_squash)
Also:

Code:
[root@linux2 ~]# exportfs -v
[root@linux2 ~]#
Also:

Code:
[root@linux2 ~]# mount | grep home
linuxsrv:/home/ on /home type nfs4 (rw,relatime,vers=4,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=0.0.0.0,minorversion=0,local_lock=none,addr=158.121.71.100)
[root@linux2 ~]#
If commenting out the line is a reasonable solution I am happy with that. Mainly I don't know what the original line (that I commented out) is for. Why should anything get mounted to the /home directory by default? That's the gap in my knowledge. Whatever it was mounting wasn't apparent to me - since my client's home directory looked the same whether I commented out that line or left it intact.
Reply With Quote
Reply

Tags
fc16, fstab, nfs, question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
fstab question burnie Using Fedora 4 1st December 2009 02:49 AM
A question with fstab? cola Using Fedora 2 7th May 2009 01:21 PM
Fstab question... I've read them all zackiv31 Installation and Live Media 2 6th February 2007 10:49 AM
Another NTFS / fstab question citizenkeith Using Fedora 1 29th May 2006 05:17 AM
Ntfs/fstab question Belegdol Using Fedora 0 6th February 2006 06:45 PM


Current GMT-time: 22:38 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat