PDA

View Full Version : HOWTO: NFS Server/Client



Pages : [1] 2 3

malco2001
September 3rd, 2006, 12:06 PM
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-linux-nfs-client-configuration-to-mount-nfs-share.html (for client configuration)
http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/custom-guide/s1-nfs-mount.html (for mounting using fstab)
<removed dead link>
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-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.

Jose Catre-Vandis
September 8th, 2006, 12:31 AM
Thanks, this howto made simple what the wiki howto makes look difficult. I can now dispense with the vagaries of samba :-)

InspirationDate
September 8th, 2006, 01:14 AM
Thanks for the howto. The only problem I ran into was with this line:


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

cgreulich
September 8th, 2006, 05:44 PM
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.

malco2001
September 11th, 2006, 05:22 AM
Originally Posted by malco2001
save this file and then in a terminal type
/etc/init.d/nfs-kernel-server restart

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. :)

quad3d@work
September 12th, 2006, 03:34 PM
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!

jabb
September 14th, 2006, 08:14 PM
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.

mike3k
September 14th, 2006, 08:58 PM
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)

p388l3s
September 16th, 2006, 01:25 AM
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

probablydrew
September 16th, 2006, 03:08 AM
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.

george_apan
September 18th, 2006, 06:08 PM
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:)

myname
September 21st, 2006, 06:19 PM
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?

george_apan
September 21st, 2006, 07:14 PM
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... :-&

iseebluuue
September 22nd, 2006, 02:50 AM
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!

penguinfan
September 24th, 2006, 05:50 PM
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.

K.Mandla
September 24th, 2006, 08:36 PM
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! ;)

etienne.navarro
October 18th, 2006, 12:12 AM
After editing the /etc/exports file run
sudo exportfs -a
then
sudo /etc/init.d/nfs-kernel-server restart

should work then

marx2k
October 31st, 2006, 05:31 AM
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?

marx2k
October 31st, 2006, 05:47 AM
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 :)

dmizer
October 31st, 2006, 01:06 PM
okay ... i'm completely confused.

i have a very small network. my server only leases 10 dhcp addresses.

how the heck does this:

192.168.1.1/24
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:

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.

someusernoob
October 31st, 2006, 04:57 PM
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.

dmizer
November 1st, 2006, 12:15 AM
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.

someusernoob
November 1st, 2006, 10:07 PM
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/showthread.php?p=1699752#post1699752

marx2k
November 2nd, 2006, 09:14 PM
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

neilp85
November 3rd, 2006, 07:54 AM
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.

dgermann
November 5th, 2006, 01:02 AM
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


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.

dmizer
November 8th, 2006, 10:45 AM
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

etienne.navarro
November 9th, 2006, 01:05 AM
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 (http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) 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

dgermann
November 9th, 2006, 02:08 AM
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

samba1:/vol22 /sam/vol22 nfs rw,hard,intr 0 0
and this shows up as this on the Ubuntu client when mounted as cifs:

[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:

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.

dmizer
November 10th, 2006, 01:48 PM
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

dgermann
November 15th, 2006, 03:44 AM
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!

Peturrr
November 15th, 2006, 02:50 PM
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.

Peturrr
November 15th, 2006, 06:20 PM
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

dmizer
November 17th, 2006, 02:12 AM
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.

hopstah
November 18th, 2006, 12:03 AM
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
/home/winninshare 192.168.0.1/24(rw,no_root_squash,async) it should work out for you.

unclben
November 19th, 2006, 08:47 PM
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.

RichJacot
November 28th, 2006, 04:09 AM
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!

dgermann
December 9th, 2006, 09:17 PM
Hi--

Just tried this and got this error message:


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!

dgermann
December 9th, 2006, 10:12 PM
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:


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:

/exports 192.168.0.1/24(rw,no_root_squash,async)
and the directory /exports has permissions set at 777:

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.

dgermann
December 11th, 2006, 12:45 AM
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.

marx2k
December 13th, 2006, 12:36 AM
Unfortunately with SAMBA *and* with NFS, Im getting a max of 1.5M/sec between two machines.

The Wireless 54Mbps Wireless G Server:


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:


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?

RameshRao
December 14th, 2006, 06:10 AM
:-D Bless you, for this simple HOWTO !!!

Files transfer faster than samba too !!!

Regards,
Ramesh

bodhi.zazen
December 15th, 2006, 10:27 PM
Nice How-to

This thread has been added to the UDSF wiki (thank you Crane)

NFS_Easy_Way (http://doc.gwos.org/index.php/NFS_Easy_Way)

styven
December 27th, 2006, 06:48 PM
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

george_apan
December 27th, 2006, 11:51 PM
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:

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:

192.168.1.10 desktop
so you could mount it with

sudo mount desktop:/remotefolder /mountpoint

Of course you should use a static ip and not dhcp for all this to work.

styven
December 28th, 2006, 01:10 PM
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

george_apan
December 28th, 2006, 02:33 PM
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.

styven
December 28th, 2006, 04:35 PM
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

george_apan
December 28th, 2006, 05:19 PM
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:

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?

styven
December 28th, 2006, 06:01 PM
the clients ip is 192.168.1.3
how do i ping?

thanks for your help so far
steve

styven
December 28th, 2006, 06:35 PM
in a moment of inspiration i typed ping ina terminal, thisis the output for laptop 192.168.1.3

steve

styven
December 28th, 2006, 08:35 PM
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

styven
December 29th, 2006, 01:47 PM
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

george_apan
December 29th, 2006, 02:10 PM
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

sudo mkdir /media/serverhome
change serverhome with whatever you like

Then open your fstab file with

sudo gedit /etc/fstab
and insert a line at the end like this:

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

sudo mount /media/serverhome

styven
December 29th, 2006, 03:26 PM
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

george_apan
December 29th, 2006, 10:22 PM
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...

weremichael
January 1st, 2007, 11:03 PM
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 (http://i1.dk/misc/automount_nfs_volumes_on_mac_osx/) 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

lyly
January 2nd, 2007, 01:06 PM
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!

mcpish
January 6th, 2007, 11:04 PM
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.

lyly
January 7th, 2007, 09:32 AM
Actually my question was about how to discover the nfs share which are not yet mounted but are shared on the network.

dmizer
January 7th, 2007, 05:06 PM
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.

kanna1620
January 13th, 2007, 10:21 AM
[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?

squrl
January 29th, 2007, 07:18 PM
Somewhat confused but would like to know how to verify the name of "mydomain.com" and the name of the share

Thanks

matt91
February 8th, 2007, 11:59 PM
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



root@LINUX2:~# mount -a
mount: 192.168.1.1:/_matt failed, reason given by server: Permission denied

fstab is

192.168.1.1:/_matt /home/matt/nfs nfs rsize=8192,wsize=8192,timeo=14,intr

and servers exports is

/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.

paulius
February 15th, 2007, 12:02 AM
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

dannyboy79
February 19th, 2007, 03:39 PM
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?

Vincent_Lin
March 2nd, 2007, 01:36 AM
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

tyusoff
March 9th, 2007, 09:12 AM
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 ..

dannyboy79
March 9th, 2007, 05:35 PM
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_Directories_via_NFS#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.

MobiusNZ
March 11th, 2007, 12:31 AM
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:


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:


al@griff:~$ cd /multimedia/music
bash: cd: /multimedia/music: Permission denied

Even if i try as root:


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:


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?

dannyboy79
March 12th, 2007, 01:52 PM
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:


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:


al@griff:~$ cd /multimedia/music
bash: cd: /multimedia/music: Permission denied

Even if i try as root:


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:


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_Directories_via_NFS#Hint

good luck

MobiusNZ
March 12th, 2007, 08:27 PM
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.

chartman
March 13th, 2007, 11:57 PM
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?

MobiusNZ
March 14th, 2007, 12:45 AM
Have you enabled the NFS file system support? Kubuntu doesn't by default. The easiest way is to install the server software.



sudo apt-get install nfs-common nfs-kernel-server

chartman
March 14th, 2007, 12:54 AM
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.

Mr. C.
March 14th, 2007, 07:56 AM
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.

The autofs automounter provides this. It mounts file systems upon reference. There is no need for any scripts.

See Week 4 "NFS / Automounter" notes and lab work at : http://cis68c2.mikecappella.com/calendar.php

MrC

flange
March 15th, 2007, 03:04 AM
The autofs automounter provides this. It mounts file systems upon reference. There is no need for any scripts.

See Week 4 "NFS / Automounter" notes and lab work at : http://cis68c2.mikecappella.com/calendar.php

MrC

Thanks for the link. I got autofs working with my NFS server with help from the PPT file on this site.

Mr. C.
March 15th, 2007, 04:40 AM
Great! I'm glad you found the materials useful.

Cheers,
MrC

joehill
March 20th, 2007, 05:26 AM
Excellent How-to. I have a suggestion for an addition (which one reader suggested above) that may save some clueless readers like myself hours of looking for a needle in a haystack. Users with edited /etc/hosts.allow and /etc/hosts.deny files may need to updated these files, either not to deny anyone (probably ok since it only listens locally) or, to be more secure, like this:

/etc/hosts.deny has to have this:
portmap: ALL

and /etc/hosts.allow has to have this:
portmap: 192.168.1. ALLOW

This blocks nfs to remote computers. I had originally had it set to deny but not to allow so I was getting this error:
mount: server:/home/joseph/files failed.
[with no explanation for why]

foxxx
March 25th, 2007, 04:06 PM
nice how-to, could someone make it sticky? :popcorn:

another edit:
second last line:
mount /files -> SUDO mount /files :)

could you try to distinguish between /files (mounting point/client-side) and /files (shared folder/server-side)?
so just in case a n00b like me doesn´t mix them up... :lolflag:

SonicSteve
April 6th, 2007, 05:10 AM
I'm hoping someone can help me with this.
I have 2 ubuntu computers both running Edgy.

I have an NFS share on PC called ubuntu, the share is called UbShr
The other computer is called Ubuntu-desktop (very original I know)

I need to have read and write access to the files and folders.

My FSTAB entry on ubuntu-desktop is this
192.168.0.107:/UbShr /mnt/UbuntuSh nfs rsize=8192,wsize=8192,timeo=14,intr
I followed this NFS how to


My exports entry is this (on ubuntu)
/media/maxtor/UbShr /192.168.0.1/24(rw.no_root_squash,async)
again I followed this same NFS how to guide.

I however get this error.
steve@Ubuntu-desktop:/mnt$ sudo mount -a
mount: 192.168.0.107:/UbShr failed, reason given by server: Permission denied


I know the IP of the computer is right (192.168.0.100) it's static on the router. Is it seeing the server but the server denies the mount. WHY?

I have restarted NFS kernel, exportfs -a and -r. I added lines in the hosts files of each computer.


I can ping the ip of the ubuntu pc but only by address not by name. By name gives me this;
ping: unknown host //ubuntu
Yes I need help.

Mr. C.
April 6th, 2007, 05:28 AM
There is a permissions problem with one of your exported directories:


ls -ld /media/maxtor/UbShr
ls -ld /media/maxtor
ls -ld /media

All exported files and directories under the export directory need to provide sufficient privs for the mounting user (eg. all directories need to be at least 555, and UbShr needs to be 777).

MrC

SonicSteve
April 6th, 2007, 12:29 PM
OK so I chmod'd the folders to 777, you were right the permissions weren't set right.
I then restarted the exportfs -a -r
I then restarted the NFS kernel

Now the bad news.
/media/maxtor/UbShr has been changed to 777
/media/maxtor has been changed to 777
I still have permission denied

Both computers are setup with the same user accounts and passwords (steve and *******)
Is there something samba's smbpasswd that needs to be done for NFS to work? Is there an NFS account that needs to be made?

The ip of ubuntu is 192.168.0.107
the ip of ubuntu-desktop is 192.168.0.100


I have something very strange happening on my ubuntu-desktop pc. Even though all entries the samba share have been commented out in the FSTAB file I have a persistent mount happening in
/mnt/UbSh
I don't know why it's mounting. I can reboot and it's still there. No entries in the FSTAB though. The folder is being shared both as SMB and NFS on the ubuntu pc does this matter? I noticed that the "shared folders" aplet doesn't seem to handle this very well.

dannyboy79
April 6th, 2007, 03:33 PM
when you first boot up, what does the command

mount

return, please paste the entire output. also, samba has nothing to do with NFS, they are 2 completely different protocols. also post

sudo cat /etc/fstab

sudo iptables -L

ls -la /media

and just because you see a folder called /mnt/UbSh doesn't mean that a samba network share is being mounted there. it just a folder on your computer. if there is stuff there, than that means that you put stuff there when the network share wasn't mounted so it's basically taking up room on the parititon that is mounted at /. unless of course you haev a seperate partition for /mnt but most don't. so make sure you post back everything I have asked and I can most likely help.

SonicSteve
April 6th, 2007, 06:53 PM
Quote;
and just because you see a folder called /mnt/UbSh doesn't mean that a samba network share is being mounted there. it just a folder on your computer. if there is stuff there, than that means that you put stuff there when the network share wasn't mounted so it's basically taking up room on the parititon that is mounted at /. unless of course you haev a seperate partition for /mnt but most don't. so make sure you post back everything I have asked and I can most likely help.

Unfortunately it is there. I stopped samba on the server and the files aren't there anymore. For some reason the share is being mounted without any reference in the FSTAB file. Yes I know it's strange but its true!
It may even have something to do with the access problem I'm experiencing. The trouble is I don't know.

SonicSteve
April 6th, 2007, 08:23 PM
OK,
So between Samba and NFS I tried using dmizer's unicode how to for samba shares and It worked.
The ghost mount of the share is gone and a proper RW share is established using samba.

I would really like to solve this NFS issue as well. It seems like it should be a good tool.

dannyboy79
April 6th, 2007, 08:50 PM
if you want my help than you need to provide what I asked for otherwise I can't help you troubleshoot if you don't give me any info..... post the output of everything i asked for as well as the following

sudo cat /etc/exports

ls -la /etc/init.d | grep nfs

ls /mnt/

SonicSteve
April 7th, 2007, 03:53 AM
Thanks for you willingness to help dannyboy79 I'll get to it tomorrow. I hope you're having a good Easter.

Jose Catre-Vandis
April 7th, 2007, 12:13 PM
I'm hoping someone can help me with this.
I have 2 ubuntu computers both running Edgy.

I have an NFS share on PC called ubuntu, the share is called UbShr
The other computer is called Ubuntu-desktop (very original I know)

I need to have read and write access to the files and folders.

My FSTAB entry on ubuntu-desktop is this
192.168.0.107:/UbShr /mnt/UbuntuSh nfs rsize=8192,wsize=8192,timeo=14,intr
I followed this NFS how to


My exports entry is this (on ubuntu)
/media/maxtor/UbShr /192.168.0.1/24(rw.no_root_squash,async)
again I followed this same NFS how to guide.

I however get this error.
steve@Ubuntu-desktop:/mnt$ sudo mount -a
mount: 192.168.0.107:/UbShr failed, reason given by server: Permission denied


I know the IP of the computer is right (192.168.0.100) it's static on the router. Is it seeing the server but the server denies the mount. WHY?

I have restarted NFS kernel, exportfs -a and -r. I added lines in the hosts files of each computer.


I can ping the ip of the ubuntu pc but only by address not by name. By name gives me this;
ping: unknown host //ubuntu
Yes I need help.

Try giving the full path to UbShr e.g.

#NFS Shares
192.168.0.107:/media/maxtor/Ubshr /mnt/UbuntuSh etc etc

SonicSteve
April 7th, 2007, 12:43 PM
Try giving the full path to UbShr e.g.

#NFS Shares
192.168.0.107:/media/maxtor/Ubshr /mnt/UbuntuSh etc etc

Alas,
sudo mount -a gives
mount: ubuntu:/media/maxtor/UbShr failed, reason given by server: Permission denied

I'll have to get working on the output of Dannyboy79's commands.

SonicSteve
April 7th, 2007, 01:21 PM
if you want my help than you need to provide what I asked for otherwise I can't help you troubleshoot if you don't give me any info..... post the output of everything i asked for as well as the following

sudo cat /etc/exports

ls -la /etc/init.d | grep nfs

ls /mnt/

OK so here goes,
steve@ubuntu:~$ sudo cat /etc/exports
Password:
# /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)
#

/media/maxtor/UbShr /192.168.0.1/24(rw,no_root_squash,async)



steve@ubuntu:~$ ls -la /etc/init.d | grep nfs
-rwxr-xr-x 1 root root 1087 2006-10-06 07:34 mountkernfs.sh
-rwxr-xr-x 1 root root 615 2006-10-06 07:34 mountnfs-bootclean.sh
-rwxr-xr-x 1 root root 6020 2006-08-31 14:38 nfs-common
-rwxr-xr-x 1 root root 3830 2006-08-31 14:38 nfs-kernel-server
-rwxr-xr-x 1 root root 1833 2006-10-06 07:34 umountnfs.sh
-rwxr-xr-x 1 root root 1939 2006-10-06 07:34 waitnfs.sh


ls /mnt/
Had absolutely no output

SonicSteve
April 7th, 2007, 01:24 PM
when you first boot up, what does the command

mount

return, please paste the entire output. also, samba has nothing to do with NFS, they are 2 completely different protocols. also post

sudo cat /etc/fstab

sudo iptables -L

ls -la /media

and just because you see a folder called /mnt/UbSh doesn't mean that a samba network share is being mounted there. it just a folder on your computer. if there is stuff there, than that means that you put stuff there when the network share wasn't mounted so it's basically taking up room on the parititon that is mounted at /. unless of course you haev a seperate partition for /mnt but most don't. so make sure you post back everything I have asked and I can most likely help.

steve@ubuntu:~$ sudo iptables -L
Password:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


steve@ubuntu:~$ ls -la /media
total 28
drwxr-xr-x 7 root root 4096 2007-03-13 21:19 .
drwxr-xr-x 21 root root 4096 2007-03-23 15:09 ..
lrwxrwxrwx 1 root root 6 2006-11-16 15:28 cdrom -> cdrom0
drwxr-xr-x 2 root root 4096 2006-11-16 15:28 cdrom0
drwxr-xr-x 2 root root 4096 2006-11-16 15:28 cdrom1
lrwxrwxrwx 1 root root 7 2006-11-16 15:28 floppy -> floppy0
drwxr-xr-x 2 root root 4096 2006-11-16 15:28 floppy0
drwxrwxrwx 6 steve steve 4096 2007-02-23 11:53 maxtor
drwxr-xr-x 2 root root 4096 2006-11-20 13:59 mp3


Edit;
I just realized that I assumed something.
You wanted these commands run on the server (I use that term loosely, it serves files but is not actually an Ubuntu server install)
I did run them on the server if you want info from the workstation let me know.

Jose Catre-Vandis
April 8th, 2007, 07:58 AM
Um, you have installed portmap and nfs-common on your client? (Just checking, i did it once too :-))

xpod
April 8th, 2007, 02:21 PM
Thanks for the guide:)

I came close to posting a cry for help there after getting some silly permissions error half the morning...and some of the afternoon but eventually realised i had a "192.168.1.2" in my exports file as apose to the "192.168.0.2"it should have been](*,)

NOW we can go to the funfair kids :twisted:
Happy easter ppl

indigoshift
April 9th, 2007, 07:06 AM
I'm having a similar problem to the dude with the melon on his head. ;)

I went about the shared folder setup a little differently, though. I just used the "Shared Folders" app (under System->Administration) on the machine doing the sharing, which is running 7.04.

My laptop (running 6.06) can't see the shared folder no matter what I do. Following the tuturial here isn't fixing the "Permission Denied" error, unfortunately.

On the bright side, remote desktop works like a champ. :D

dannyboy79
April 9th, 2007, 06:03 PM
I'm having a similar problem to the dude with the melon on his head. ;)

I went about the shared folder setup a little differently, though. I just used the "Shared Folders" app (under System->Administration) on the machine doing the sharing, which is running 7.04.

My laptop (running 6.06) can't see the shared folder no matter what I do. Following the tuturial here isn't fixing the "Permission Denied" error, unfortunately.

On the bright side, remote desktop works like a champ. :D

the shared folder is only for setting up folders to share thru samba. I don't think you can share the same folders thru samba and NFS but I don't know for sure. If you followed the guide you wouldn't have made those folders shared thru the shared folder gui. just follow the guide.

dannyboy79
April 9th, 2007, 06:09 PM
steve@ubuntu:~$ sudo iptables -L
Password:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


steve@ubuntu:~$ ls -la /media
total 28
drwxr-xr-x 7 root root 4096 2007-03-13 21:19 .
drwxr-xr-x 21 root root 4096 2007-03-23 15:09 ..
lrwxrwxrwx 1 root root 6 2006-11-16 15:28 cdrom -> cdrom0
drwxr-xr-x 2 root root 4096 2006-11-16 15:28 cdrom0
drwxr-xr-x 2 root root 4096 2006-11-16 15:28 cdrom1
lrwxrwxrwx 1 root root 7 2006-11-16 15:28 floppy -> floppy0
drwxr-xr-x 2 root root 4096 2006-11-16 15:28 floppy0
drwxrwxrwx 6 steve steve 4096 2007-02-23 11:53 maxtor
drwxr-xr-x 2 root root 4096 2006-11-20 13:59 mp3


Edit;
I just realized that I assumed something.
You wanted these commands run on the server (I use that term loosely, it serves files but is not actually an Ubuntu server install)
I did run them on the server if you want info from the workstation let me know.

I see other stuff relating to nfs within your /etc/init.d/ folder. DId you try to get automount to work with nfs? this could be the confussion. You can't share the same folder with automount and then do something manually with using your fstab file and nfs. I believe this is your issue I can't seem to find anything else. you already know you can't share the same folder with samba and nfs, at least not at the same time, you'll get premission denied because it's already mounted. and yes, I also need to
see some output from the workstation as that's the machine you're getting the access denided error on. I am betting that you have somethign in the workstation (client) that is already calling for this share. good luck

SonicSteve
April 9th, 2007, 07:05 PM
Um, you have installed portmap and nfs-common on your client? (Just checking, i did it once too :-))

Ya, I double checked portmap since I'm not very familiar with it. The're both installed.

indigoshift
April 10th, 2007, 12:45 AM
the shared folder is only for setting up folders to share thru samba. I don't think you can share the same folders thru samba and NFS but I don't know for sure. If you followed the guide you wouldn't have made those folders shared thru the shared folder gui. just follow the guide.

Gotcha. I'll give that a go. Thanks! :D

EDIT: Still not working. Giving the same "Permission Denied" error. :(

dannyboy79
April 10th, 2007, 07:21 PM
here's a link that helped out another guy who haad this same permission error.

http://forums.debian.net/viewtopic.php?t=577&view=next&sid=04e47105763a6e1ca97e50493081214c

]Nbx*cmD[
May 2nd, 2007, 04:34 PM
Hi all,

I followed this howto and didn't get it working, for some reason I really can't understand.

This is the message i get when trying to mount:



mount to NFS server '192.168.2.222' failed: server is down.


Obviously the server is not "down", as you can see in this ps -A | grep nfs output:



2781 ? 00:00:00 nfsd
2782 ? 00:00:00 nfsd
2783 ? 00:00:00 nfsd
2784 ? 00:00:00 nfsd
2785 ? 00:00:00 nfsd
2786 ? 00:00:00 nfsd
2787 ? 00:00:00 nfsd
2788 ? 00:00:00 nfsd


Let's see if somebody can help me a little :P

Here goes my exports file in the server:



/mnt/disc200/compartida 192.168.2.1/24(rw,no_root_squash,async)
/mnt/disc200/autocad 192.168.2.1/24(rw,no_root_squash,async)
/mnt/disc200/batxillerat 192.168.2.1/24(rw,no_root_squash,async)
/mnt/disc200/ESO 192.168.2.1/24(rw,no_root_squash,async)
/mnt/disc200/fotografia 192.168.2.1/24(rw,no_root_squash,async)
/mnt/disc200/primaria 192.168.2.1/24(rw,no_root_squash,async)
/mnt/Server/Documents 192.168.2.1/24(rw,no_root_squash,async)


And here goes the line in the fstab file of the client machine:



192.168.2.222:/mnt/disc200/compartida /media/compartida/ nfs rsize=8192,wsize=8192,timeo=14,intr


Thanks in advance!

dannyboy79
May 2nd, 2007, 04:49 PM
Nbx*cmD[;2579199']Hi all,

I followed this howto and didn't get it working, for some reason I really can't understand.

This is the message i get when trying to mount:



mount to NFS server '192.168.2.222' failed: server is down.


Obviously the server is not "down", as you can see in this ps -A | grep nfs output:



2781 ? 00:00:00 nfsd
2782 ? 00:00:00 nfsd
2783 ? 00:00:00 nfsd
2784 ? 00:00:00 nfsd
2785 ? 00:00:00 nfsd
2786 ? 00:00:00 nfsd
2787 ? 00:00:00 nfsd
2788 ? 00:00:00 nfsd


Let's see if somebody can help me a little :P

Here goes my exports file in the server:



/mnt/disc200/compartida 192.168.2.1/24(rw,no_root_squash,async)
/mnt/disc200/autocad 192.168.2.1/24(rw,no_root_squash,async)
/mnt/disc200/batxillerat 192.168.2.1/24(rw,no_root_squash,async)
/mnt/disc200/ESO 192.168.2.1/24(rw,no_root_squash,async)
/mnt/disc200/fotografia 192.168.2.1/24(rw,no_root_squash,async)
/mnt/disc200/primaria 192.168.2.1/24(rw,no_root_squash,async)
/mnt/Server/Documents 192.168.2.1/24(rw,no_root_squash,async)


And here goes the line in the fstab file of the client machine:



192.168.2.222:/mnt/disc200/compartida /media/compartida/ nfs rsize=8192,wsize=8192,timeo=14,intr


Thanks in advance!

on the client, do you have a mount point called /mnt/disc200/compartida? if not, there is your problem. and from the looks of your fstab, that's what's wrong. also, did you make sure you did

sudo exportfs -a

from the server cause it appears as though the server is not working. did you do

sudo apt-get install nfs-kernel-server nfs-common portmap

not to mention you have a trailing slash (/) on the end of your client's mount point (/media/compartida/ versus /media/compartida )

I would just suggest following the guide verbatim and then post back.

]Nbx*cmD[
May 3rd, 2007, 01:07 AM
I guess you mean if i have a mount point called /media/compartida, since the /mnt/disc200/compartida directory is on the server, that's why i added "/mnt/disc200/compartida 192.168.2.1/24(rw,no_root_squash,async)" to the exports file. Well, of course i do have that dir and that mount point on the server and the client respectively.

I did "exportfs -a" and it worked, and as you can see from the ps output, the server is running... so, if your solutions are exhaustive, it could only be the slash (and i hope so!) but, sincerely, most of the times "/foo/bar/" and "/foo/bar" are exactly the same... so it'd seem strange to me :) also, the error message says "server is down", while if it was an error from the client i guess it would say something like "mount point not found".

Anyway, now i'm at home, but tomorrow i'll try it at work and give you feedback, thanks a lot!

]Nbx*cmD[
May 3rd, 2007, 02:38 PM
So as I suspected, the slash has absolutely nothing to do with the problem.

Actually some of the other lines of fstab mounting some partitions finish with a slash as well and work perfectly.

Does somebody have a clue about it? thanks!

dannyboy79
May 3rd, 2007, 03:51 PM
as I stated, it appears as though your mount points are not matching up. according to the instructions, your mount point and the mount point your exporting need to be the same and your's are not. (mnt blah blah versus media blah blah) you wouldn't think that that would be it but it's worth a try right?

Also, here are some common Gotcha's for running NFS.

Ownership represented by numeric UID/GID values, which correspond to logins viathe /etc/passwd file on both client and server!(What if UIDs don't match?)

Security is a problem (e.g., can chown be used to give files away?).See Unix System Security Checklist for details.

NFS is a "stateless" protocol. What happens if the server goes down?

"NFS: stale file handle" error message means re-mount file systems

"Hard mount" is "Energizer Bunny" mode. Client keeps trying, and trying, and trying.... Unless interrupts allowed, client will "hang" until server comes back up

"Soft mount" means client gets an error message.

File locking can be a problem.

Easy to "waste" bandwidth by transferring files twice!(e.g., ftp to/from an NFS mounted file system on a client)

Forgetting to use -xdev (or -mount, etc)., when using find.

Differences in maximum block sizes between client/server file systems can cause programs to crash

]Nbx*cmD[
May 3rd, 2007, 06:24 PM
Tried it, not working either :(

I needed to have the system working for today so i did it using smbfs, thanks anyway!

dannyboy79
May 3rd, 2007, 06:30 PM
Nbx*cmD[;2586136']Tried it, not working either :(

I needed to have the system working for today so i did it using smbfs, thanks anyway!

I can tell ya right now that cifs works better than smbfs in my own experience. it's to bad that you couldnt' troubleshoot longer and figure out what's wrong because the guide does work so if you're using feisty it's possible that something happened to NFS in Feisty

]Nbx*cmD[
May 4th, 2007, 12:23 PM
yeah, you know... companies put pressure :)

I'll keep investigating though, the thing is that the server is not running ubuntu but debian, so maybe the guide doesn't exactly fit it... when i have time and the server is not to be used for a while i'll try installing feisty server.

dannyboy79
May 4th, 2007, 01:32 PM
according to a more general NFS server guide, you should run this

rpcinfo -p

to see if the server is running the correct services. you should see something like this returned.
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 749 rquotad
100011 2 udp 749 rquotad
100005 1 udp 759 mountd
100005 1 tcp 761 mountd
100005 2 udp 764 mountd
100005 2 tcp 766 mountd
100005 3 udp 769 mountd
100005 3 tcp 771 mountd
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
300019 1 tcp 830 amd
300019 1 udp 831 amd
100024 1 udp 944 status
100024 1 tcp 946 status
100021 1 udp 1042 nlockmgr
100021 3 udp 1042 nlockmgr
100021 4 udp 1042 nlockmgr
100021 1 tcp 1629 nlockmgr
100021 3 tcp 1629 nlockmgr
100021 4 tcp 1629 nlockmgr

this is all according to this guide: http://tldp.org/HOWTO/NFS-HOWTO/server.html#VERIFY

good luck

williammanda
May 4th, 2007, 06:13 PM
I have used this setup before and it worked great with my 100 meg router. I have since changed over to a 1gig router and three out of my four computers have 1 gig ethernet ports. I'm having trouble with the files stalling during copy & pasting. The transfer with work for 2 - 3 seconds and stalls for 10 - 15 seconds. This cycle continues until it is finished. Tis scenario happens between any computer ie 1 gig to 1 gig or 1 gig to 100 meg. Is there anything that needs to be setup differently since I changed routers or something else?
Thanks

williammanda
May 7th, 2007, 01:07 PM
I have changed over to Feisty since the last post. I ran a test with a 7 GB file and it transfered at a rate of 1 GB per minute. I'm not sure if this is good or bad but I didn't see the stalling as I did using KDE. Please advise.
Thanks

williammanda
May 11th, 2007, 11:45 AM
Bump...bump!

dannyboy79
May 11th, 2007, 02:27 PM
Bump...bump!

what would you like to know? i read your post as a comment and not a question.

The fact that your 7gigabBYTES file transferred in 7 minutes sounds low when you look at the raw numbers!

It's due to the PCI bus limitation and packet overhead. A 32bit wide PCI bus running at 33 Mhz, would give it a theoretical speed of about 130 MB/s. Now you would have to split that between the Ethernet Card and the Hard drive since you are transferring data, that would result in about 65MB/s or 3900MB/minute. You're saying your transfer went at 1gigaBYTE/s or 1024MB/minute (that's about 17MB/sec). That's double what I get thru Samba!

It's often troubleshooting network transfer speeds as there are so many variables. I have never used NFS but I do know it's way faster than Samba as I can only get around 8MB/s with samba.

So why did you bump your post? If you're wondering if your transfer speed is alright I would say YEAP, you are transferring files pretty fast. You'll never see 128MB/second

williammanda
May 11th, 2007, 05:22 PM
Yes I was looking for an answer as to if the transfer rate was good or bad.
Thanks

chrisod
May 19th, 2007, 01:53 AM
I'm posting this to save somebody the 90 minutes of cursing I just went through trying to figure this out. When mounting a SimpleShare drive with NFS, you have to ID the drive differently than you do for Samba.

For Samba, mounting my Photos Folder looked like this (from my fstab file):


//mediaserver/Photos /mnt/photos smbfs guest,uid=1000,iocharset=utf8,codepage=unicode,uni code 0 0

However, to mount the same folder in NFS, it has to look like this.


mediaserver:/shares/SimplePool/Photos/ /mnt/photos nfs rsize=8192,wsize=8192,timeo=14,intr

This assumes you have not screwed with the default disk pool set up. I have no idea why it needs that the fully qualified path, but it does. Not using it will get you permission denied errors.

dannyboy79
May 21st, 2007, 03:16 PM
I'm posting this to save somebody the 90 minutes of cursing I just went through trying to figure this out. When mounting a SimpleShare drive with NFS, you have to ID the drive differently than you do for Samba.

For Samba, mounting my Photos Folder looked like this (from my fstab file):


//mediaserver/Photos /mnt/photos smbfs guest,uid=1000,iocharset=utf8,codepage=unicode,uni code 0 0

However, to mount the same folder in NFS, it has to look like this.


mediaserver:/shares/SimplePool/Photos/ /mnt/photos nfs rsize=8192,wsize=8192,timeo=14,intr

This assumes you have not screwed with the default disk pool set up. I have no idea why it needs that the fully qualified path, but it does. Not using it will get you permission denied errors.


You could have saved yourself the 90 minutes and your bllod pressure level if you had read the guide more closely as it already stated that. From the very first page, if you want to add the mount to your fstab, the syntax should be: server.mydomain.com:/files /files nfs rsize=8192,wsize=8192,timeo=14,intr
Which if I am not mistaken, is exaclty what you are telling us again. I guess thanks anyway for the other readers who don't follow the guide precisely.

xris_xcess
June 5th, 2007, 09:54 PM
Hi:

I´m new and I now the last post here was a while ago, but I still wanted to follow a thread.


I´ve found this thread very helpfull... but i´m still stuck on something. I set up a freeNas box so I could share a common folder with several computers. After having great trouble ironing out permissions problems, I finally got full ownership and rw permissions.

However, until now, I can only manually mount the share. Although I have a "auto" option in my fstab, nothing happens until i issue the "mount /local/share/name" comand. żIs this supposed to be like this? żI though that putting mounting points in fstab (with the correct options: "auto"?) made the whole process automatic?
I tried to fiddle with autofs but was not sucessfull. I´m not too concerned about server/client load just yet. If it was not for this detail, I would be great. I´m going to set up a login script and see how it goes, but I would really like my fstab to work. ](*,)

Also, I have my mount point on the desktop. When I mount the share, another folder appears there with the same name and a "connected tube" personalized icon (with an "nfs" tag on it). Both folders work, in fact they point to the same place. I don´t get it? If I have to create a folder in the first place, why does it then go an make another one? Or is it because most of the time (generally) you mount under the /mnt directory, and nfs-common tools are being helpfull and putting an icon on the desktop?

My fstab setup looks like:


freenas:/mnt/sharename /home/Desktop/sharename nfs rw,auto,user,rsize=8192,wsize=8192,intr,soft,retry =5,timeout=20,port=2049


Thanks a lot for any help!!!

EDIT: I rather answered my own question and my mounts work properly. I rewrote fstab to:

freenas:/mnt/sharename /mnt/sharename nfs rw,auto,user,rsize=8192,wsize=8192,intr

And now it works like I was looking for. The user dosen´t have to dive into /mnt, but the share appears on the desktop ... so, that it.

Lary Grant
June 8th, 2007, 03:42 AM
I did the export and mount read-write (rw) but I can still only read. If I try to write I get an error that says "read-only filesystem".

dannyboy79
June 8th, 2007, 03:43 PM
and who is the owner of the folder you mounted your exported NFS share to? also, what are the permissions on that folder? those would be the last 2 things to check

Lary Grant
June 8th, 2007, 05:01 PM
Here are more details... There are 2 computers (say A and B). Each 1 has a single user on it (but different from each other), i.e. computer A has user A and computer B has user B. I want to set up a world-writable directory (called "Xfer") under user A's home directory (on computer A) so that user B, working on computer B, can copy documents to computer A for user A to work on.

I created the /home/A/Xfer directory, on computer A, owned by user A, with "777" permission (i.e. world-writable). I set up a read-write (rw) /etc/exports line on computer A for that directory and a mount point and read-write (rw) /etc/fstab line on computer B to access it.

On computer B, the mount suceeds and I can read files in /home/A/Xfer, but I can't write or create files there. If I try (e.g. using the "touch" command), I get a "read-only filesystem" error.

dannyboy79
June 8th, 2007, 06:27 PM
ok, again, I'll ask the same question, who is the owner of the folder where you are mounting the /home/A/Xfer folder on computer B? Where is the mount point, what does your computer B fstab file look like, and what are the permissions?????

esekyavuz
June 9th, 2007, 05:02 AM
Caveat: Say "nnn" then go "oooo" for about five minutes, then say "b".

I found this guide very helpful and have been able to share folders on my laptop with my desktop computer and vice versa. Thank you.

I'm wondering...

Is it possible to share a folder on an ntfs disk via nfs? Both machines running Kubuntu Feisty? Or must I use samba?

Is it necessary for a folder to be somewhere in /home[/...] in order to share it?

Is it possible to share a symbolic link? I have a folder on my desktop that is actually just a link (in Windows we called them shortcuts) to the ntfs folder. Can I share that?

I have tried these things, but there is so much opportunity for missed slashes and misspellings. Thought I'd ask if these things were even possible before I spent more time on them.

Thanks in advance

Mr. C.
June 9th, 2007, 05:31 AM
Once a file system is mounted, it does not matter what type it is - you can share it with NFS.

You can NFS export any directory; it does not have to be in /home.

It doesn't make sense to share a symbolic link. A symbolic link is a file that has some special indirection properties. What are you trying to do here?

MrC

esekyavuz
June 9th, 2007, 05:44 AM
Mr C

Thanks for the quick answer.

Not necessary to share the link. I was using it to try to get around the restriction (which does not exist!) that you can share only in /home[/...]

So I guess it's my spelling. will keep trying

Thanks again

******************
Still banging my head.

I'm trying to share

/media/sda1/dirname

sda1 is a data disk from Windows days. It's 500GB of NTFS. A SATA drive, in case that matters.

I have given mode 777 to everything in the path, even though I have shared directories that do not have full 777 permissions.

I have tried to sudo mount -t ntfs and was told "special device not present"

When I try to mount without -t then it just says "permission denied". Using sudo.

I am able to share at will on the main GNU/Linux partition.

I guess I should try mounting as root. Every time I write PART TWO of this I think of something else to do. Sheesh. Well, I'll leave this up. If there is a reason I can't share /media/sda1 I would love to know before my brain goes soft. Ooops. Too late.

TIA

esekyavuz
June 10th, 2007, 07:05 PM
So I kind of chickened out. After another hour or so it occurred to me that there is no reason to keep the disk in NTFS. My goal is to be Free by September.anyway so why spend more time on this?

I copied the files to a directory on another disk,used gparted to delete the ntfs partition and create an ext3 one., copied everything back, and the NFS shares I set up yesterday worked perfectly.

I'm hesitant to say that this is clear evidence that it was something Wiindowish that was the problem. It's possible that what I did reset a lot of stuff.

In case no one has mentioned it yet, in Kubuntu you can set up NFS shares in a GUI under Settings/Shared Folders. You specify which directory you want shared, which network you want to share it with ( NFS or Samba), and who gets access. In the case of NFS, this configures /etc/exports for you with (rw) privieges. You still have to

sudo exportfs -a

but after that it's ready to be mounted by the other machine(s).

Thanks again for the help and the great howto.

rko618
July 16th, 2007, 10:14 AM
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)

Thanks! I was having a fit trying to get this to work with my mac. I used your exact options and it worked finally. :)

stryker719
July 18th, 2007, 08:39 PM
I am trying to allow my Yellow Dog Linux distro installed on my PS3 to mount my files on my Ubuntu PC. I followed the instructions, but am getting this error on my client machine (YDL on PS3)...
"failed, reason given by server: Permission denied."

Any thoughts?

jackn
July 25th, 2007, 12:22 PM
The issue raised by jabb and george_apan is resolved in this post (http://ubuntuforums.org/newreply.php?do=postreply&t=508862).

dannyboy79
July 25th, 2007, 01:23 PM
the above link takes you to a blank page? Also, it's much easier to copy and paste for users unless of course it's to much for your copy and paste (clipboard limit?) or unless the page is more than just text.

davidme
August 1st, 2007, 06:41 PM
What happens if I have a dynamic ip address ?

Say I have 2 laptops, I want one to share files to another via NFS.

Problem is that I have dynamic ip for both of them since they connect through a router.

So, if I write this:

/home/czar/tmp 192.168.1.1/24(rw,no_root_squash,async)

next time I will start my host laptop the ip for the host can be different, meaning I have to change it on the client.

Is there any other way to connect maybe via laptop name or MAC address or something ?

dannyboy79
August 1st, 2007, 07:05 PM
What happens if I have a dynamic ip address ?

Say I have 2 laptops, I want one to share files to another via NFS.

Problem is that I have dynamic ip for both of them since they connect through a router.

So, if I write this:

/home/czar/tmp 192.168.1.1/24(rw,no_root_squash,async)

next time I will start my host laptop the ip for the host can be different, meaning I have to change it on the client.

Is there any other way to connect maybe via laptop name or MAC address or something ?

you didn't read it correctly, what this line on the NFS server does is allow ANY ip address within that range (192.168.1.1 thru 192.168.1.255) to connect to the server.

The client is where you'll want to call out the system name of the machine or hostname by either manually mounting it or putting it in your fstab.

davidme
August 1st, 2007, 08:05 PM
"The client is where you'll want to call out the system name of the machine or hostname by either manually mounting it or putting it in your fstab."

Where do I on the Host machine edit my l name of the machine ? I only found in manual configuration that I can define host name.

I set my host name to be: laptopishe

Now, on the client side. this command

sudo mount laptopishe:/home/user/media /media/user2/shares

tells me that "can't get address for laptopishe"

What is the problem ?

Mr. C.
August 2nd, 2007, 04:38 AM
Either use static IP addresses (which is a function of how you configured your systems, not of your router), or export your file systems to your entire subnet.

The address range you are using makes no sense (192.168.1.1/24). 192.168.1.1 is a HOST address, yet /24 is a subnet specifier. You'd want either 192.168.1.1 (for a single host) or 192.168.1.0/24 (for tghe entire subnet).

If you are going to use dynamic IP addresses, then hostnames will not be an option unless you change the pair in /etc/hosts, or configure a dynamic updating DNS server (which sounds beyond what you're likely to do right now).

The NFS client and server software, and Unix / Linux server software in general, was developed with static IPs in mind - server's should not be changing IPs.

MrC

dannyboy79
August 2nd, 2007, 02:49 PM
Either use static IP addresses (which is a function of how you configured your systems, not of your router), or export your file systems to your entire subnet.

The address range you are using makes no sense (192.168.1.1/24). 192.168.1.1 is a HOST address, yet /24 is a subnet specifier. You'd want either 192.168.1.1 (for a single host) or 192.168.1.0/24 (for tghe entire subnet).

If you are going to use dynamic IP addresses, then hostnames will not be an option unless you change the pair in /etc/hosts, or configure a dynamic updating DNS server (which sounds beyond what you're likely to do right now).

The NFS client and server software, and Unix / Linux server software in general, was developed with static IPs in mind - server's should not be changing IPs.

MrC

He is doing everything correctly. If you're going to try to help please be aware of what you're saying.
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.
(NOTE: I copied and pasted the above info, credit goes to the author of post #28 within this thread)

NOt only is he following the guide bit for bit, but it's correct even if the guide didn't say to do it that way.

As far as hostname resolution, it sounds like you don't have it setup properly. I haev written up a little explaination on hostname resolution options within a linux/windows mixed environment. (http://ubuntuforums.org/showthread.php?t=391601) If you don't want to read it, then I would just suggest you setup a static ip on the server and just use that instead of the hostname.

Mr. C.
August 2nd, 2007, 06:14 PM
Danny, your combative, threatening, and policing responses get tiresome. Please stop.

While the address specified *may* work in some implementations or situations, it is technically incorrect, and *will* fail with some software (such as bind). The specification being used is confusing at best, because it violates common practice and shows a misunderstanding of CIDR.

The correct and commonly practiced mechanism to show a range if IP addresses is to specify the network IP along with the host part of all zeros, as in 192.168.1.0/24. This is unambiguous, clear to all, and doesn't rely on how the software might parse net and host parts. The specification 192.168.1.1/24 is confusing at best, as it is not clear that the author meant a single IP address, or a range from 1 to 255, or 0 to 255. It becomes even more confusing with non 8-bit aligned networks. You may examine all examples in the Wikipedia link references in post #28, and more importantly, in RFC 4632:

http://tools.ietf.org/html/rfc4632

I teach the background, theory, and principles; i have no interest in matching up with some (possible naive, or incorrect) user's guide or posts. The response in #28 is not authoritative.

MrC

dannyboy79
August 2nd, 2007, 06:42 PM
Danny, your combative, threatening, and policing responses get tiresome. Please stop.

While the address specified *may* work in some implementations or situations, it is technically incorrect, and *will* fail with some software (such as bind). The specification being used is confusing at best, because it violates common practice and shows a misunderstanding of CIDR.

The correct and commonly practiced mechanism to show a range if IP addresses is to specify the network IP along with the host part of all zeros, as in 192.168.1.0/24. This is unambiguous, clear to all, and doesn't rely on how the software might parse net and host parts. The specification 192.168.1.1/24 is confusing at best, as it is not clear that the author meant a single IP address, or a range from 1 to 255, or 0 to 255. It becomes even more confusing with non 8-bit aligned networks. You may examine all examples in the Wikipedia link references in post #28, and more importantly, in RFC 4632:

http://tools.ietf.org/html/rfc4632

I teach the background, theory, and principles; i have no interest in matching up with some (possible naive, or incorrect) user's guide or posts. The response in #28 is not authoritative.

MrC

I am sorry you feel this way.

LuisC-SM
August 21st, 2007, 01:45 AM
To the original author.

Thanks a lot!

I can reconfirm (others have already done so) that this works for UFF just as stated.

Regards

Luis

jlagermann
August 21st, 2007, 06:04 PM
I still need help. When I try to mount from the client I get this error:
mount to NFS server '192.168.10.200' failed: server is down.

I have all of the parts and pieces configured exactly as stated on the orginal post, on the client and server, but I still cannot connect.:(

I am setting up a VMWare image just for FTP but I don't want a 200G VMware image. All of the data for the FTP server is on the host machine with the NFS share and the client is in a VM.

LuisC-SM
August 21st, 2007, 07:04 PM
Hi.

See if /etc/network/interfaces is setup correctly, ...in my own case, this would be my configuration

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.50
netmask 255.255.255.0
network 192.168.1.1
broadcast 192.168.1.255
gateway 192.168.1.254
Sorry if this is not the correct answer but I've not seen previous posts..
Kind Regards
Luis

jlagermann
August 21st, 2007, 07:13 PM
My /etc/network/interfaces is setup very similar. The network works fine, Internet, ICMP etc..

I am currently doing a tcpdump on the client. The client is tring to communicate with the server by IP on the sunrpc port and then it changes to port 48482. The server never replies. Every couple seconds the server does a reverse-arp for the client by name with no answer.

LuisC-SM
August 21st, 2007, 07:51 PM
My /etc/network/interfaces is setup very similar. The network works fine, Internet, ICMP etc..

I am currently doing a tcpdump on the client. The client is tring to communicate with the server by IP on the sunrpc port and then it changes to port 48482. The server never replies. Every couple seconds the server does a reverse-arp for the client by name with no answer.
Probabily I can help u as long as I had the same problem once..

Can you try to comunicate via SSH? (on port 22)?

If so, then dome a favor ... just post your /etc/network/interfaces and your /etc/hosts files here.... just to have an idea.

Luis.

R_U_Q_R_U
August 30th, 2007, 01:10 AM
AVOID FRUSTRATION! MAKE SURE YOU CHECK YOUR FIREWALL!

I could not get my Ubuntu laptop client to connect to the NFS server. I kept getting "failed: server is down".

I rechecked everything in my exports folder and my mount command. All looked OK. After two days of swearing and begging, I thought "FIREWALL"

I fired up the GUI Firestarter on the server and noted that I had setup INBOUND rules. I added the IP of the client and BINGO it worked.

BTW what is the syntax for allowing all IPs on my network to the inbound rule?

dmizer
August 30th, 2007, 07:50 AM
[snip]
While the address specified *may* work in some implementations or situations, it is technically incorrect, and *will* fail with some software (such as bind).
[snip]
MrC
thank you MrC. that fixed my bind hangup. i've successfully readded name resolution to my local network. had no idea what was causing that.

Euan17
August 30th, 2007, 10:20 AM
hey, im new to linux and i'm trying to setup NFS server but i cant find the /etc/exports file in my installation and i have no internet connection on the machine. is there somewhere i can download the files i need on this machine copy them to usb and then install them on the linux machine?

ShopliftCS
August 30th, 2007, 02:52 PM
Having issues with Ubuntu NFS & VMWare so I'll post the setup and let the guru's check it out.

I have 3 HP dc7700 workstations for my testing. 1 with Ubuntu Feisty (7.0.4) and 2 with VMWare ESX 3.0

NFS Setup:
Ubuntu 7.04 (feisty), I am remote controlling via tightvnc
IP: 192.168.14.235
Subnet Mask: 255.255.254.0
Shared folder /svr

Here's a copy of my terminal:


alloy@asc-nfs:/etc$ sudo apt-get install nfs-kernel-server nfs-common portmap Reading package lists... Done
Building dependency tree
Reading state information... Done
nfs-kernel-server is already the newest version.
nfs-common is already the newest version.
portmap is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
alloy@asc-nfs:/etc$ 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 32771 status
100024 1 tcp 60132 status
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100021 1 udp 32796 nlockmgr
100021 3 udp 32796 nlockmgr
100021 4 udp 32796 nlockmgr
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 tcp 59301 nlockmgr
100021 3 tcp 59301 nlockmgr
100021 4 tcp 59301 nlockmgr
100005 1 udp 1000 mountd
100005 1 tcp 1003 mountd
100005 2 udp 1000 mountd
100005 2 tcp 1003 mountd
100005 3 udp 1000 mountd
100005 3 tcp 1003 mountd
------------------------------------------------
alloy@asc-nfs:/etc$ sudo /etc/init.d/portmap restart
* Stopping portmap daemon... [ OK ]
* Starting portmap daemon... [ OK ]
alloy@asc-nfs:/etc$ 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 ]
alloy@asc-nfs:/etc$ sudo exportfs -a

So, it would seem that NFS is set up. Now, I move over to my VMWare test box.

I log in with the VI Client to the machine @ 192.168.14.236
Here's an image of my net settings:
http://www.4cpp.com/images/vmware_nic.jpg

So, I go to storage -> Add Storage and I select Network File System
Like so:
http://www.4cpp.com/images/vmware_storage.jpg
http://www.4cpp.com/images/vmware_storage2.jpg
I see the message like this:
http://www.4cpp.com/images/vmware_storage32.jpg

And then error!
http://www.4cpp.com/images/vmware_storage_err.jpg

Any idears?

Thanks,

~Shop

--ALSO--
My exports has 1 entry

/svr 192.168.14.233(rw,no_root_squash,async,subtree_che ck) 192.168.14.234(rw,no_root_squash,async,subtree_che ck) 192.168.14.235(rw,no_root_squash,async,subtree_che ck) 192.168.14.236(rw,no_root_squash,async,subtree_che ck) 192.168.14.237(rw,no_root_squash,async,subtree_che ck)

ShopliftCS
August 31st, 2007, 03:37 PM
hey, im new to linux and i'm trying to setup NFS server but i cant find the /etc/exports file in my installation and i have no internet connection on the machine. is there somewhere i can download the files i need on this machine copy them to usb and then install them on the linux machine?

Evan--

Log in as root, or on Ubuntu try this in a console terminal:

*nix
vi /etc/exports

Ubuntu
sudo gedit /etc/exports
<type your password>

This file should have no entries by default, you must create your own.

~Shop

LuisC-SM
September 1st, 2007, 05:55 PM
Evan--

Log in as root, or on Ubuntu try this in a console terminal:

*nix
vi /etc/exports

Ubuntu
sudo gedit /etc/exports
<type your password>

This file should have no entries by default, you must create your own.


~Shop

I'm not exactly sure, but I think this file is created by "portmap or by nfs-kernel" (I could be wrong) and the next thing you must do once you create the file is to to insert a line like this:

/home/your_user_name/Your_exported_file XXX.XXX.XXX.XXX/24(rw,no_root_squash,async)
So in order to give you an idea my file looks like this:
/home/luis/Musica 192.168.1.1/24(rw,no_root_squash,async)
As you can see, 192.168.1.1/24 is granting read and write access to everybody in my Music network folder.
I hope this will help u.

Regards

Luis

@Shop

Your problem above looks like it is realted to Router access (not sure but I see no otheroption)

LuisC-SM
September 1st, 2007, 07:15 PM
hey, im new to linux and i'm trying to setup NFS server but i cant find the /etc/exports file in my installation and i have no internet connection on the machine. is there somewhere i can download the files i need on this machine copy them to usb and then install them on the linux machine?

I have one question...
Did you install Ubuntu Server CD? and followed the steps in the first post?

Regards

Luis

a_posse_ad_esse
September 4th, 2007, 06:21 AM
I'm getting a "permission denied" error, and find by reading /var/log/syslog that


Sep 4 00:48:47 server mountd[6466]: mount request from unknown host 192.168.2.7 for /public (/public)


My hosts.allow:


rpc.mountd portmap mountd nfsd statd lockd rquotad : 192.168.2.*


and exports


/public 192.168.2.*(rw,no_root_squash,async,subtree_check)


Any ideas about how I can fix this?

bodhi.zazen
September 4th, 2007, 07:41 AM
I do not think you can use * as a wild card here.

Try 192.168.2.0/255.255.255.0 or 192.168.2.1/24

So in hosts.allow

ALL: 192.168.2.0/255.255.255.0

And in exports

/public 192.168.2.1/24

a_posse_ad_esse
September 5th, 2007, 02:12 AM
That worked, thanks.

I figured that both methods did essentially the same thing... Strange that the wildcard method doesn't work.

LuisC-SM
September 6th, 2007, 01:27 AM
I've seen that sometimes people gets confused when mounting or auto-mounting (in "/etc/fstab") with this statement:

server.mydomain.com:/files /files nfs rsize=8192,wsize=8192,timeo=14,intr

In my case and with my own configuration (posted earlier) this also works:

192.168.1.50:/files /files nfs rsize=8192,wsize=8192,timeo=14,intr
(My Static IP Address)
I hope this can help someone who is having troubles mounting NFS.

Cheers

Luis

CyberCod
September 9th, 2007, 07:08 AM
I successfully used your guide to mount shares, and managed to infer the necessary permissions situation from the original post (go me!) but now that its up, its so damn slow I can not believe it.

It has taken nearly an hour to transfer a 700MB file, and it is still not complete... in fact its stuck at (0:00 Remaining) even though the filesizes in both the original file and the copied file are the same... all the while, the bandwidth monitor is still going full speed.

What gives?

The setup is:

serving PC on 802.11b wifi pci card

client PC on 10/100 onboard ethernet

transferring from client into the shared folder of the server.


I realize there's a bottleneck somewhere, but this is ridiculous... Samba is faster than this for me, so I must have something not right. It the bottleneck were hardware related, samba would be this slow as well.

Yet it IS working, if thats what you call it...

Is there any way to tell what the transfer speed is?

Also, the share doesnt show back up on the client after rebooting, even though its properly set in fstab.

CyberCod
September 9th, 2007, 09:14 AM
Well, the file transfer never really finished. I ended up having to kill it after it was apparent that the transfer was as complete as it would get.

The transfered file (a video) plays ok, but has seek issues, so apparently something was lost in the transfer, even though they're the same size file.

On the client side (transferrer) the the whole desktop ended up locking up, and the keyboard lights were flashing, denoting kernel panic... thats never good. I did Alt+SysRq RSEUB to reboot. At which point the NFS shares still weren't auto-mounted by the fstab.

I customized the automounter script mentioned earlier in this thread, and that works, so as soon as I figure out cron, I'll have that working properly.

I'm looking at ports stuff like that to see if I can figure it out myself, but I'm not seeing many posts of others having this problem.

Oh, and the wireless in question has a link speed of 11Mbps according to the Network Tools app.
On the PC using ethernet, the link speed says "not available" so I'm looking into that.

If you need me to post some info, say the word. I REALLY want this to work. 4 machines running in the house with Ubuntu, and only one of them is dual boot w/ Win (for Warcraft purposes, and only because ATI suxx... else WoW would be in Wine) so getting rid of Samba would be really nice.

Thnx


Update:

Just used the following command in terminal to time a file copy


time command cp ~/Desktop/Fog2.flv ~/Desktop/SharedFolder


it was a 5.6MB file and it took 19.121 seconds.

5.6/19.121 = 0.292871712 MB/s
times 8 gives 2.342973696
or
2.34Mbit/s
on an 11Mbit connection.

a 700MB file would take 2390 seconds or 39.8 minutes.

That still seems a bit high to me.

LPGDEV
September 12th, 2007, 04:19 PM
Hi

I have installed the nfs server and it works really well. However, I did something which makes it start at startup and I would like to know exactly where this is so that I can disable it. Can anyone help me out with this?

Thanks

LuisC-SM
September 12th, 2007, 08:52 PM
Hi

I have installed the nfs server and it works really well. However, I did something which makes it start at startup and I would like to know exactly where this is so that I can disable it. Can anyone help me out with this?

Thanks

Edit your /etc/fstab and delete (remove) the line you had previously added. (Normally the last line).

Cheers

Luis

EDIT: Note that this will disable (unmount) only the CLIENT ... Not the server (sorry if this was not what you were looking for.

bodhi.zazen
September 12th, 2007, 09:08 PM
Hi

I have installed the nfs server and it works really well. However, I did something which makes it start at startup and I would like to know exactly where this is so that I can disable it. Can anyone help me out with this?

Thanks

Disable portmap and nfs-common. You can do this several ways.

edu_ard
September 30th, 2007, 10:07 AM
I did exactly what you said and I get this in the client computer which uses SuSE.

linux-suse:/home/user # mount -t nfs 192.168.0.20:/home/user/shared /home/user/nfs
mount server reported tcp not available, falling back to udp
mount: RPC: Remote system error - Connection refused
linux-suse:/home/user #

What I did wrong?:(

megamania
September 30th, 2007, 11:37 AM
I did exactly what you said and I get this in the client computer which uses SuSE.

linux-suse:/home/user # mount -t nfs 192.168.0.20:/home/user/shared /home/user/nfs
mount server reported tcp not available, falling back to udp
mount: RPC: Remote system error - Connection refused
linux-suse:/home/user #

What I did wrong?:(
I'm not sure that's the problem, but I would set a mountpoint in /mnt, not in /home. So:


sudo mkdir /mnt/nfs
I also do not use "-t nfs" and it works for me:


sudo mount 192.168.0.20:/home/user/shared /mnt/nfs
I see you use Suse. I don't know if it's like Ubuntu (which uses sudo), but remember you need root privileges for both commands. So either you use sudo, or you have to strip it off my examples and be root.

Hope that helps - I'm not an expert at all and still learning, so let me know how it turns out.

bodhi.zazen
September 30th, 2007, 05:14 PM
I did exactly what you said and I get this in the client computer which uses SuSE.

linux-suse:/home/user # mount -t nfs 192.168.0.20:/home/user/shared /home/user/nfs
mount server reported tcp not available, falling back to udp
mount: RPC: Remote system error - Connection refused
linux-suse:/home/user #

What I did wrong?:(

First, the mount point does not matter on the client. You can mount in your home directory if you like.

Second, I have no problems at all with an Ubuntu server and OpenSUSE 10.3

On the suse client :


mount -t nfs <server_ip>:/export /mount/point

where <server_ip> is my nfs server, :export is the exported nfs share, and /mount/point is either in /mnt , /media, or /home

mounting nfs worked on the suse client out of the box.

So I assume your problem is either with your server, router/network, or firewall.

HTH

jcsewell
October 2nd, 2007, 06:54 PM
How does one go about accessing an NTFS partition from another client using nfs? Here is my network:

fs Server
NTFS mounted drive
|
|
|
nfs Client
wants to mount NTFS partition

nfs is working on both machines. I can mount home directories from the server on the client.

When I try to mount the NTFS partition, here's what I get:

mount: jsewell-server:/media/NTFS failed, reason given by server: Permission denied

I checked permissions on the NTFS partition on the server. owner and group are "root". All files and directories have rwx permissions for user, group, and world. So it seems like anybody should be able to access those files.

Why am I getting permission denied?


-James

bodhi.zazen
October 2nd, 2007, 07:40 PM
First confirm your server is configured (can you mount a non-ftfs share ?)

Then see if this link helps :

http://czarism.com/easy-peasy-ubuntu-linux-nfs-file-sharing

clucas
October 3rd, 2007, 12:23 AM
I have read this thread and have become confused. My confusion comes about from what to use for "server.mydomain.com". My situation: I have 2 Linux machines each running Gutsy Gibbon. When I run ifconfig at my "upstairs" machine I get inet addr as 192.168.0.102. When I type cat /etc/hosts is carl-upstairs. When I do the same "downstairs" I get 192.168.0.101 and carl-desktop. My goal is for any machine to have access to the files on the other machine.I have edited the fstab file as well as the /etc/exports file. Obviously the wrong way! Can someone help?

bodhi.zazen
October 3rd, 2007, 12:33 AM
I have read this thread and have become confused. My confusion comes about from what to use for "server.mydomain.com". My situation: I have 2 Linux machines each running Gutsy Gibbon. When I run ifconfig at my "upstairs" machine I get inet addr as 192.168.0.102. When I type cat /etc/hosts is carl-upstairs. When I do the same "downstairs" I get 192.168.0.101 and carl-desktop. My goal is for any machine to have access to the files on the other machine.I have edited the fstab file as well as the /etc/exports file. Obviously the wrong way! Can someone help?

You can either use the ip address

Or you can add the information to /etc/hosts

192.168.0.102 carl-upstairs #add this to your downstairs machine

192.168.0.101 carl-desktop #add this to your updatairs machine

After you add that info to your /etc/hosts you can use carl-upstaris and carl-desktop in place of "server.mydomain.com"

clucas
October 3rd, 2007, 12:57 AM
Thanks. I need more help.

This is what I did:

I edited hosts on my downstairs machine to include 192.168.0.102 carl-upstairs.

I edited exports to include /files 192.168.0.1/24(rw,no_root_squash,async).

I then did "sudo mount 192.168.0.102:/files /files" (of course, after creating "files") and got mount to NFS server '192.168.0.102' failed: RPC Error: Program not registered.

bodhi.zazen
October 3rd, 2007, 01:02 AM
you need to restart the nfs server after you update /etc/exports


sudo /etc/init.d/nfs-kernel-server restart

Then, on the client use the -nfs flag

sudo mount -t nfs 192.168.0.102:/files /files

clucas
October 3rd, 2007, 01:17 AM
I REALLY appreciate the help. Now I have to ask a stupid question: Which is the client and which is the server? Sorry I'm showing my ignorance!

bodhi.zazen
October 3rd, 2007, 01:49 AM
LOL

No problems

The server is where the nfs-server is running, the place where /files lives, the place where you configured /etc/exports

The client is where you mount /files

where you run

sudo mount -t nfs ip:/files /files

You do NOT need to run a nfs server on both boxes, just one.

clucas
October 3rd, 2007, 02:05 AM
Almost there!!

From "upstairs" I have access to "downstairs". But I can't get access to "upstairs" from "downstairs". When I ran the mount command "upstairs" it worked. But when I ran it "downstairs" I get: "mount.nfs: mount to NFS server '192.168.0.102' failed: RPC Error: Program not registered"

bodhi.zazen
October 3rd, 2007, 02:16 AM
Well, you only need to mount the share form one server to one client.

ie you do not need to run a nfs server on BOTH and mount a nfs share on BOTH, it would be redundant ...

it would be redundant ...

clucas
October 3rd, 2007, 02:26 AM
I see what you mean.... I see what you mean. :)

But I want both machines to be able to access the other machine at both times.

Don't I need to mount the nfs share on both machines? I mean, don't I need to mount the upstairs machine on my downstairs machine and vice versa?

How do I "disable(?)" the server on 1 of the machines? I think what I did was ran the nfs server on both.

Maybe I'm getting tired and should go to bed and work on this some other time.

You HAVE been a great help, though.

bodhi.zazen
October 3rd, 2007, 03:01 AM
You are most welcome.

You can always access /files, on either machine, at any time.

Ask yourself, do you need more then this ?

nickpaton
October 3rd, 2007, 07:47 PM
I've read every post over the 18 pages (took all afternoon!)
Great Howto on the first page and got everything working fine.

But like a couple of other posters I also wanted to mount onto NTFS drives on the server and haven't been able to, getting the 'Permission Denied' message when trying to mount via the client.

The NTFS drives on the server are SATA and have been configured to read / write on Ubuntu using the excellent ntfs-3g program - see here (http://ubuntuforums.org/showthread.php?t=217009) for details.
On the server I can fully read / write to the drives within Ubuntu, and have also chowmodded etc etc.

As suggested by one of the other posters I then added an ext3 partition to one of the SATA's and hey presto I can now mount that partition.

So the problem has to be to do with the way the NTFS drive is formatted or configured - a very useful post somewhere within the 18 pages lists a whole lot of Gochas, and the NTFS drives have got to fall into this.

I'm going to persist with this, but in the meantime...

...Any ideas?

peos
October 4th, 2007, 05:09 AM
It's a great effort to make an easy to use HOWTO like this. It's much needed.

There is one piece for mounting NFS that You may want to consider
to mention. It's the automounter, (or autofs). When installed and enabled for NFS (uncommoent the auto.net-line in /etc/auto.master) it
becomes very easy to use NFS.
NFS-shares will be automatically mounted when accessed (if permitted
of course). Only caveat is You need to know and type the name of the
server. I.e.
% ls /net/nfs-server1
will list the shares from that server that You are allowed to see.
It also works to type the path in nautilus.

Next step is to put users home directories on /net/server/home/user,
but thats another (longer) story.

Regards
PeO

dgrafix
October 23rd, 2007, 11:35 PM
WOW! This is much better than using Linux -->samba -->Linux

I have used the text file configuration of 'export' and 'smb.conf' for both SMB and NFS so both my ubuntu laptop and windows laptop can access my server shares. However is doing this dangerous in any way?

TheRealMikeD
November 3rd, 2007, 11:41 PM
I have skimmed through all 18 pages of posts in this thread, and haven't seen anything about using Windows as a client to access NFS shared files on an Ubuntu box.

I have an Ubuntu 6.06 server and I would like to be able to access its files on my WinXP Pro box. The XP box is running Windows Services For Unix (WSFU). I have a similar setup at work, with WinXP and a FreeBSD machine, which works like a champ, but I am having problems getting it to work with Ubuntu.

I can see the shares from the XP box but:

A) My home dir seems to be read-only, when accessed through the share.
B) Write operations from Windows to the NFS shares seem to be slow/unreliable, especially with larger files.

Here is my exports file:


/home/ 192.168.0.2(rw,sync,no_root_squash)
/var/www 192.168.0.2(rw,sync)
/tmp/share 192.168.0.2(rw,sync,no_root_squash)


Anyone have any experience with this? Am I better off using Samba for a Windows client?

Thanks!
-Mike D.

dgrafix
November 4th, 2007, 12:26 AM
I think i read somewhere as well as "client for microsoft networks" you can add "client for unix networks" but ive no idea where one would get such a thing :-?

Lambert
November 4th, 2007, 02:15 AM
TheRealMikeD:

Look into an app called sfu (windows services for unix).

Here's an older post on it.

http://ubuntuforums.org/showthread.php?t=310168

Jose Catre-Vandis
November 4th, 2007, 02:23 AM
TheRealMikeD:

Look into an app called sfu (windows services for unix).

Here's an older post on it.

http://ubuntuforums.org/showthread.php?t=310168

Waddaya mean older post? :lol: The main bulk still stands true for XP, though folks have mucho trouble with access permissions for a variety of reasons.

If you have Vista (Ultimate - maybe in lesser versions?), you can enable NFS access through "Features"

LuisC-SM
November 4th, 2007, 03:21 PM
The problem with NFS shares and windows (in my case) has always been the speed. It's so slow that I always end up using SMB.
I don't know if anyone experiences the same with XP ?
Cheers
Luis

EDIT: @Jose.
Very nice howto, too bad I did not see it before, I have only one machine with winXP that I don't use except when I want to do some photoshop things, so I'll try it next week. Thanks a lot mate

ZootNerper
November 6th, 2007, 11:58 AM
Hi Folks,

I followed the Howto and now have a client that can access files on the server, no problems. Both running Gutsy. But how to I get the server to see files on the client? Do I have to set up a separate client server the opposite way round?

Thanks,

-- Zoot

316097
November 18th, 2007, 07:38 PM
/etc/exports on my server, a machine running Mythbuntu 7.10


/hdd/tv-programs *(rw,no_root_squash,no_subtree_check,async)
/hdd/music *(rw,no_root_squash,no_subtree_check,async)
/hdd/movies *(rw,no_root_squash,no_subtree_check,async)
/hdd/dump *(rw,no_root_squash,no_subtree_check,async)
/etc/fstab on one of my clients, running Kubuntu 7.10


192.168.1.10:/hdd/tv-programs /home/public/tv-programs nfs rsize=8192,wsize=8192,timeo=14,intr
192.168.1.10:/hdd/music /home/public/music nfs rsize=8192,wsize=8192,timeo=14,intr
192.168.1.10:/hdd/movies /home/public/movies nfs rsize=8192,wsize=8192,timeo=14,intr
192.168.1.10:/hdd/dump /home/public/dump nfs rsize=8192,wsize=8192,timeo=14,intr
These lines did the trick for me when my server was running LinuxMCE/Kubuntu, but now when I switched to Mythbuntu instead it doesn't work as it's supposed to.

For example - the "tv-programs" shared on the server gets mounted in all the directories on the client.

Can anyone explain this strange behaviour?

TruckStuff
November 21st, 2007, 07:46 PM
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 just setup an NFS server on Ubuntu 7.10 server. Using these options, I was (eventually) able to mount. However, I also had an additional problem. OS X (Leopard) refused to mount, kept saying operation timed out:
$ sudo mount server:/mnt/share /Volumes/share
mount_nfs: bad MNT RPC: RPC: Timed out\n
mount_nfs: bad MNT RPC: RPC: Timed out\n
mount_nfs: can't access /mnt/share: Permission denied I finally found the answer here:

http://www.linuxquestions.org/questions/debian-26/mountd-time-out-mountnfs-bad-mnt-rpc-rpc-timed-out-on-client-330811/

By adding the name of the client to /etc/hosts, OS X started up right away. Don't ask me why NFS is trying to resolve names, but it seems to be.

r!ots
November 26th, 2007, 11:36 PM
today i setup my desktop as a nfs-server and my laptop as a nfs-client. i was able to mount the exported folders, until then everything worked out alright.

but when i started copying files from my desktop pc to the notebook the troubles began. i have a 40 GB music collection on my desktop pc which i want to transfer to my notebook but somehow the speed doesn't stay at a constant level. it starts at around 1.4 MB/s, which would be fine, but after the first 5 or so files are copied it drops to somewhere between 0 and 30 kb/s. thus it will never finish.
does anyone have any idea why this happens?


edit:
If I boot the desktop PC into w2k and access it from the notebook via SAMBA I get a 3 MB/s speed transfering files to the desktop PC and 1-2 MB/s transfering files from it. Why is there a speed difference between up- and downloading? Is it affected by the size of the files I transfer (the one I uploaded was 2 GB and the downloaded ones were mp3-files which were about 3-10 MB)? Why does the speed stay at a more or less high and constant level using SAMBA and doesn't using NFS? I don't get it.

btw: Do you know a good program to synchronize the content of two folders? So I see which files I got on my notebook and which I still need to put on it from the desktop pc and vice versa?

TheWizzard
December 7th, 2007, 06:20 PM
great howto, thanks!

one thing i don't understand is the rsize=8192,wsize=8192,timeo=14 part in the fstab. this doesn't seem to work for me.

just for your information: someone copied the howto to his website without giving you credit.
http://www.ubuntugeek.com/nfs-server-and-client-configuration-in-ubuntu.html
http://whois.domaintools.com/ubuntugeek.com

bodhi.zazen
December 7th, 2007, 09:06 PM
great howto, thanks!

one thing i don't understand is the rsize=8192,wsize=8192,timeo=14 part in the fstab. this doesn't seem to work for me.

just for your information: someone copied the howto to his website without giving you credit.
http://www.ubuntugeek.com/nfs-server-and-client-configuration-in-ubuntu.html
http://whois.domaintools.com/ubuntugeek.com

LOL

see man nfs for options :

http://linux.die.net/man/5/nfs


rsize=n
The number of bytes NFS uses when reading files from an NFS server. The rsize is negotiated between the server and client to determine the largest block size that both can support. The value specified by this option is the maximum size that could be used; however, the actual size used may be smaller. Note: Setting this size to a value less than the largest supported block size will adversely affect performance.


wsize=n
The number of bytes NFS uses when writing files to an NFS server. The wsize is negotiated between the server and client to determine the largest block size that both can support. The value specified by this option is the maximum size that could be used; however, the actual size used may be smaller. Note: Setting this size to a value less than the largest supported block size will adversely affect performance.


timeo=n
The value in tenths of a second before sending the first retransmission after an RPC timeout. The default value is 7 tenths of a second. After the first timeout, the timeout is doubled after each successive timeout until a maximum timeout of 60 seconds is reached or the enough retransmissions have occured to cause a major timeout. Then, if the filesystem is hard mounted, each new timeout cascade restarts at twice the initial value of the previous cascade, again doubling at each retransmission. The maximum timeout is always 60 seconds. Better overall performance may be achieved by increasing the timeout when mounting on a busy network, to a slow server, or through several routers or gateways.

And on ....

Or this :

http://www.debianadmin.com/network-file-system-nfs-server-and-client-configuration-in-debian.htmlprint/


NFS Performance Tuning

NFS does not need a fast processor or a lot of memory. I/O is the bottleneck, so fast disks and a fast network help. If you use IDE disks, use hdparam to tune them for optimal transfer rates. If you support multiple, simultaneous users, consider paying for SCSI disks; SCSI can schedule multiple, interleaved requests much more intelligently than IDE can.

On the software side, by far the most effective step you can take is to optimize the NFS block size. NFS transfers data in chunks. If the chunks are too small, your computers spend more time processing chunk headers than moving bits. If the chunks are too large, your computers move more bits than they need to for a given set of data. To optimize the NFS block size, measure the transfer time for various block size values. Here is a measurement of the transfer time for a 256 MB file full of zeros.

# mount files.first.com:/home /mnt -o rw,wsize=1024
# time dd if=/dev/zero of=/mnt/test bs=16k count=16k
16384+0 records in
16384+0 records out

real 0m32.207s
user 0m0.000s
sys 0m0.990s

# umount /mnt

This corresponds to a throughput of 63 Mb/s.
Try writing with block sizes of 1024, 2048, 4096, and 8192 bytes (if you use NFS v3, you can try 16384 and 32768, too) and measuring the time required for each. In order to get an idea of the uncertainly in your measurements, repeat each measurement several times. In order to defeat caching, be sure to unmount and remount between measurements.

# mount files.first.com:/home /mnt -o ro,rsize=1024
# time dd if=/mnt/test of=/dev/null bs=16k
16384+0 records in
16384+0 records out

real 0m26.772s
user 0m0.010s
sys 0m0.530s

# umount /mnt

Your optimal block sizes for both reading and writing will almost certainly exceed 1024 bytes. It may occur that, like mine, your data do not indicate a clear optimum, but instead seem to approach an asymptote as block size is increased. In this case, you should pick the lowest block size which gets you close to the asymptote, rather than the highest available block size; anecdotal evidence indicates that too large block sizes can cause problems.

Once you have decided on an rsize and wsize, be sure to write them into your clients’ /etc/fstab. You might also consider specifying the noatime option.

:twisted:

nwadams
December 13th, 2007, 04:20 AM
so i can mount certain files but not others
my /etc/exports file has the line
/media/320 192.168.0.117(rw)

and then i go: sudo exportfs -a and i get
nwadams@nwadams-desktop:~$ sudo exportfs -a
exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.0.117:/media/320".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x
exportfs: Warning: /media/320 does not support NFS export.


now i can mount my home partition, but i can't mount this one, would it have something to do with how it says it is owned by root?

Thanks

TheWizzard
December 13th, 2007, 06:02 PM
what are you trying to do? share a media device on your network?

the /media folder is a bit special. try to mount the media device on /mnt/320
(you'll need to create the mountpoint).

nwadams
December 13th, 2007, 09:24 PM
i think i figured it out, i can't mount an ntfs drive with nfs can I...that was the problem, stupid me...umm how would I share an ntfs drive to another computer with ubuntu...thanks

bodhi.zazen
December 13th, 2007, 11:46 PM
You may be able to do it with samba

jrickard
December 18th, 2007, 04:51 AM
Very nice Howto: on NFS

There seems to be a lot of questions about mounting automatically. The problem arises when you are taking servers and clients up and down and a number of users seem to want it to act like windows or SAMBA and just "be there". Some of the heavy scripting solutions seem to me a little odd.

AUTOFS has been around for nearly a decade. Basically, it mounts a network resource when you access it. And only then. After a minute or so of activity, (configurable) it lets it go. It starts automatically on bootup.

I have a little miniPC setup to run GPHOTO2 to operate a Canon camera in remote capture mode. It captures an image from the camera and does some processing on it to annotate it with today's date, crop it, resize it to 1920x1080, normalize it, and so forth. Then it pokes the image into my web server (http://www.oldcapebridge.com). In this way, I get high resolution camera images on the web site.

If I take down the web server, I don't want to have to go to the camera location and remount the NFS so the camserver can find the directory on the web server. AUTOFS works fine for this. If the web server is down, the camserver keeps taking images, but is unable to post them. When the web server comes back up, it can.

autofs does not come with the Gutsy distribution.


sudo apt-get install autofs

This will install autofs and set it up to come up automatically each time you boot
your system.

To configure it, you have to create a mountpoint in your file system, and configure two files in /etc/. They are not hard, but not evident either.


sudo mkdir /mnt

This simply creates a directory titled /mnt on your root filesystem. This is where you will find the NFS shares.

Let's edit /etc/auto.master with an editor.


sudo gedit /etc/auto.master



#
# $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#/misc /etc/auto.misc --timeout=60
#/smb /etc/auto.smb
#/misc /etc/auto.misc
#/net /etc/auto.net
/mnt /etc/auto.ubuntumini --timeou=300 --ghost


All the lines in the file are normally commented out. I have added a single line to the bottom.

/mnt is the mountpoint. It relates to the directory we just created. This is where autofs mounts everything.

/etc/auto.ubuntumini is where we keep another file listing our NFS mounts. It can be any file name in any directory actually. But the default is /etc/auto.misc which I leave for later examination. We're going to create this /etc/auto.ubuntumini file in a moment. What matters is that the file matches this entry in /etc/auto.master.

--timeout=300. This determines how "persistent" the share is. I have mine set to 300 seconds (five minutes). There are numerous forums online where you can discuss this heatedly and repeatedly.

--ghost is a bit interesting. Normally, if you look under /mnt, you won't actually see anything. If you know to access /mnt/ubuntumini, for example, then it will appear. --ghost makes it appear whether you access it or not. I'm not sure why you WOULDN'T want it ghosted. I always do.

So we have an entry in our auto.master file that points to our mount point, points to our configuration file, and sets a couple of options. Let's look at my /etc/auto.ubuntumini file.


sudo gedit /etc/auto.ubuntumini



#
# $Id: auto.misc,v 1.2 2003/09/29 08:22:35 raven Exp $
#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage

#cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom

# the following entries are samples to pique your imagination
#linux -ro,soft,intr ftp.example.org:/pub/linux
#boot -fstype=ext2 :/dev/hda1
#floppy -fstype=auto :/dev/fd0
#floppy -fstype=ext2 :/dev/fd0
#e2floppy -fstype=ext2 :/dev/fd0
#jaz -fstype=ext2 :/dev/sdc1
#removable -fstype=ext2 :/dev/hdd
ubuntumini -fstype=nfs,-rsize=8192,wsize=8192,soft,timeo=14,rw 169.254.200.200:/home/jrickard
ubuntuminiwww -fstype=nfs,-rsize=8192,wsize=8192,soft,timeo=14,rw 169.254.200.200:/var/www
videomonster -fstype=nfs,-rsize=8192,wsize=8192,soft,timeo=14,rw 169.254.200.230:/home/jrickard
videomonsterwww -fstype=nfs,-rsize=8192,wsize=8192,soft,timeo=14,rw 169.254.200.230:/var/www
miniTX -fstype=nfs,-rsize=8192,wsize=8192,soft,timeo=14,rw 169.254.200.201:/



Again, we have lines commented out by # and five lines I've added.

The left most field is the name of the subdirectory that will appear under /mnt. In my case, I have ubuntumini, ubuntuminiwww, videomonster, videomonsterwww and miniTX.

The next field is somewhat familiar from your fstab file. But in this case, we note a -fstype=nfs before our rsize, wsize, timeout, and read/write. There is also a SOFT entry. Frankly, I can't recall why I chose SOFT but it has something to do with how autofs tries to access a nonexistent (downserver) type of directory.

The rightmost field, again similar to our regular NFS setups, indicates the host:/directory we want to mount. These of course MUST already be setup on the remote machines using NFS server, the regular export fucntions from /etc/exports, etc. just as we normally do with NFS.

In my case, I mounted my home directory, as well as the web server directory on two machines, videomonster and ubuntumini. I actually mounted the root file system on miniTX which is the cam server.

One element of note. BOTH the AUTO.MASTER and AUTO.UBUNTUMINI files require a blank line with line feed after the last entry. Just an anomaly as to the way the software reads lines until it reaches an end of file. But don't forget them.

The auto.misc file I copied had the CD entry uncommented. This has the effect of mounting your CD-ROM in /mnt. WHich gives you some idea of some other things you can do with autofs.

Once our files are saved. We can load the files into autofs with the following command:


sudo /etc/init.d/autofs restart

This will shut down autofs, and then bring it back up. It reloads the master file, and subsequently the auto.ubuntumini file as it comes back up.

You should now be able to go to /mnt and see the files.

j
rickard@Mozart:~$ cd /mnt
jrickard@Mozart:/mnt$ ls
miniTX ubuntumini ubuntuminiwww videomonster videomonsterwww


jrickard@Mozart:/mnt$ cd miniTX
jrickard@Mozart:/mnt/miniTX$ ls
bin debian-binary home lib mnt root sys var
boot dev initrd lost+found opt sbin tmp vmlinuz
cdrom etc initrd.img media proc srv usr
jrickard@Mozart:/mnt/miniTX$

I noted about a ten second delay when I did the cd miniTX command and a slight when when I entered ls. That was when it was actually mounted. Subsequent actions in that directory were much quicker.

I do hope this helps with the automounting problems. The fstab entry is a little bit iffy for me. Sometimes it seems to load my shares, and sometimes not. autofs seems a bit more reliable, and it cuts down on network traffic. If your share timesout, it drops it. You only generate maintenance traffic when you use it and during the timeout afterwards.

Oh, you don't need to do ANYTHING to make this happen the next time you reboot. autofs is setup on installation to come up when the system boots.

Jack Rickard

LuisC-SM
December 23rd, 2007, 02:30 AM
@Jack Richard

Thanks a lot for this nice howto

This is something I've already used in Mandriva and SuSE but I did not know it was AUTOFS. I was thinking this was some kind of script made by some linux gurus in those distros but now I've confirmed it's not.

Again, thanks a lot. Everyday we learn something new :guitar:

Kind Regards

Luis.

PS. I believe this should be already installed in ubuntu by default

methodical
December 31st, 2007, 09:31 PM
Edit: Solved

arunpc
January 3rd, 2008, 06:59 AM
Hi,
Check whether your NFS server is working properly. If you are sure of that, it should be wrong entry of the credentials.

I have seen this error happening to me and it has mostly been improper credientials. Make sure you have not missed out on capital letters for folder names.

Thanks,
Arun.PC
www.arunpc.wordpress.com

exactopposite
January 8th, 2008, 05:00 PM
great how to. i used this a compule of months ago to set up my network and i forgot to come back and say thanks.

noremac
January 14th, 2008, 07:17 PM
I imagine this should be easier than I am making it, but I am trying to share a folder on my laptop as to transfer files over to my desktop with a Netgear router between them. I have shared the folder on the laptop(Xubuntu) using NFS. Here is what I put into term and what I get out of it.



cameron@cameron-desktop:~$ sudo mount -t nfs cameron-laptop:/home/cameron /home/cameron/Desktop/laptop/
mount.nfs: can't get address for cameron-laptop


So am I sharing my /home/cameron folder on my laptop, trying to mount it to a laptop folder on my desktop of my Desktop computer. On the laptop, I wasn't sure what to put in as the allowed host so I have put in the name of my desktop computer, the router given IP of my desktop, and and subnet mask.

Fairly new to all this stuff, so I expect the answer is right under my nose...thanks for any help.

-Cameron

bodhi.zazen
January 14th, 2008, 09:25 PM
Try using the ip address for you laptop rather then host name.

If you want to use host name, place it in /etc/hosts

Add this :

xxx.xxx.x.xxx cameron-laptop

to etc/hosts where xxx.xxx.x.xxx is the laptop ip address

noremac
January 14th, 2008, 10:01 PM
After I did what you said, I was getting permission denied. Did a bit of Googling and found that I needed to change the /etc/export on the server, and now works like a charm. Thanks. Appreciate you getting me on the right step.
-Cameron

billgoldberg
January 17th, 2008, 01:50 AM
This isn't working for me.

I want to share the /home/username folder from 192.168.1.4 with 192.168.1.3

When I want to mount in the terminal using 'sudo mount 192.168.1.4:/home/username /home/username'

All i get is; already mounted (in more words)

When I go to the network folder, all i see is windows pc (wich i don't have :p)

Could someone give me a step by step walkthrough of all the exact steps that has to be done on both pc's. I like computers and use linux all the time but when it comes to networks i'm lost. It goes without saying that I will thanks the one who does.

I've been struggeling with sharing files between my two ubuntu boxes since feisty came out, i'm now on gutsy :confused: (it never worked)

swampy5
January 17th, 2008, 12:51 PM
If its any consolation I had nfs working under feisty and then lost it when I upgraded to gutsy - but after a lot of grief I eventually got nfs to work again.
Could you post the /etc/exports file on the 192.168.1.4 computer so we can check its ok?
You can check for basic connectivity with a ping command of course. If you can ping each other then it should be plain sailing - but it never is is it :(

bodhi.zazen
January 17th, 2008, 08:05 PM
This isn't working for me.

I want to share the /home/username folder from 192.168.1.4 with 192.168.1.3

When I want to mount in the terminal using 'sudo mount 192.168.1.4:/home/username /home/username'

All i get is; already mounted (in more words)

When I go to the network folder, all i see is windows pc (wich i don't have :p)

Could someone give me a step by step walkthrough of all the exact steps that has to be done on both pc's. I like computers and use linux all the time but when it comes to networks i'm lost. It goes without saying that I will thanks the one who does.

I've been struggeling with sharing files between my two ubuntu boxes since feisty came out, i'm now on gutsy :confused: (it never worked)

First, try an alternate mount point

mkdir /home/username/share
sudo mount 192.168.1.4:/home/username /home/username/share

Second, review your settings in /etc/exports

Third, Firewall ? error message when you mount ?

katibi
January 24th, 2008, 02:11 AM
I have attempted to complete the instructions and I am still unable to remotely access a second computer on a LAN. This is the error I receive:

mount.nfs: 192.168.0.103:/katibi failed, reason given by server: Permission denied

I have checked all my settings, and made sure I followed every step carefully. I have confirmed the contents of

hosts
hosts.allow
hosts.deny
exports

on both the client and the server machines.

I am able to ping the client from the server, and the server from the client. I can ping the router from either machine.

I have created a directory /username which has the same username as the client computer, and the same UID.

Nothing seems to work.

I love linux, and I find it disappointing that I am not able to get NFS to work. I spent an entire evening attempting to get vsftp to work without any success (although I can ftp to servers on the internet). These sorts of things should be easier to get up and running than on windows, but they still are not.

joeashcraft
January 28th, 2008, 05:24 AM
NFS blows my mind. I love it!
Now I don't have to worry about using up all the HD space on my laptop, nor do I need to use slow FTP to r&w files to my server. I can mount NFS and download files to a remote computer transparently.
Now if I could figure out how to do this while not on the same LAN... anyone?

joeashcraft
January 28th, 2008, 05:28 AM
@katibi
What's your /etc/exports have? If you copy/pasted you may have an error in there. I'm thinking 192.168.1.1 instead of 192.168.0.1
hopefully it's that simple

S.Tokarev
January 29th, 2008, 11:14 AM
Kubuntu 7.10 nfs client doesn't mount nfs share from nfs server at boot time. No log errors or any log entries.

While when I issue from the command line


sudo mount -a

it mounts the share (auto flag presents) and I can go on.

What could be the problem ? It seems it doesnt try to mount nfs shares from fstab at all. what script from init.d is responsible for mounting ?
Additional: the workstation boots using dhcp/tftp/nfs successfuly and kdm starts ok.

well ... I think I figured the solution out.

TheWizzard
January 29th, 2008, 06:27 PM
can you share your solution?

i have the same issue although automounting used to work...

svennils
January 30th, 2008, 12:15 AM
Ok, so i have tinkered around with NFS to replace my samba server.
Everything works fine, except the user squashing.
Server has a few user accounts, sven (1000 and www (1001) are the important ones. My laptop has 2, sven (1000) & bfu(1001).
All data disks on the server are owned by www, since the few users i have given access for useing my web server are not supposed to read these disks, hence permissions 700 on these files too. Samba runs with force user:www, so it has access, and is only activated on the local interface on my own subnet.(the box is a Qos internet router as well) When i mount the nfs share on my laptop, regardless of all_squash status, it changes owner of the mount point on the laptop to bfu(1001), which corresponds to owner of the disk on the server (www,1001). Bfu has 700 permissions on its files, and not even root on the laptop can access the mount point then. So how do i force the user mapping to something else?
etc/exports looks like this:
/mnt/hdf 192.168.1.1/24(rw,async,all_squash,anonuid=1000,anongid=1000)
anonuid and gid have no effect no matter what i set them. if i change ownership on the server, i can access things normally, but this is not an option.
Server runs ubuntu server,7.10, laptop runs 7.10 desktop.
Any ideas?

jarthel
February 4th, 2008, 01:40 PM
does anyone know of a tutorial for NFS + kerberos? The one in the wiki is very vague.

Thank you.

couzin2000
February 26th, 2008, 10:57 PM
Thanks for the tutorial... very easy, and very helpful - however I do have one small problem that I don't understand. Here's my terminal output:

sebastien@sebastien-desktop:~$ 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...
exportfs: Warning: /home/sebastien/Azureus Downloads does not support NFS export.
[ OK ]
* Starting NFS kernel daemon [ OK ]
sebastien@sebastien-desktop:~$

Why is the share not supported? Is this to do with permissions, or with which format the drive is in... another program running maybe?

Jose Catre-Vandis
February 28th, 2008, 12:25 AM
Thanks for the tutorial... very easy, and very helpful - however I do have one small problem that I don't understand. Here's my terminal output:

sebastien@sebastien-desktop:~$ 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...
exportfs: Warning: /home/sebastien/Azureus Downloads does not support NFS export.
[ OK ]
* Starting NFS kernel daemon [ OK ]
sebastien@sebastien-desktop:~$

Why is the share not supported? Is this to do with permissions, or with which format the drive is in... another program running maybe?

It is most likely the space between Azureus and Downloads. Rename it to be spaceless, or put in double quotes.

Graphite
March 1st, 2008, 10:57 PM
I can't persuade this tutorial to work for me.

Server:
PC running Ubuntu 6.06
IP address 192.168.2.4

Client:
Laptop running Ubuntu 7.10
IP address 192.168.2.3

The two computers are hooked up to a router, through which they can access the internet. Each of the computers is able to ping the other.

In the server computer I typed:

cd /
sudo gedit etc/exports

...and saved the file containing this:

# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
/home/bugs 192.168.2.3(rw,no_root_squash,async)
After saving that file I ran

bugs@bugs-desktop:/$ sudo /etc/init.d/nfs-kernel-server restart
* Stopping rps mountd... [ok]
* Stopping rpc nfsd... [ok]
* Unexporting directories for NFS kernel daemon... [ok]
* Exporting directories for NFS kernel daemon... [ok]
* Starting rpc nfsd... [ok]
* Starting rpc mountd... [ok]
bugs@bugs-desktop:/$ sudo exportfs -a
bugs@bugs-desktop:/$

Then on the client laptop:

bugs@bugs-laptop:~$ cd /
bugs@bugs-laptop:/$ sudo mkdir files
bugs@bugs-laptop:/$ sudo mount 192.168.2.4:/home/bugs /files
mount.nfs: mount to NFS server '192.168.2.4' failed: timed out, retrying
mount.nfs: mount to NFS server '192.168.2.4' failed: timed out, retrying
bugs@bugs-laptop:/$


Does anyone know what the problem here is?
I started trying the GUI approach (System>administration>Shared Folders) with no success and now this isn't working either. I've spent hours reading and experimenting and it's driving me crazy!

dgrafix
March 3rd, 2008, 01:14 AM
Can you ping it and do you have the correct ports open?

One thing i did when i set this up was to do this, im not sure what it does exactly but it was in the how to i followed:

After doing that bit you did above:

sudo dpkg-reconfigure portmap
sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-kernel-server restart

Ps, i dont know weather you want this or not, but if you want to make it available to your whole lan use: 192.168.2.1/24 in the exports. This will allow any pc with the first 24bits / 3 bytes (192.168.2)

grahamandchenine
March 5th, 2008, 11:18 AM
Just to add the thumbs up.

Worked a treat.

Not sure why it needs to be more complicated than a Fedora server, but seems far more reliable.

THX.:KS

MountainX
April 1st, 2008, 05:33 PM
Differences in maximum block sizes between client/server file systems can cause programs to crash

Those are all nice tips! Could you explain the above in more detail? How do we make sure we avoid this problem?

I set up two different shares that are both located on the same drive on the server with different block size definitions as shown below. Is this a problem?

Client fstab:
192.168.100.3:/SmallDataFiles /home/myuser/SmallDataFiles nfs nocto,rw,rsize=8192,wsize=8192,hard,intr 0 0

192.168.100.3:/Music /home/myuser/Music nfs nocto,rw,rsize=32768,wsize=32768,hard,intr 0 0

konus
April 3rd, 2008, 05:21 PM
This really help me .... Thanx!!!

MountainX
April 5th, 2008, 02:49 AM
Can anyone install a deb (using GDebi) from a network share (nfs)? When I browse to the nfs share in nautilus and right click the deb file and install it the installer crashes. If I copy the file to the local HDD, the installer works fine. Is this an nfs issue?

Tzuikka
April 5th, 2008, 07:33 AM
Hi!
I'm having the exact same problem as Graphite has.


Then on the client laptop:
Code:

bugs@bugs-laptop:~$ cd /
bugs@bugs-laptop:/$ sudo mkdir files
bugs@bugs-laptop:/$ sudo mount 192.168.2.4:/home/bugs /files
mount.nfs: mount to NFS server '192.168.2.4' failed: timed out, retrying
mount.nfs: mount to NFS server '192.168.2.4' failed: timed out, retrying
bugs@bugs-laptop:/$

I'm quite sure that I have opened the necessary ports and can ping both, the server and the client.

This is getting really frustrating :confused:
Has anyone found a solution for this?

jammer84
May 2nd, 2008, 09:10 PM
Cheers mate, This worked a dream!!!

couzin2000
May 2nd, 2008, 09:27 PM
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.1/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


I'd love to find out about these keywords here:

rw
ro
no_root_squash
async
sync
no_subtree_check
And more...

I have no idea what most of these mean or what they do. Is there a complete reference that exists out there? Or can you just find this in a buried help file?

Awesome work for the howto, BTW - came in very useful.
Should be worthy of mention that NTFS-formatted drives cannot be shared through NFS. I am currently working on changing my drive's format, since I have a whopping 500Gb that I would not be able to access.

As well, would be interesting to find out how BOTH Samba AND NFS can coexist? I'm fairly new at doing this on Ubuntu because I have a Windows background, but I would love to find a howto for both.
Thanks again, great work!

PS just found a LOT of helpful info here: https://help.ubuntu.com/community/SettingUpNFSHowTo. This actually helped me get it working for the first time! Might be worth putting up into the Howto!

DaveinSpain
May 3rd, 2008, 07:43 AM
Thanks for a wonderfully easy tutorial. Everything worked fine right up to

sudo mount server.mydomain.com:/files /files

I have 2 computers, hostnames LANDING and DOWNSTAIRS, both connected via fast ethernet switch to my DHCP modem which gives Internet access to both machines via a wired LAN without any problems.

DOWNSTAIRS having been set up as the server as per tutorial, after creating /files on LANDING I entered

sudo mount DOWNSTAIRS:/Shared /files

Shared being a shared folder on each machine.

This produced "Can't get address for DOWNSTAIRS

Did

sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-common restart

Sames result.

This didn't really surprise me as in over a year I have never yet managed to get these two machines to see each other in linux. (******* does it without missing a step so I know it can be done)

Having had much advice from many forums, the problem appears to be that I do not appear to have a private IP address for either machine. I found one of 192.168.1.3 in the Windows configuration (same on both machines) but that appears to be my access to my ISP (either that or Vista and XP are using a Debian Apache server!). Both machines only have the 1 network interface (eth0) and ifconfig just shows the information for that (public IP address) and lo.

Any suggestions?

Many thanks in advance to all who reply.

Dave

Just thought I'd add the contents of /etc/hosts

127.0.0.1 localhost
127.0.1.1 DOWNSTAIRS

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

127.0.0.1 localhost
127.0.1.1 LANDING

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

couzin2000
May 4th, 2008, 02:08 PM
Here's another bug I just encountered. After finally getting both PCs to work together, and establishing a working NFS link, I continued to follow the instructions at http://help.ubuntu.com/community/SettingUpNFSHowTo and installed autofs.

When installed, this thing is supposed to automount the available shares on my server. It refers to a auto.master file, which in turn refers to multiple auto.something files, to group and allow easy access to mounts.

When updating my auto.master file, I inserted
/home/username/Desktop/username-desktop /etc/auto.homeand created another /etc/auto.home file with the following entry:
* 192.168.0.155:/media/Downloads

This actually works, and I get the expected result: I see the contents of the /media/Downloads folder from my 192.xxxxx-located server in my client laptop when I open the /home/username/Desktop/username-desktop folder.

BUT - I also see automatic drive icons appear on my client's desktop once the connection's automount is valid, and these are named .Trash and .Trash-1000. These have drive icons (not trash can icons) and appear by themselves. They contain the same as the mount point folder I set up on the desktop.

Where do these come from, and how to I get rid of them, or make them NOT appear?

DaveinSpain
May 4th, 2008, 07:51 PM
Poking around it seems that Windows is using a VPN to access it's shares. I have tried setting one up in Linux, but with exactly the same result - i.e. the machines can't see each other. I have tried disconnecting the patch lead from the switch to the modem and switching off the firewall but it made no difference.

Please, does anybody have any ideas what might be going on here?:confused:

bodhi.zazen
May 4th, 2008, 09:24 PM
I'd love to find out about these keywords here:

rw
ro
no_root_squash
async
sync
no_subtree_check
And more...

I have no idea what most of these mean or what they do. Is there a complete reference that exists out there? Or can you just find this in a buried help file?

Nope, man pages.

From here : http://www.novell.com/coolsolutions/feature/15986.html


There are many options for shares. Here are some of the most common:

root_squash - Maps the root user to the nobody user. This has the effect of not allowing a root user on a client to gain root file access permissions on the server.
no_root_squash - Does not map the root user to the nobody user. The root user on a client has the same rights as the root user on the server.
all_squash - Maps all the UIDs and GIDs to the nobody user. This is useful if the share is to have anonymous access, much like an anonymous FTP server.
anonuid, anongid - If root_squash and all_squash are used, the UIDs and GIDs are mapped to the specified UID and GID instead of the nobody user.
ro - Forces all files on the share to be read-only. This is the default behavior.
rw - Allows write access to the share.
sync - Ensures data is written to disk before another request is serviced.

Additional options here : http://linux.die.net/man/5/exports

Or in a more detailed technical documentation of NFS.


As well, would be interesting to find out how BOTH Samba AND NFS can coexist? I'm fairly new at doing this on Ubuntu because I have a Windows background, but I would love to find a howto for both.
Thanks again, great work!

Samba works out of the box and allows sharing of both files and printers. IMO it is also more secure as shares require a username and password, and can be "hidden".

https://help.ubuntu.com/community/SettingUpSamba

Ghost-syn
May 9th, 2008, 10:26 AM
Hello, Thanks for the FAQ. I followed it and everything is working perfectly. As im not sure if im supposed to post it in a new topic ill try my luck, apologies for any n00bieism.

Im using NFS to share out the home directories of the workstations to the newly created NFS server (latest debian). There wasnt any problems mounting the share, in the beginning...

However as i added another workstation(all 8.04) things started to become inconsistent with mounting of the home folder. My ultimate goal is to have a consistent home folder across all workstations that the teachers use but cannot change (wallpaper, icons etc).

Where should i be looking to solve the issue? The server?, workstations? or is this something thats considered bad design ( all home folders mounted to a single unchanging home folder via NFS server)

Any help would be greeeeeatly appreciated :). Any information needed i can provide.

phelan_ward
May 21st, 2008, 07:25 AM
Here seems to be a real bug in nfs since version 1.1.2 of the
nfs-utils. Its already postet:

https://bugs.launchpad.net/ubuntu/+bug/213444

Has anyone an idea?

Junosix
June 2nd, 2008, 08:50 AM
Just wanted to say thanks for that guide. I don't know why but I was a bit scared of NFS as everyone talks about Samba instead, but in fact I much prefer it, it seems a lot quicker and robust. Got my girlfriend's Windows computer talking to the server by installing Windows Services for UNIX 3.5 from the Microsoft site.

couzin2000
June 4th, 2008, 07:26 PM
Thanks Bodhi, this is exactly what I needed.

I have been reading through this Howto thread, and I may end up rewriting another one because I fear much info has been left aside. Since the original references were very accurate and fairly complete, I would love to see a manual including everything. Hopefully by the time I'm done with this thread there won't be a problem left that cannot be tackled.
Thanks again!!

Coastal Confessions
June 28th, 2008, 01:04 AM
However as i added another workstation(all 8.04) things started to become inconsistent with mounting of the home folder. My ultimate goal is to have a consistent home folder across all workstations that the teachers use but cannot change (wallpaper, icons etc).

Did you set the share to be readonly in /etc/exports?

ptgood
July 4th, 2008, 10:18 PM
I set up an home network with two clients and one server (running Xubuntu and Ubuntu).

I followed this HOW TO: http://czarism.com/easy-peasy-ubuntu-linux-nfs-file-sharing

Everything worked fine, but when i restarted the three machines, i had to restart manually the server kernel with:
sudo /etc/init.d/nfs-kernel-server restart

If i dont do that, when i try to mount the folder from clients, i get this:
mount.nfs: mount to NFS server 'rpcbind' failed: RPC Error: Program not registered


Have you any idea?
why should i restart the server manually every time?

Thanks

Coastal Confessions
July 5th, 2008, 12:10 AM
Everything worked fine, but when i restarted the three machines, i had to restart manually the server kernel with:
sudo /etc/init.d/nfs-kernel-server restart

If i dont do that, when i try to mount the folder from clients, i get this:
mount.nfs: mount to NFS server 'rpcbind' failed: RPC Error: Program not registered

Have you any idea?
why should i restart the server manually every time?

Try using Bootup Manager (bum) to activate the nfs-kernel-server service. See http://www.marzocca.net/linux/bumdocs.html.

Stevi
July 5th, 2008, 10:47 AM
Hi,

thanks for this How-To. It works for me but I think it should be a little bit faster. My Server is running Mythbuntu 8.04 (http://www.mythbuntu.org/) (160 GB IDE HD) and from time to time I'd like to watch some recordings on the client machine (Notebook, Ubuntu Hardy, 120 GB S-ATA HD) but this is impossible due to speed issues.

My computers both are connected via wlan to a Fritz!Box (http://en.wikipedia.org/wiki/FRITZ!Box) Router.

This is my output for a 9,5 MB file:

time command cp /home/stevi/Desktop/test.mp3 /media/mythbuntu

real 0m16.590s
user 0m0.004s
sys 0m0.040s
time command cp /media/mythbuntu/test.mp3 /home/stevi/Desktop

real 0m0.064s
user 0m0.004s
sys 0m0.052s
fstab entry:

192.168.1XX.XX:/home/stevi /media/mythbuntu nfs rsize=8192,wsize=8192,timeo=14,intr

Is the speed okay or could it be faster?

Thanks in advance

Stevi.

tobias_84
July 5th, 2008, 02:30 PM
Hi all.

I tried to read all post but I may have missed it.

Got NFS to work directly but the problem is when I want to create files from the client. If I do 'ls -l' on the client it seem correct but it's the wrong user and group on the server side.

Exempel:


//client-user = a (non_root)
//server-user = b (non_root)


a@client:nfs_mount/path/folder$ mkdir test
a@client:nfs_mount/path/folder$ ls -l
drwxr-xr-x 2 a a 4096 2008-07-05 13:55 test

b@server:nfs_share/path/folder$ ls -l
drwxr-xr-x 2 b b 4096 2008-07-05 13:55 test


The user B doesn't exist on the client, only at the server but user A does exist on both sides.


/etc/passwd
On client:


a:x:1000:1000:a,,,:/home/a:/bin/bash


On server:


b:x:1000:1000:b,,,:/home/b:/bin/bash
a:x:1007:1007:a,,,:/home/a:/bin/bash



Is there a way to specify in /etc/exports witch user that owns it?

/share_a-folder x.x.x.x/x(rw,no_root_squash,async)
/share_b-folder x.x.x.x/x(rw,no_root_squash,async)
/share_c-folder x.x.x.x/x(rw,no_root_squash,async)

so if any user adds something to share_b-folder user b is the owner?



Thanx for any help!

/Tobias

Stevi
July 5th, 2008, 06:41 PM
This is my output for a 9,5 MB file:

time command cp /home/stevi/Desktop/test.mp3 /media/mythbuntu
real 0m16.590s
user 0m0.004s
sys 0m0.040s
time command cp /media/mythbuntu/test.mp3 /home/stevi/Desktop
real 0m0.064s
user 0m0.004s
sys 0m0.052s
fstab entry:

192.168.1XX.XX:/home/stevi /media/mythbuntu nfs rsize=8192,wsize=8192,timeo=14,intr
Is the speed okay or could it be faster?

I played around with my fstab values.

192.168.1XX.XX:/home/stevi /media/mythbuntu nfs rw,noatime,v3,rsize=32768,wsize=32768,udp,hard,int r,noauto,users
File Size again 9,5 MB:

time command cp /home/stevi/Desktop/test3.mp3 /media/mythbuntu
real 0m6.739s
user 0m0.004s
sys 0m0.044s
command cp /media/mythbuntu/test3.mp3 /home/stevi/Desktop
real 0m0.037s
user 0m0.004s
sys 0m0.032s

Watch recordings becomes better (I was able to view ten seconds without hanging ;) ) but is still not good enough. Any other ideas which values could speed things up?

ptgood
July 6th, 2008, 01:52 AM
I set up an home network with two clients and one server (running Xubuntu and Ubuntu).

I followed this HOW TO: http://czarism.com/easy-peasy-ubuntu-linux-nfs-file-sharing

Everything worked fine, but when i restarted the three machines, i had to restart manually the server kernel with:
sudo /etc/init.d/nfs-kernel-server restart

If i dont do that, when i try to mount the folder from clients, i get this:
mount.nfs: mount to NFS server 'rpcbind' failed: RPC Error: Program not registered


Have you any idea?
why should i restart the server manually every time?

Thanks


Try using Bootup Manager (bum) to activate the nfs-kernel-server service. See http://www.marzocca.net/linux/bumdocs.html.I solved

I checked in /etc/rc2.d and there was not nfs-kernel-server at all.

So I opened /etc/init.d, I created a link of nfs-kernel-server, I renamed the link to S20nfs-kernel-server and I copied it in /etc/rc2.d

I rebooted the machines and everything work perfectly!!!

NTolerance
July 25th, 2008, 10:24 PM
Anyone know how to get symlinks working with this? I have some symlinks in a remote share that I'd like access to. But the problem is that the links appear as they do on the remote machine and therefore point to directories that do not exist on the local machine.

Symlinks work fine with Samba shares, so I'm wondering if there's a way to make them work here too.

mitjab
August 18th, 2008, 10:35 AM
i install everything but i do not know how to connect now. In network places i can not see other ubuntu.

dmizer
August 18th, 2008, 02:58 PM
i install everything but i do not know how to connect now. In network places i can not see other ubuntu.

Follow the instructions in the first post below where it says, "Mounting at boot using /etc/fstab"

mitjab
August 18th, 2008, 04:37 PM
i try but not working. Folder is empty or not open it.

arrrghhh
August 20th, 2008, 03:29 AM
Anyone know how to get symlinks working with this? I have some symlinks in a remote share that I'd like access to. But the problem is that the links appear as they do on the remote machine and therefore point to directories that do not exist on the local machine.

Symlinks work fine with Samba shares, so I'm wondering if there's a way to make them work here too.

just use the bind function with mount. it's how i get users to view other disks via ftp. works much better than symlinks (in cases such as this...)

bodhi.zazen
August 20th, 2008, 05:00 AM
+1 bind.

mount --bind /dev /mount_point

arrrghhh
August 21st, 2008, 07:21 AM
well i have an NFS issue now. it seems i cannot export NTFS with NFS - and there have been a lot of potential solutions i found (including installing the latest git of the linux kernel...) but none particularly appealing. i found when i removed nfs-kernel-server and installed nfs-user-server, my NTFS drives mounted! and it was fast! but after more poking around it seems i'm actually using nfsV2... so what i don't get is i'm using an older version of nfs... and it works better? i'd really like to use nfsV4, but if it doesn't export NTFS it doesn't do me a whole lotta good.

rchrdlandis
August 21st, 2008, 09:58 PM
tried you instructions everything went well until I got to
richard@richard-desktop:/etc$ sudo mount /files
mount.nfs: access denied by server while mounting 192.168.2.4:/files
That is what came back. Any ideas? :confused:

Roman0
August 27th, 2008, 12:59 PM
@rchrdlandis

Have you set both server and client on all machines? I had this problem when I tried to export a folder, and mount to it from another server at the same time. Best works for me when one machine acts as a server, the other as a client.

NTolerance
August 27th, 2008, 06:16 PM
just use the bind function with mount. it's how i get users to view other disks via ftp. works much better than symlinks (in cases such as this...)

Yeah, that looks like the proper way to fix it. Shame I already have a ton of symlinks that programs are dependent on. Would take a long time to add them all to /etc/fstab and test them out. :(

trash
September 2nd, 2008, 08:27 PM
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_Directories_via_NFS#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.

Thanks for that link dannyboy it helped clarify my glaring error which was in exports, I had always assumed the machine name was the machine doing the exporting... never thought it would be the client machine:lolflag:

pannerrammer
November 3rd, 2008, 05:34 PM
Hi All.

ubuntu 8.10 appears to revert back to dhcp when you reboot - losing your static ip settings... which will I think cause the nfs described here to fail!

Anyone had the same problem, or got a solution?

Phil

pmorton
November 4th, 2008, 01:53 PM
This a great Howto. But there is a permissions issue that often comes up, and the solution can take a bit of time to track down among the many posts here.

It arises because the user, although registered with the same username and password on both server and client, may not have the same numeric User ID (uid), or be a member of the same group with the same log-in Group ID (gid) on both machines. Why that should affect matters isn't at all clear; if it's not what you'd call a bug, it's certainly none too elegant.

Assume /etc/exports shares the directory /home/public with permissions 770 (drwxrwx---) and ownership root:users. You'd expect all members of the "users" group to get access. But that's not necessarily the case. It depends on their uid and gid on client and server matching, and that's a matter of chance. NFS seems to ignore the names and use the numeric values as identifiers.

To check userx's UID and GID, on each machine do:


id userx

which typically might return:


uid=1001(userx) gid=100(users) groups=100(users),115(admin),...etc..

If userx is not a member of the initial log-in group 'users' on both machines, they must be made so with:


sudo usermod -g users userx

And if either of the uid's and gid's don't match, they must be changed on one machine or the other so that they do, by means of:


sudo usermod -u 1001 userx
sudo groupmod -g 100 users


Then on server do:


sudo exportfs -a
sudo /etc/init.d/nfs-kernel-server restart

And on client do:


sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-common restart

That should fix the Permission Denied error.

scarf
December 17th, 2008, 10:39 AM
i have followed the autofs tutorial on page 20 (http://ubuntuforums.org/showpost.php?p=3971417&postcount=191) and that is working. thanks.

however, i have some other directories in /mnt that i use for other purposes, and i notice that, after starting autofs, those directories disappear (and are inaccessible) and my autofs directories appear. when i stop autofs, the directories come back and are accessible once again. is there any way to get autofs to play nice with the directories that are already in /mnt?

J@n
December 17th, 2008, 07:35 PM
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.

Thanks man!

I did not even have to read the other posts. This did the trick.

Greetz,

J@n

sdyson
December 28th, 2008, 08:00 PM
And if either of the uid's and gid's don't match, they must be changed on one machine or the other so that they do, by means of:


sudo usermod -u 1001 userx
sudo groupmod -g 100 users


I found I had to update the user's GID as well. e.g.


sudo usermod -u 1001 userx
sudo groupmod -g 100 users
sudo usermod -g 100 userx