LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 07-06-2008, 01:05 PM   #1
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
mount a whole partition over NFS


I don't have problems mounting a directory, however I'd like to mount a whole data partition /dev/sdb1 (320GB) over NFS

When I try to put it in /etc/exports

Code:
/home   192.168.1.107(rw)
/dev/sdb1 192.168.1.107(rw)
Code:
[root@f9-sda10-105 xtd8865]# /usr/sbin/exportfs -ra
exportfs: Warning: /dev/sdb1 is neither a directory nor a file.
     remote access will fail

Normally /dev/sdb1 is mounted on one of my home directories on the remote machine, however, when I mounted my /home over NFS, and checked /home/username/data (the directory that /dev/sdb1 is locally mounted on) and it seems to be empty. Can it be a permission problem?


thanks
 
Old 07-06-2008, 01:11 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836

Original Poster
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Quote:
Normally /dev/sdb1 is mounted on one of my home directories on the remote machine, however, when I mounted my /home over NFS, and checked /home/username/data (the directory that /dev/sdb1 is locally mounted on) and it seems to be empty. Can it be a permission problem?
Ok, sorted

Then my next question:

the entry in /etc/exports is:
/home/username/data1 192.168.1.105(rw)

how can I add it to /etc/fstab on the client machine?

thanks
 
Old 07-06-2008, 01:55 PM   #3
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
man fstab

Sample:
Code:
server:/home/username/data1   /mnt/SOMEDIR   nfs    NFSOPTIONS_HERE 0 0
Suit to taste.
 
Old 07-06-2008, 02:07 PM   #4
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836

Original Poster
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
I was mostly concerned with the nfs options. I have decided on rw,setuid.
Now I'm reading about autofs (however, in my case one mount will not make a big difference for my system)

thanks
 
Old 07-06-2008, 02:09 PM   #5
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
The autofs automounter allows the file system to be mounted upon access.
It may be that what you really want is mount at boot time.

Which of these ?

The options you chose for NFS mounts depends upon your usage scenarios.
 
Old 07-06-2008, 02:28 PM   #6
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836

Original Poster
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Although I haven't noticed any visible impact on the performance (mounted via fstab) even with some additional network traffic, I might go for autofs. The reason being that the nfs client is connected to the router via wireless which is controlled by network manager. As the partitions are mounted at an early stage of the system boot up, it will probably fail to mount, as the laptop gets connected to the internet in the GUI environment.
 
Old 07-06-2008, 02:39 PM   #7
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
There is no difference in performance relative to autofs v. fstab mounts. What mechanism performs that mount is irrelevant.

You can set your fstab to retry in the background to not hold up other mounts with the bg option, or noauto to not automatically mount upon during boot (eg. mount -a). This allows you to mount -a -t nfs later.

FYI: partitions are not mounted - file systems are.
 
Old 07-06-2008, 03:12 PM   #8
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836

Original Poster
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Quote:
There is no difference in performance relative to autofs v. fstab mounts. What mechanism performs that mount is irrelevant.
Well, not according to redhat manuals on NFS :

Quote:
One drawback to using /etc/fstab is that, regardless of how much you use that mounted filesystem, your system must dedicate resources to keep that mount in place. This is not a problem with one or two mounts, but when your system is maintaining mounts to a dozen systems at one time, overall system performance can suffer. An alternative to /etc/fstab is to use the kernel-based automount utility, which will mount and unmount NFS filesystems automatically, saving resources.
HOwever, as I would have only one NFS mount, it shouldn't matter.
Quote:
...noauto to not automatically mount upon during boot (eg. mount -a). This allows you to mount -a -t nfs later
I will try it

thanks
 
Old 07-06-2008, 03:24 PM   #9
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Quote:
Originally Posted by sycamorex View Post
Well, not according to redhat manuals on NFS :
I think perhaps there is a misunderstanding. What is the reference?
 
Old 07-06-2008, 03:37 PM   #10
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836

Original Poster
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
http://www.redhat.com/docs/manuals/l...nt-config.html

But anyway, I've modified the fstab entry and used the bg option - it's really clever to
exit with a zero exit code and to keep trying to mount it in the background.
 
Old 07-06-2008, 03:55 PM   #11
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
The performance topic you see is about very large environments where dozens or hundreds of mounted and cross-mounted directories are maintained. Each mount consumes a certain amount of memory in the mount table, and a certain amount of network bandwidth to maintain the mount. For anything less, you have nothing to be concerned about.

Automounting has pros and cons, which you'll discover soon enough.
 
Old 07-06-2008, 04:15 PM   #12
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836

Original Poster
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Yeah, that's what I meant - it wouldn't matter for my setup

Actually, what I might do is to have 2 nfs mounts - one via fstab, the other one via automounting.
Just for the sake of learning and comparing...
 
Old 07-06-2008, 04:56 PM   #13
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Sounds fine. Just avoid accidental overlapping mounts (eg. manual mount + automount on same mount point).

Just as an FYI, fstab is simply a convenience table for mount(8), fsck(8), dump(8) and a few other utilities. There are no special properties about it. I mention this for those reading who think there is something "magical" about /etc/fstab (vs. manual mount, fsck, etc.).
 
  


Reply



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
how to mount a nfs mount from linux client to AIX nfs server dennyqian AIX 13 04-11-2016 11:30 PM
NFS mount of smb mount of windows share: permission denied problem :( Bagatur Linux - Networking 4 07-07-2009 11:34 AM
mount: mount to NFS server '192.168.0.3' failed: System Error: Connection refused. fakie_flip Linux - Server 1 04-10-2008 12:28 AM
Unable to export DISPLAY or mount an NFS partition on RHEL5 sudheer_tenneti Linux - Networking 0 08-30-2007 06:48 AM
How do I mount remote vfat partition with nfs x9abm Linux - Networking 10 08-29-2003 03:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration