-
HOWTO: NFS Server/Client
Why NFS?
I simply wanted to experiment with NFS, and couldn't seem to find the documentation here on the forums. I found using NFS just as easy if not easier than using Samba for sharing between a few of my Unix based systems. In order to share a folder it only required a single line in a configuration file under /etc/exports, and a single line under /etc/fstab on the client to mount the share on each client at boot.
I mostly edited and moved things around from these guides to make a more complete single guide to getting this working using Ubuntu.
http://www.cyberciti.biz/tips/ubuntu...nfs-share.html (for client configuration)
http://www.redhat.com/docs/manuals/l...nfs-mount.html (for mounting using fstab)
<removed dead link>
http://www.freebsd.org/doc/en_US.ISO...twork-nfs.html (contains more info about NFS)
Install NFS Server Support
at the terminal type
sudo apt-get install nfs-kernel-server nfs-common portmap
When configuring portmap do =not= bind loopback. If you do you can either edit /etc/default/portmap by hand or run:
sudo dpkg-reconfigure portmap
sudo /etc/init.d/portmap restart
Editing /etc/exports
the /etc/exports file is used for creating a share on the NFS server
invoke your favorite text editor or
sudo vi /etc/exports
Here are some quick examples of what you could add to your /etc/exports
For Full Read Write Permissions allowing any computer from 192.168.1.1 through 192.168.1.255
- /files 192.168.1.0/24(rw,no_root_squash,async)
Or for Read Only from a single machine
- /files 192.168.1.2 (ro,async)
save this file and then in a terminal type
sudo /etc/init.d/nfs-kernel-server restart
Also aftter making changes to /etc/exports in a terminal you must type
sudo exportfs -a
Install NFS client support
sudo apt-get install portmap nfs-common
Mounting manually
Example to mount server.mydomain.com:/files to /files. In this example server.mydomain.com is the name of the server containing the nfs share, and files is the name of the share on the nfs server
The mount point /files must first exist on the client machine.
cd /
sudo mkdir files
to mount the share from a terminal type
sudo mount server.mydomain.com:/files /files
Note you may need to restart above services:
sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-common restart
Mounting at boot using /etc/fstab
Invoke the text editor using your favorite editor, or
gksudo gedit /etc/fstab
In this example my /etc/fstab was like this:
- server.mydomain.com:/files /files nfs rsize=8192,wsize=8192,timeo=14,intr
You could copy and paste my line, and change “servername.mydomain.com:/files”, and “/files” to match your server name:share name, and the name of the mount point you created.
It is a good idea to test this before a reboot in case a mistake was made.
type
mount /files
in a terminal, and the mount point /files will be mounted from the server.
-
Re: HOWTO: NFS Server/Client
Thanks, this howto made simple what the wiki howto makes look difficult. I can now dispense with the vagaries of samba :-)
-
Re: HOWTO: NFS Server/Client
Thanks for the howto. The only problem I ran into was with this line:
Quote:
Originally Posted by
malco2001
save this file and then in a terminal type
/etc/init.d/nfs-kernel-server restart
it gave me a bunch of errors until I sudo'd it.
sudo /etc/init.d/nfs-kernel-server restart
-
Re: HOWTO: NFS Server/Client
Thank you for writing this!!! I have been sifting through posts for two days trying to figure out how to share files between my two ubuntu(dapper) pc's. Your instructions worked the first time I tried them.
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by malco2001
save this file and then in a terminal type
/etc/init.d/nfs-kernel-server restart
Quote:
Posted by InspirationDate
it gave me a bunch of errors until I sudo'd it.
i edited my post to fix that. i'm glad it worked so well for all of you. :)
-
Re: HOWTO: NFS Server/Client
Had some serious speed problem with Samba. Setting up NFS from your guide works well! Now I'm doing 30-40Mb (gigabit network) per sec instead of 1-3Mb with Samba. Thanks!
-
Re: HOWTO: NFS Server/Client
thanks for this guide really cool
however I have a bunch of Disks mountet on the server i home dir
and I wanted to just mount the home dir in the client.
I did'nt work. I could not see the subdirs for some reason.
thoug if in export I make explicit what dirs to export where the dirs are disks, then it worked fine after restarting the service and making new mount points of course.
though if someone can explain how to just mount the home of the server that would be great. I did everything as the guide instructed.
-
Re: HOWTO: NFS Server/Client
If you're connection to a Linux NFS server from Mac OS X, you need to specify 'insecure' in your exports and map the user IDs since Macs use uid 501 for the first regular user. For my /etc/exports I use:
/home 192.168.0.0/255.255.255.0(rw,async,insecure,all_squash,anonuid =1000,anongid=1000)
-
Re: HOWTO: NFS Server/Client
Thankyou malco2001,
Very precise and to the point, gained access to my freenas box in mere moments once i read this post, now to make sunbird share it's calendar file for both my ubuntu and windows boxes.
Many thanks
Pebbles
-
Re: HOWTO: NFS Server/Client
thanks, I found this helpful, and quite easy to config with the built in nfs module in webmin. I also experienced a speed increase of about double over samba.
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
jabb
thanks for this guide really cool
however I have a bunch of Disks mountet on the server i home dir
and I wanted to just mount the home dir in the client.
I did'nt work. I could not see the subdirs for some reason.
thoug if in export I make explicit what dirs to export where the dirs are disks, then it worked fine after restarting the service and making new mount points of course.
though if someone can explain how to just mount the home of the server that would be great. I did everything as the guide instructed.
Yeah, I have the same problem here. I ended up making new mountpoints and assigning them explicitly as you did. I don't believe there's a fix for this.
Other than that it's a great HOWTO, thank you malco2001! O:)
-
Re: HOWTO: NFS Server/Client
This worked great until I rebooted. Once I rebooted my client, I lost my mount point to my server. I do have the fstab modified to contain this:
server.ip.address:/data /mnt/parolee nfs rsize=8192,wsize=8192,timeo=14,intr
any idea why it won't stay mounted when I log in?
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
george_apan
Yeah, I have the same problem here. I ended up making new mountpoints and assigning them explicitly as you did. I don't believe there's a fix for this.
I found a workaround for this. I have the mountpoints on the server under /media and I just did an
ln -s /media/example ~/example
Now I can see my mounted drives through the network under the home dir that I'm sharing using their symbolic links. No need to have multiple shares anymore.
EDIT: No, sorry, I thought it worked but it didn't. As soon as I added another drive that I was not sharing, the link wouldn't work. Sorry again... :-&
-
Re: HOWTO: NFS Server/Client
worked great first time around. one minor nuisance. when i boot up the client (my laptop) it seems to take a while for the files from the server to be mounted on the mount point. i'm thinking this could be because a) wireless networking and/or b) the server is an older machine and/or c) the share being mounted is 10+ gigs in size
is that probably the cause or is there something else that can be done? if not, oh well, it still works and that's great!
-
Re: HOWTO: NFS Server/Client
Help a Noob out. I get this error
wayne@asus:~$ sudo mount 192.168.0.2:/home/winninshare /home/winninshare
mount: 192.168.0.2:/home/winninshare failed, reason given by server: Permission denied
I did exactly as you said.I have 2 computers with static IPs with the following in my other computer's exports file
/home/winninshare 192.168.1.1/24(rw,no_root_squash,async)
Sooo, i should be able to mount the winninshare folder on my computer in /home/winninshare? or am i mistaken.
-
Re: HOWTO: NFS Server/Client
Thanks for the setup. This was exactly what I needed to get some hefty files off two Ubuntu machines with USB 1.1 ports. :shock: Cheers! ;)
-
Re: HOWTO: NFS Server/Client
After editing the /etc/exports file run
sudo exportfs -a
then
sudo /etc/init.d/nfs-kernel-server restart
should work then
-
Re: HOWTO: NFS Server/Client
Okay so heres the problem with me on this...
The server is working fine because from the machine that's running NFS Server, I can mount NFS mounts as a clinet (using either loopback or internal lan IP).
But if I use a laptop thats on the same lan and do something to the effect of :
'sudo mount 192.168.11.5:/media /test'
(the same exact line I use on the server machine to mount the NFS share)
it says 'mount to NFS server '192.168.11.5' failed: server is down.'
NFS runs on port 2049 if Im not mistaken and I even opened that up on my router directly to this machine (the server) and it still doesnt work. Can anyone help with this?
-
Re: HOWTO: NFS Server/Client
Chalk one up to stupidity.
One should always make sure the proper files are installed on the client computer before making any posts that shows that one is an idiot :)
-
Re: HOWTO: NFS Server/Client
okay ... i'm completely confused.
i have a very small network. my server only leases 10 dhcp addresses.
how the heck does this:
work out to be a range from 192.168.1.1 - 192.168.1.255 ??
if i edited it incorrectly, it told me that what came after the "/" was the netmask. so i changed the line to this:
Code:
192.168.1.1/255.255.255.0
which seemed to have no ill effect.
edit: despite my continued confusion as stated above, i still managed to make a working automatic nfs client and server connection on boot. so, i humbly offer my thanks to malco2001.
-
Re: HOWTO: NFS Server/Client
This works really nice, way better then samba - and much faster.
But I have one question, I coulnd't find a solution with a 'quick' google search.
When PC1 is on, and I boot up PC2, fstab automounts the shared folder on PC1. But how do I get PC1 to automount the shared folder on PC2 after PC2 boots up? I can mount it manually, but I thought it would be nice if it happens automaticly.
-
Re: HOWTO: NFS Server/Client
as far as i know, there is no way to make a previously booted machine detect that a server share has just come online.
edit: typed "samba" from sheer habit.
-
Re: HOWTO: NFS Server/Client
I'm not using samba, but NFS.
And I indeed couldn't find a program which did it, so today I learned some basic bash scripting, and wrote a script which can detect if the other computer is online, and automaticly mounts the shared folder. If the other computer goes offline it will unmount the shared folder. See:
http://www.ubuntuforums.org/showthre...52#post1699752
-
Re: HOWTO: NFS Server/Client
192.168.1.1/24 does not mean 192.168.1.1 - 192.168.1.255
It means 192.168.1.1 - 192.168.1.24
You would want 192.168.1.1/255 for that effect
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
marx2k
192.168.1.1/24 does not mean 192.168.1.1 - 192.168.1.255
It means 192.168.1.1 - 192.168.1.24
You would want 192.168.1.1/255 for that effect
You obviously don't know what you're talking about. 192.168.1.1/24 does exactly what he said it should, allow access to 192.168.1.1-192.168.1.255. An IP address is 32 bits and the /n means the n most significant bits of the IP address must match the given IP address to connect. So in this case the first 24 bits, or the 192.168.1 part must match. As another example if you had 192.168.1.1/8, anything that had an address of 192.x.y.z would be able to connect with the server since each group is 8 bits.
-
Re: HOWTO: NFS Server/Client
Hi folks--
Hope you can help with this twist on what you are doing.
My server is a Red Hat 9.0 machine.
My fstab is
Code:
samba1:/vol22 /sam/vol22 nfs rw,hard,intr 0 0
But when I try to do anything in this /vol22 directory, it says permission denied.
Now I suspect the problem is that my user's uid on my Ubuntu 6.06 box is 1000, while on the red hat 9.0 box it is 1000. I would prefer to change the UID on the Ubuntu box. I tried changing /etc/passwd where it says 1000:1000 to 500:500, and the Ubuntu box no longer lets me do anything (one error message actually said: "You don't exist, go away!"). So I changed that back. I tried changing it to 1000:500 and to 500:1000 but both give me tne permission denied error.
Of course, I might be guessing wrong as to the problem.
Any ideas how I can troubleshoot this?
Thanks!
:- Doug.
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
dgermann
Any ideas how I can troubleshoot this?
start with your redhat box. the folder you're trying to connect to (vol22) is where your permission problems are.
don't know anything about RH file structure, so i don't know where /vol22 is, but you won't be able to write to your entire drive. you'll only be able to write to folders which have user level permissions (eg. /home).
so you can tackle this one in a couple of ways:
1) make a folder on your RH box chmodded so that your RH login (not root) has full read and write access to it.
<or>
2) mount your /home directory instead of /vol22 on your RH box.
this way, your remote access will have write permissions to the folder.
if you want full system read/write access to your RH box, just use ssh/scp
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
marx2k
192.168.1.1/24 does not mean 192.168.1.1 - 192.168.1.255
It means 192.168.1.1 - 192.168.1.24
You would want 192.168.1.1/255 for that effect
No it doesn't. The x.x.x.x/y notation is CIDR notation.
192.168.1.1/24 means the IP address of 192.168.1.1 with a CIDR of /24, or class 1 C network, and netmask of 255.255.255.000. This effective means a range from 192.168.1.0 to 192.168.1.255, 256 hosts.
The /255 does not exist. The highest you can get is /32 which is a netmask of 255.255.255.255 or a single IP address.
To better understand: the network mask (netmask) or subnet mask is a number that identifies the part of the IP that is a network address and the part that is a computer address. Think of it in binary as the netmask uses binary 1 values to represent the network portion of an address and binary 0 values to represent the computer address.
The network part is expressed in base 10 (our regular numbering system) and are either values of 0 or 255.
255 is a network byte
0 is a computer byte
other value will be part network, part computer.
The netmask can also be expressed as a single number representing the number of network bits in the address. This is the CIDR slash notation.
E.g. 169.254.5.40/16 is equivalent to 169.254.5.40 with a netmask of 255.255.0.0.
The /16 shows the network portion to be two 8-bit bytes, or 16 bits (8x2). As such there will be 65536 hosts.
The CIDR number comes from the number of 1's in the subnet mask when converted to binary.
The common subnet mask 255.255.255.0 is 11111111.11111111.11111111.00000000 in binary. This adds up to 24 1's, or /24 (pronounced 'slash twenty four').
A subnet mask of 255.255.255.192 is 11111111.11111111.11111111.11000000 in binary, or 26 1's, hence a /26.
sorry neilp85 didn't see your post
-
Re: HOWTO: NFS Server/Client
dmizer--
Thanks for being so helpful.
On the redhat server, most of the directories within /vol22 are set to 766 permissions. The /etc/fstab in Ubuntu is
Code:
samba1:/vol22 /sam/vol22 nfs rw,hard,intr 0 0
and this shows up as this on the Ubuntu client when mounted as cifs:
Code:
[root@samba1 vol22]# ls -alh
total 816K
drwxrw-rw- 14 data data 4.0K Nov 6 19:03 .
drwxr-xr-x 28 root root 4.0K Oct 4 11:20 ..
drwxrw-rw- 8 data data 4.0K Jul 16 21:50 comm
drwxrw-rw- 136 data data 8.0K Nov 2 13:35 data
(I have edited out some entries to save space here.)
When mounted as nfs, it reports:
Code:
doug@doug2:~$ ls -alh /sam/vol22
total 0
?--------- ? ? ? ? ? /sam/vol22/.
?--------- ? ? ? ? ? /sam/vol22/..
?--------- ? ? ? ? ? /sam/vol22/comm
?--------- ? ? ? ? ? /sam/vol22/data
redhat's file structure is generally plain vanilla linux, so /vol22 is a directory just off /, same as /etc or /usr would be.
I wonder if ssh/scp will work since what I am doing is running OOo against these network files?
In any event, I think the redhat box is set up OK. At least it runs OK for accessing these files and directories using a cifs mount.
So what else might I be missing here?
I see you have both a samba and nfs howto, so it sounds like you are the person I need to be talking to!
Thanks for your help.
:- Doug.
-
Re: HOWTO: NFS Server/Client
lol ... i also have a fedora core box, but i haven't looked at redhat in so long, i don't know what they're doing over there.
how did you figure out how to configure your redhat box? if you used this howto to set up both boxes, it's not going to work. something's missing on the authentication for fedoracore that i haven't had the time to figure out yet.
but ... this looks promising: http://forums.fedoraforum.org/showthread.php?t=102621
-
Re: HOWTO: NFS Server/Client
dmizer--
Thanks for your help. Sorry you had to wait for a reply--I was more than a little busy over the weekend and the last two days.
How did I figure out how to set it up? I don't remember. Probably used Webmin originally. Then this spring I tried to set up some other things like yp and almost lost all connectivity. I think I got most of that stuff cleared out. But who knows?
I suppose I could blow away the OS on the redhat box and reinstall it, but after all this time, I am not sure what is on there and what I would have to reinstall. Since it is my primary server, I am more than a little reluctant to even think about that!
I will take a look at the link you have so graciously provided--when I am a little more clear headed. Today has been a day to make me bleary-eyed!
Thanks, dmizer!
-
Re: HOWTO: NFS Server/Client
Thanks for your help!
I just succeeded in creating a general Audio folder on my server, so I have all my music available to every PC.
I am just wondering: Is there anyway to secure the acces? Like: Requiring a password and username or similar.
I would like to be able to acces my files at my parents house or on the university, but not share them with the public.
-
Re: HOWTO: NFS Server/Client
How lovely....
My complete music collection just got vanished....
I shared the same directory with two entries in exports and the contents of that directory are gone since I mounted it from the other PC.
Is that normal ? ](*,)
Yech, going to find my backup
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
Peturrr
How lovely....
My complete music collection just got vanished....
I shared the same directory with two entries in exports and the contents of that directory are gone since I mounted it from the other PC.
Is that normal ? ](*,)
Yech, going to find my backup
um ... why would you have two entries in exports for the same direcotry? this may be why you had a problem.
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
penguinfan
Help a Noob out. I get this error
wayne@asus:~$ sudo mount 192.168.0.2:/home/winninshare /home/winninshare
mount: 192.168.0.2:/home/winninshare failed, reason given by server: Permission denied
I did exactly as you said.I have 2 computers with static IPs with the following in my other computer's exports file
/home/winninshare 192.168.1.1/24(rw,no_root_squash,async)
Sooo, i should be able to mount the winninshare folder on my computer in /home/winninshare? or am i mistaken.
Hey, I don't know if you have gotten this worked out or not, but I'll help you anyway. the problem is that in the instructions typed up, his network uses 192.168.1.*** for the local ip addresses, while yours uses 192.168.0.***. if you change exports file to
Code:
/home/winninshare 192.168.0.1/24(rw,no_root_squash,async)
it should work out for you.
-
Re: HOWTO: NFS Server/Client
Thanks, malco2001! Great how-to. I haven't rebooted yet to test fstab, but it appears that (after a manual mount command) I'm connecting perfectly to my FreeNAS NFS share.
-
Re: HOWTO: NFS Server/Client
Thank You! Great HowTo! I just setup my server (dapper) and my son's client (edgy) in like 15 minutes from start to finish. Great Job!
-
Re: HOWTO: NFS Server/Client
Hi--
Just tried this and got this error message:
Quote:
mike@earth:~$ sudo dpkg-reconfigure portmap
* Stopping portmap daemon... [ ok ]
* Starting portmap daemon... [ ok ]
* Restoring old RPC service information... [ ok ]
There are RPC services which registered with the portmapper
before the configuration was changed.
You need to manually restart them in order for the changes to take effect.
Current registered services:
------------------------------------------------
100024 1 udp 951 status
100024 1 tcp 954 status
------------------------------------------------
What does this want me to do? Will a reboot fix it?
Thanks!
-
[solved] HOWTO: NFS Server/Client
Hi--
OK, got the rest of things set up on the server (earth), then I went to the client (doug2) and followed the steps. When I sudo mount -a, I get:
Code:
doug@doug2:~$ sudo mount -a
mount: earth:/export failed, reason given by server: Permission denied
I have checked the Firestarter firewall and it shows no events and is set to allow localnet/24. Even stopping the firewall makes no difference, so I suspect that is not the problem.
/etc/exports on the server is:
Code:
/exports 192.168.0.1/24(rw,no_root_squash,async)
and the directory /exports has permissions set at 777:
Code:
drwxrwxrwx 2 doug data 4.0K 2006-12-09 15:30 exports
What am I missing?
Thanks!
[edited 20061210:] Found my answer--I had the wrong mount point on the client, and also was pointing to the wrong directory on the server.
-
files don't lock between nfs and samba
OK, got the nfs mounts to work, but now a major problem: one of the clients on the system is running winxp pro. When this client has a file open, a linux client can also open, edit and save this file. And vice versa. Thus, data corruption is likely.
Is there some way to get nfs and samba to respect each other's file locks?
I am accessing, creating and editing files in OpenOffice.org.
-
Re: HOWTO: NFS Server/Client
Unfortunately with SAMBA *and* with NFS, Im getting a max of 1.5M/sec between two machines.
The Wireless 54Mbps Wireless G Server:
Code:
ath0 Link encap:Ethernet HWaddr 00:11:50:D4:FD:E8
inet addr:192.168.11.8 Bcast:192.168.11.255 Mask:255.255.255.0
inet6 addr: fe80::211:50ff:fed4:fde8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:351318 errors:0 dropped:0 overruns:0 frame:0
TX packets:561541 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:31326648 (29.8 MiB) TX bytes:810895988 (773.3 MiB)
ath0 IEEE 802.11g ESSID:"000740B6F60A"
Mode:Managed Frequency:2.412 GHz Access Point: 00:07:40:C4:3B:5E
Bit Rate:48 Mb/s Tx-Power:9 dBm Sensitivity=0/3
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality=37/94 Signal level=-58 dBm Noise level=-95 dBm
Rx invalid nwid:2 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
The 100Mbps wired client:
Code:
eth1 Link encap:Ethernet HWaddr 00:40:CA:70:19:A6
inet addr:192.168.11.4 Bcast:192.168.11.255 Mask:255.255.255.0
inet6 addr: fe80::240:caff:fe70:19a6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5977834 errors:0 dropped:0 overruns:1 frame:0
TX packets:5838991 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1102672825 (1.0 GiB) TX bytes:4034251400 (3.7 GiB)
Interrupt:201 Base address:0x2000
The router 'tween the two is a Buffalo Airstation WBR-G54.
What steps should I take to troubleshoot this problem?
-
Re: HOWTO: NFS Server/Client
:-D Bless you, for this simple HOWTO !!!
Files transfer faster than samba too !!!
Regards,
Ramesh
-
Re: HOWTO: NFS Server/Client
Nice How-to
This thread has been added to the UDSF wiki (thank you Crane)
NFS_Easy_Way
-
Re: HOWTO: NFS Server/Client
Hi all,
Getting a bit lost at this point......
"Mounting manually
Example to mount server.mydomain.com:/files to /files. In this example server.mydomain.com is the name of the server containing the nfs share, and files is the name of the share on the nfs server
The mount point /files must first exist on the client machine.
cd /
sudo mkdir files
to mount the share from a terminal type
sudo mount server.mydomain.com:/files /files"
All i want to do is store my music files on my desktop and be able to access them from various laptops around the house over my network.
How do i know what "mydomain" is called and is it .com? Do i have one?
the files i want to access would be home/styvens/music
I will want this share to be available from boot up on any other computer in the house
Sorry if i appear a bit thick here......
Steve
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
styven
Hi all,
Getting a bit lost at this point......
"Mounting manually
Example to mount server.mydomain.com:/files to /files. In this example server.mydomain.com is the name of the server containing the nfs share, and files is the name of the share on the nfs server
The mount point /files must first exist on the client machine.
cd /
sudo mkdir files
to mount the share from a terminal type
sudo mount server.mydomain.com:/files /files"
All i want to do is store my music files on my desktop and be able to access them from various laptops around the house over my network.
How do i know what "mydomain" is called and is it .com? Do i have one?
the files i want to access would be home/styvens/music
I will want this share to be available from boot up on any other computer in the house
Sorry if i appear a bit thick here......
Steve
The server.mydomain.com can just be the ip address of your desktop in your LAN, so you could just use:
Code:
sudo mount 192.168.1.10:/remotefolder /mountpoint
for example
Or if you add an entry to your /etc/hosts with that ip and assign a name to it:
Code:
192.168.1.10 desktop
so you could mount it with
Code:
sudo mount desktop:/remotefolder /mountpoint
Of course you should use a static ip and not dhcp for all this to work.
-
Re: HOWTO: NFS Server/Client
Thanks for that,
So i need to find the ip of my desktop and set it to static, which is at the moment set up as dhcp.
Just so i can be pointed in the right direction, my network setup is as follows.
cable setop box (modem) to 4 way router, internet split from router to various laptops etc.
Do i need to do anything different, I was really looking to set up a home server, is this in effect what will happen if i want to access files form the desktop?
Steve
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
styven
Thanks for that,
So i need to find the ip of my desktop and set it to static, which is at the moment set up as dhcp.
Just so i can be pointed in the right direction, my network setup is as follows.
cable setop box (modem) to 4 way router, internet split from router to various laptops etc.
Do i need to do anything different, I was really looking to set up a home server, is this in effect what will happen if i want to access files form the desktop?
Steve
Just assign static ips to all the pcs you want to have access to and you'll be fine.
-
1 Attachment(s)
Re: HOWTO: NFS Server/Client
Thanks for input so far, still struggling.
I have tried this out on 2 laptops at the moment, 1 being server, 1 being client.
On the client i can't see the shared folder, and also i can't see a folder i have set up to be shared from the client on the 1st laptop.
Please see screenshot of the 1st laptop(server) settings, what am i not doing right?
Steve
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
styven
Thanks for input so far, still struggling.
I have tried this out on 2 laptops at the moment, 1 being server, 1 being client.
On the client i can't see the shared folder, and also i can't see a folder i have set up to be shared from the client on the 1st laptop.
Please see screenshot of the 1st laptop(server) settings, what am i not doing right?
Steve
What is your 2nd laptop's (client) ip? Are you restarting nfs with:
Code:
sudo /etc/init.d/nfs-kernel-server restart
sudo exportfs -a
after you make the changes?
Can you ping the server from the client and the other way around?
-
Re: HOWTO: NFS Server/Client
the clients ip is 192.168.1.3
how do i ping?
thanks for your help so far
steve
-
1 Attachment(s)
Re: HOWTO: NFS Server/Client
in a moment of inspiration i typed ping ina terminal, thisis the output for laptop 192.168.1.3
steve
-
Re: HOWTO: NFS Server/Client
I don't seem to be getting any further so can anyone confirm that my etc/exports entry is correct...
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync) hostname2(ro,sync)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt)
# /srv/nfs4/homes gss/krb5i(rw,sync)
#
/home/styven 192.168.1.1/24(rw,no_root_squash,async)
I can ping between both computers
If i go into places/network servers on the client all i can see is Windows Network
NFS is running on the server machine
portmap and nfs-common is running on the client machine
I have run sudo exportfs -a after changes to etc/exports
If i try to mount the server from the client i get the following..............
honeyh@honey:~$ sudo /etc/init.d/portmap restart
* Stopping portmap daemon... [ ok ]
* Starting portmap daemon... [ ok ]
honeyh@honey:~$ sudo /etc/init.d/nfs-common restart
* Stopping NFS common utilities [ ok ]
* Starting NFS common utilities [ ok ]
honeyh@honey:~$ sudo mount 192.168.1.2:/home/styven
mount: can't find 192.168.1.2:/home/styven in /etc/fstab or /etc/mtab
honeyh@honey:~$
Shared Folders shows /home/styven available on 192.168.1.1/24
Any further help would be appreciated, i feel i am close.
Steve
-
Re: HOWTO: NFS Server/Client
Hi all,
Still no further:(
I think that maybe my problems are at the client, i do not understand the part about creating a mount point on the client.
I followed the instruction to sudo mkdir files and now have a file in home of the client called styven that i can't do anything with as it's owned by root
Ultimately i want the shared folder from the server to mounted at boot, but can't at the moment mount it manually...........
please help as this is doing my head in](*,)
Steve
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
styven
I don't seem to be getting any further so can anyone confirm that my etc/exports entry is correct...
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync) hostname2(ro,sync)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt)
# /srv/nfs4/homes gss/krb5i(rw,sync)
#
/home/styven 192.168.1.1/24(rw,no_root_squash,async)
I can ping between both computers
If i go into places/network servers on the client all i can see is Windows Network
NFS is running on the server machine
portmap and nfs-common is running on the client machine
I have run sudo exportfs -a after changes to etc/exports
If i try to mount the server from the client i get the following..............
honeyh@honey:~$ sudo /etc/init.d/portmap restart
* Stopping portmap daemon... [ ok ]
* Starting portmap daemon... [ ok ]
honeyh@honey:~$ sudo /etc/init.d/nfs-common restart
* Stopping NFS common utilities [ ok ]
* Starting NFS common utilities [ ok ]
honeyh@honey:~$ sudo mount 192.168.1.2:/home/styven
mount: can't find 192.168.1.2:/home/styven in /etc/fstab or /etc/mtab
honeyh@honey:~$
Shared Folders shows /home/styven available on 192.168.1.1/24
Any further help would be appreciated, i feel i am close.
Steve
You have to create your mountpoint. You can do than with
Code:
sudo mkdir /media/serverhome
change serverhome with whatever you like
Then open your fstab file with
Code:
sudo gedit /etc/fstab
and insert a line at the end like this:
Code:
192.168.1.2:/home/styven /media/serverhome nfs rsize=8192,wsize=8192,timeo=14,intr,noauto
careful, because you should also have an empty line at the end of your fstab by using the enter key.
You should then be able to mount the share with
Code:
sudo mount /media/serverhome
-
Re: HOWTO: NFS Server/Client
Well i think i have moved forward, although to get here i had to edit etc/host.allow which was not mentioned as far as i could see in this thread. In it i had to put the line.......
portmap : NFS server 192.168.1.2
So this i did and then tried again.........................
honeyh@honey:~$ sudo /etc/init.d/nfs-common restart
Password:
* Stopping NFS common utilities [ ok ]
* Starting NFS common utilities [ ok ]
honeyh@honey:~$ sudo /etc/init.d/portmap restart
* Stopping portmap daemon... [ ok ]
* Starting portmap daemon... [ ok ]
honeyh@honey:~$ sudo gedit /etc/host.deny:
honeyh@honey:~$ sudo gedit /etc/host.allow:
honeyh@honey:~$ sudo mount 192.168.1.2:styven/Music /home/honeyh/Music
mount to NFS server '192.168.1.2' failed: server is down.
honeyh@honey:~$ sudo mount 192.168.1.2:styven/Music /home/honeyh/styven/Music
Password:
mount to NFS server '192.168.1.2' failed: server is down.
honeyh@honey:~$ sudo mount 192.168.1.2:styven/Music /home/honeyh/styven/Music
Password:
mount: 192.168.1.2:styven/Music failed, reason given by server: Permission denied
honeyh@honey:~$ sudo gedit /etc/host.allow:
honeyh@honey:~$ sudo mount 192.168.1.2:home/styven/Music /home/honeyh/styven/Music
mount: 192.168.1.2:home/styven/Music failed, reason given by server: Permission denied
honeyh@honey:~$
What i don't know at this stage is who is denying permission?
steve
-
Re: HOWTO: NFS Server/Client
That should be:
sudo mount 192.168.1.2:/home/styven/Music /home/honeyh/styven/Music
Did you forget the slash over there?
Also are you exporting /home/styven/Music exlcusively on 192.168.1.2 or is it /home/styven? I don't think you can mount other directories than the ones you specify in exports.
I never messed with hosts.allow myself...
-
NFS OS X problems
I am trying to setup my Ubuntu box (6.10) to serve up files to my mac (X.4.8 ). On the Ubuntu side everything looks good when I look at the sharing window (correct folder, setup to share 1/24 etc.) on the mac side I followed these directions however my Ubuntu box id is 1000. So I changed everything to 1000 instead of 500. When I exportfs -a it says that my mac (named Mr Darcy (I nanoed it as Mr-Darcy)) has non-inet addr. I sadly don't have a clue as to what that means.
The result is that I cannot see the Ubuntu box when I browse through the network or even when I use the connect to server option on the mac side.
Any advice would be appreciated.
Michael
-
Re: HOWTO: NFS Server/Client
Hello!
How can I browse the nfs share folder with gnome? I installed a nfs server and client on another computer and I can mount the export manually. But When I click on "Places->Network Servers" I can only see the "Windows network" and not the "Linux network" as said in the documentation...
gnomevfs2 and nfs-client are installed
Thanks for any help!
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
lyly
Hello!
How can I browse the nfs share folder with gnome? I installed a nfs server and client on another computer and I can mount the export manually. But When I click on "Places->Network Servers" I can only see the "Windows network" and not the "Linux network" as said in the documentation...
gnomevfs2 and nfs-client are installed
Thanks for any help!
The shared folder will be mounted as a local folder on each of the client machines depending on the mount point you selected for each. You'd just open whatever file manager you have and go to that local path (not a network path) since NFS treats each share as a local path.
Thanks for posting this great How-To. I got my sharing working perfectly from my main box to my wireless laptop. It perfectly mounts the shared folders when I bootup within the range of my Wireless LAN (ie. my house). NFS seems like a much more elegant Unix solution than samba, ick Windows networking.
-
Re: HOWTO: NFS Server/Client
Actually my question was about how to discover the nfs share which are not yet mounted but are shared on the network.
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
lyly
Actually my question was about how to discover the nfs share which are not yet mounted but are shared on the network.
that's a very good question actually. nfs equivalent to "smbtree", or a gui ... there's something for xubuntu which can perform that function, but a quick search in synaptic didn't reveal an obvious answer for gnome.
-
Re: HOWTO: NFS Server/Client
[QUOTE=malco2001;1456895]Why NFS?
You provided really valuable notes on setting the NFS server.I did what you said, but at last when i attempt to mount the mount point i got an error.The error is:
Unsupported mount option: wsize-8192
what should i do?
-
Re: HOWTO: NFS Server/Client
Somewhat confused but would like to know how to verify the name of "mydomain.com" and the name of the share
Thanks
-
Re: HOWTO: NFS Server/Client
followed every instruction, changed ips and paths to suit my setup and checked them. made sure every location was permissioned to 777 and i still get
Quote:
root@LINUX2:~# mount -a
mount: 192.168.1.1:/_matt failed, reason given by server: Permission denied
fstab is
Quote:
192.168.1.1:/_matt /home/matt/nfs nfs rsize=8192,wsize=8192,timeo=14,intr
and servers exports is
Quote:
/data/storage/SHARE/_matt 192.168.1.1/24(rw,no_root_squash,async)
i am getting really frustrated now, i had samba working until yesterday when i got an update, now the transfer speeds are unusable. i am trying to use nfs for the better speed however i still am keeping samba for windows, where they are also slow acessing the samba shares.
the only other options i think is ftp or ssh, but i dont think this is well suited for transferring large files across a network and mounting like nfs and samba are supposed to.
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
mike3k
If you're connection to a Linux NFS server from Mac OS X, you need to specify 'insecure' in your exports and map the user IDs since Macs use uid 501 for the first regular user. For my /etc/exports I use:
/home 192.168.0.0/255.255.255.0(rw,async,insecure,all_squash,anonuid =1000,anongid=1000)
I hate digging up old threads, but I think that my tip is quite useful for people who'll be googling in the future and stumble on this thread.
I recommend using NFS Manager. It's a very small app which handles NFS configurations on OS X. And it can also enable communication via the secure port. I don't know how I'd live without it. Get it here: http://www.bresink.com/osx/NFSManager.html
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
paulius
I hate digging up old threads, but I think that my tip is quite useful for people who'll be googling in the future and stumble on this thread.
I recommend using NFS Manager. It's a very small app which handles NFS configurations on OS X. And it can also enable communication via the secure port. I don't know how I'd live without it. Get it here:
http://www.bresink.com/osx/NFSManager.html
well are you saying that this works for ubuntu? I thought mac os x used a different filesystem than linux? can you comment on this?
-
Re: HOWTO: NFS Server/Client
Guys,
Great howto and great discussion string. I did as told and I have an NFS server with 3 clients able to nfs into the server - one wired desktop and two wireless laptops.
I have a question: what is the optimal setting for wireless 802.11g networking with sometimes huge files tranfer (3 -7 GB of DVD image)? This howto uses rsize=8192,wsize=8192,timeo=14,intr
Does anyone have better setting for 802.11g networking for this big file tranfer? Or a pointer for a more sensibe documentation for nfs client?
My problem is that copying a DVD image, say 5 GB, would always stop somewhere, resume itself, and sometimes stop completely. I did not time the tranfer speed, but it seems much slower than that ftp tranfer, when it works.
Thanks. All my machines are 6.10. Server is on Core Duo, desktop is P4 2.6 and Centrino for laptops.
Vincent
-
Re: HOWTO: NFS Server/Client
Thanks malco2001 for the guide.
However, I still got a problem when tried to mount the shared folder. I will explain my network setup below:
Host: Client:
Global IP Internal IP connected through router with Global IP
I have followed the setup as shown by malco2001. edited /etc/hosts as below
/home/myhome/shared *(rw,async)
then:
sudo /etc/init.d/nfs-kernel-server restart
* Stopping NFS kernel daemon [ ok ]
* Unexporting directories for NFS kernel daemon... [ ok ]
* Exporting directories for NFS kernel daemon... [ ok ]
* Starting NFS kernel daemon [ ok ]
sudo exportfs -a
now at the client,
mkdir sharefolder
sudo mount host:/home/myhome/shared ~/sharefolder
but this comes out
mount: host:/home/myhome/shared failed, reason given by server: Permission denied
when i run: showmount -e host
Export list for host:
/home/myhome/shared *
Ok the reason I used * instead of IP or client host name because I got error when using it in /etc/exports. Is there any other way to mount it? I have changed the permission of the shared folder using chmod 777. Could anyone help to point out my mistake??
Thanks ..
-
Re: HOWTO: NFS Server/Client
you can't use a * to define which computers can connect to the share, at least I don't think so. here is a guide with more specific details and a little more explaination, it's for gentoo but applies. http://gentoo-wiki.com/HOWTO_Share_D...Modify_EXPORTS
also, do you have any rules for iptables? you can find out by typing in a terminal
sudo iptables -L
if this returns anything, than it's poossible that your nfs seerver isn't allowing any connections to it. again the gentoo guide will help. I am sure if you follow the guide you'll be a-ok!
or you could read post 39 of this thread as a guy had the exact same issue and solved it due to him calling the wrong mount points out in botht the client and the server. to make sure it's not the tilde (~), make sure you use full directory locations, /home/username/ instead.
-
Re: HOWTO: NFS Server/Client
Hey guys, I'm having a problem accessing my NFS share from my client pc. The server is a debian(sarge) and the client is a kubuntu(edgy).
I can successfully mount my exported share on the client, and see the following message in the server's syslog:
Code:
rpc.mountd: authenticated mount request from 192.168.1.101:1002 for /multimedia/music (/multimedia/music)
So I thought I was made. Unfortunately, when I tried to cd into this mounted directory on the client, I got the following:
Code:
al@griff:~$ cd /multimedia/music
bash: cd: /multimedia/music: Permission denied
Even if i try as root:
Code:
al@griff:~$ sudo bash
Password:
root@griff:~# cd /multimedia/music
bash: cd: /multimedia/music: Permission denied
root@griff:~#
If i try and check the permissions for files in that directory, I get the following:
Code:
root@griff:/multimedia# ls -alh /multimedia/music
total 0
?--------- ? ? ? ? ? /multimedia/music/.
?--------- ? ? ? ? ? /multimedia/music/..
?--------- ? ? ? ? ? /multimedia/music/7Music
?--------- ? ? ? ? ? /multimedia/music/allmusicrandom.m3u
?--------- ? ? ? ? ? /multimedia/music/allmusicrandom.wsx
?--------- ? ? ? ? ? /multimedia/music/Chillout
?--------- ? ? ? ? ? /multimedia/music/chillout.m3u
?--------- ? ? ? ? ? /multimedia/music/Comedy
?--------- ? ? ? ? ? /multimedia/music/Desktop.ini
?--------- ? ? ? ? ? /multimedia/music/lost+found
?--------- ? ? ? ? ? /multimedia/music/Misc Rock (Unsorted)
?--------- ? ? ? ? ? /multimedia/music/Music
?--------- ? ? ? ? ? /multimedia/music/New
?--------- ? ? ? ? ? /multimedia/music/NVIDIA-Linux-x86-1.0-8774-pkg1.run
?--------- ? ? ? ? ? /multimedia/music/Old School
?--------- ? ? ? ? ? /multimedia/music/Rap (Unsorted)
?--------- ? ? ? ? ? /multimedia/music/Ripped By WMP
?--------- ? ? ? ? ? /multimedia/music/Techno
?--------- ? ? ? ? ? /multimedia/music/Thumbs.db
?--------- ? ? ? ? ? /multimedia/music/Various
?--------- ? ? ? ? ? /multimedia/music/Wierd.Random
So it appears it can kind of see whats going on, but something weird is blocking normal access. I've tried chmodding and chowning on both the client and the server to no avail. Can anybody help?
-
Re: HOWTO: NFS Server/Client
Quote:
Originally Posted by
MobiusNZ
Hey guys, I'm having a problem accessing my NFS share from my client pc. The server is a debian(sarge) and the client is a kubuntu(edgy).
I can successfully mount my exported share on the client, and see the following message in the server's syslog:
Code:
rpc.mountd: authenticated mount request from 192.168.1.101:1002 for /multimedia/music (/multimedia/music)
So I thought I was made. Unfortunately, when I tried to cd into this mounted directory on the client, I got the following:
Code:
al@griff:~$ cd /multimedia/music
bash: cd: /multimedia/music: Permission denied
Even if i try as root:
Code:
al@griff:~$ sudo bash
Password:
root@griff:~# cd /multimedia/music
bash: cd: /multimedia/music: Permission denied
root@griff:~#
If i try and check the permissions for files in that directory, I get the following:
Code:
root@griff:/multimedia# ls -alh /multimedia/music
total 0
?--------- ? ? ? ? ? /multimedia/music/.
?--------- ? ? ? ? ? /multimedia/music/..
?--------- ? ? ? ? ? /multimedia/music/7Music
?--------- ? ? ? ? ? /multimedia/music/allmusicrandom.m3u
?--------- ? ? ? ? ? /multimedia/music/allmusicrandom.wsx
?--------- ? ? ? ? ? /multimedia/music/Chillout
?--------- ? ? ? ? ? /multimedia/music/chillout.m3u
?--------- ? ? ? ? ? /multimedia/music/Comedy
?--------- ? ? ? ? ? /multimedia/music/Desktop.ini
?--------- ? ? ? ? ? /multimedia/music/lost+found
?--------- ? ? ? ? ? /multimedia/music/Misc Rock (Unsorted)
?--------- ? ? ? ? ? /multimedia/music/Music
?--------- ? ? ? ? ? /multimedia/music/New
?--------- ? ? ? ? ? /multimedia/music/NVIDIA-Linux-x86-1.0-8774-pkg1.run
?--------- ? ? ? ? ? /multimedia/music/Old School
?--------- ? ? ? ? ? /multimedia/music/Rap (Unsorted)
?--------- ? ? ? ? ? /multimedia/music/Ripped By WMP
?--------- ? ? ? ? ? /multimedia/music/Techno
?--------- ? ? ? ? ? /multimedia/music/Thumbs.db
?--------- ? ? ? ? ? /multimedia/music/Various
?--------- ? ? ? ? ? /multimedia/music/Wierd.Random
So it appears it can kind of see whats going on, but something weird is blocking normal access. I've tried chmodding and chowning on both the client and the server to no avail. Can anybody help?
this guide has a lot of troubleshooting tips under the hints section. this should get you squared away:
http://gentoo-wiki.com/HOWTO_Share_D...s_via_NFS#Hint
good luck
-
Re: HOWTO: NFS Server/Client
OK I got onto the right track when I discovered that normal users on the server couldn't even browse through these (local) directories - I had been setting everything up so was using root.
I couldn't figure out why a normal user couldn't read the directory when it was chmodded as 766. On a whim, I tried changing it to 777. Presto! It worked!
It seems strange that I'd never found any documentation saying that you needed execute permissions to be able to cd to a directory - this sort of stuff is invaluable.
Thanks to everyone for their help.
-
Re: HOWTO: NFS Server/Client
Thanks for the guide! I have used it and got it working ONE WAY (using my laptop as server and my desktop as client). Both are running kubuntu edgy. If I try to mount a directory on the desktop from the laptop however (using "sudo mount DESKTOP:/home /xyz") nothing happens.
In the syslog of the DESKTOP I find entries like
Mar 13 22:54:52 DESKTOP kernel: [17189943.736000] Inbound IN=eth1 OUT= MAC=00:00:21:f1:f1:73:00:18:de:d5:4c:7f:08:00 SRC=192.168.1.102 DST=192.168.1.101 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=16403 DF PROTO=TCP SPT=40792 D
PT=111 WINDOW=5840 RES=0x00 SYN URGP=0
What does this mean? Does it point to some setup problem?
-
Re: HOWTO: NFS Server/Client
Have you enabled the NFS file system support? Kubuntu doesn't by default. The easiest way is to install the server software.
Code:
sudo apt-get install nfs-common nfs-kernel-server
-
Re: HOWTO: NFS Server/Client
I have... and it works in one way, so I am pretty sure I did it correctly. I think it must be a security setting somewhere... meanwhile, I have tried to access my web server or used telnet or ftp (just to try) and I got similar messages in syslog. (just the portnumber changed from PT=111 to PT=80, PT=21 or PT=23 depending on what I tried). I have emptied both hosts.deny and hosts.allow and restarted the portmapper afterwards... still the same.