LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-19-2004, 11:42 AM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,291

Rep: Reputation: 52
NFS problem networking 2 RH9 boxes


I am trying to network 2 Redhat 9 boxes connected to the Internet through a Netcomm NB1300plus4 ADSL Modem/Router/Switch.

This thing has DHCP and has given the IP addresses 192.168.1.13 to the "server" and
192.168.1.6 to the "client"

Kernel is 2.4.20-6 It seems I have to use NFS
NFS not running at boot-up (built as module)
I followed the steps described in 'http://nfs.sourceforge.net/nfs-howto/' but when I try to mount a directory on the client I get the following message:
"mount: 192.168.1.13:/home failed, reason given by server: Permission denied"

root name, user name and passwords are exactly the same on the 2 boxes

Server side
=========
this is the "ls -la" entry from the server from /
drwxr-xr-x 4 rene rene 4096 Sep 13 22:22 home

this is the /etc/exports file on server:
/var 192.168.1.6(ro)
/home 192.168.1.6(ro)

this is the /etc/hosts.deny on server
portmap:ALL
lockd: ALL
mountd: ALL
rquotad: ALL

this is the /etc/hosts.allow on server
portmap: 192.168.1.6
lockd: 192.168.1.6
rquotad: 192.168.1.6
mountd: 192.168.1.6
statd: 192.168.1.6
ALL: localhost
rpc.mountd: ALL

This is the script I used to start it up after booting up
#!/bin/bash
/sbin/insmod nfs
/usr/sbin/rpc.mountd
/usr/sbin/rpc.nfsd
/sbin/rpc.statd
/sbin/rpc.lockd
/usr/sbin/rpc.rquotad

and the result of rpcinfo -p from the server after running previous script
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
391002 2 tcp 32769 sgi_fam
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100021 1 udp 32770 nlockmgr
100021 3 udp 32770 nlockmgr
100021 4 udp 32770 nlockmgr
100005 1 udp 32772 mountd
100005 1 tcp 33101 mountd
100005 2 udp 32772 mountd
100005 2 tcp 33101 mountd
100005 3 udp 32772 mountd
100005 3 tcp 33101 mountd
100011 1 udp 1017 rquotad
100011 2 udp 1017 rquotad
100011 1 tcp 1020 rquotad
100011 2 tcp 1020 rquotad
100024 1 udp 32773 status
100024 1 tcp 33102 status

Client side
========
Script used on client after booting up
#!/bin/bash
/sbin/insmod nfs
/sbin/rpc.lockd
/sbin/rpc.statd

the result of rpcinfo -p from the client after running previous script
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
391002 2 tcp 1025 sgi_fam
100024 1 udp 1028 status
100024 1 tcp 3590 status

result of "ls -la" from /mnt from client
total 23
drwxr-xr-x 5 root root 4096 Oct 19 20:15 .
drwxr-xr-x 19 root root 4096 Oct 19 18:49 ..
drwxr-xr-x 2 root root 4096 Oct 19 10:33 cdrom
drwxr-xr-x 5 rene rene 7168 Oct 20 00:19 floppy
drwxr-xr-x 2 rene rene 4096 Oct 19 20:15 home

Command used on client:
[root@hp rene]# mount 192.168.1.13:/home /mnt/home

I have checked and re-checked many times and I can't work out what is wrong.
Any help or hint most appreciated. If necessary I can disconnect one box from the net and
connect the 2 boxes with a cross-over cable to achieve networking (if this makes a solution easier)

Last edited by rblampain; 10-19-2004 at 10:41 PM.
 
Old 10-19-2004, 10:21 PM   #2
emailssent
Member
 
Registered: Sep 2004
Posts: 312

Rep: Reputation: 30
On the server side, in your NFS share

-tyring chaning its permission to 777,
-change its owner to root for a while....

On the client side mount it by root user


-jack
 
Old 10-19-2004, 10:46 PM   #3
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,291

Original Poster
Rep: Reputation: 52
Thanks to 'emailssent'.

Tried your suggestion, the result is the same.
(I've edited my original post a fraction for clarity of what's been done)
 
Old 10-19-2004, 10:52 PM   #4
emailssent
Member
 
Registered: Sep 2004
Posts: 312

Rep: Reputation: 30
show here ur output of ls -l of ur NFS share ...... of the server


-jack
 
Old 10-20-2004, 03:22 AM   #5
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,291

Original Poster
Rep: Reputation: 52
This is the relevant resulting line from 'ls -la' issued from / (root - lines for other directories ignored)
drwxr-xr-x 4 rene rene 4096 Sep 13 22:22 home

I've found that running the following lines on the client fixes the problem
"/etc/rc.d/init.d/nfs stop"
"/etc/rc.d/init.d/nfs start"

I am now able to see the shared files from (server) /home on the client immediately (/mnt/home) after rebooting and without having to run any script as explained earlier but a new addition (/var) to this system is not giving the expected result, so I'll investigate a bit more and update this post accordingly.

Last edited by rblampain; 10-20-2004 at 03:25 AM.
 
Old 10-21-2004, 06:09 AM   #6
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,291

Original Poster
Rep: Reputation: 52
Thanks to emailssent.
I've found the server is not functional under Redhat 9 unless I run the following line which I have added to the start of the script described above.
/usr/sbin/exportfs -ra

There are probably more elegant ways of doing it but I find it premature to spend time on it when one major problem still persists. The problem is, regardless of what I do, I can only manage to see the first level of directories from the client. For example when I export from the server and mount on the client "/var", I can only see the contents of "/var" on the client, not the content of the sub-directories in "/var" (like "/var/www"). If I try to export from the server and mount on the client "/var/www" then I get a message on the client saying it cannot mount /var

Since Redhat 9 is a dead end, I decided to install Fedora core2, I'll wait till I see how NFS go with it and Ill then update this post.
 
Old 10-21-2004, 07:24 AM   #7
emailssent
Member
 
Registered: Sep 2004
Posts: 312

Rep: Reputation: 30
@rblampain


Try this,

You have make another share on the NFS server
for /var/www/

(becz. as far i remember they appear on the the same disk, if they appear on another disk then u will be able to mount it also without creating another share)



-jack
 
Old 10-22-2004, 03:03 AM   #8
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,291

Original Poster
Rep: Reputation: 52
To Jack:
Yes that fixed it. I can now see all the subdirectories, sub-subdirectories and files in /var/www ( and others). Great stuff.
So, for posterity, I've got now in my "/etc/exports" (on server)
/var 192.168.1.6(ro,no_root_squash)
/var/www 192.168.1.6(ro,no_root_squash)
and in "/etc/fstab" on client
192.168.1.13:/var /mnt/var nfs ro 0 0
192.168.1.13:/var/www /mnt/var/www nfs ro 0 0
also created directories "/var" and "/var/www" in "/mnt"

Thank you very much for your persistence.

Last edited by rblampain; 10-22-2004 at 03:04 AM.
 
Old 10-23-2004, 05:57 PM   #9
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
Let's backup to the first set of exports /var and /home

As you export the /var directory you can mount that, but you don't export the /var/www as a resource so therefore you can't mount it.
You can still reach the /var/www directory using the /mnt/var/www path (provided that you mount /var to /mnt/var on the client).
Compare to mounting a hard disk partition. You mount the entire partition with all of it's subdirectories, but you can't mount a directory of a partition.
 
Old 10-23-2004, 11:48 PM   #10
emailssent
Member
 
Registered: Sep 2004
Posts: 312

Rep: Reputation: 30
@rblampain

Anothere solutions now I remembered as I am reading ugge post, that if u don't want to make seperated export for ur www then u can try to mount it directly from the NFS client.

That's without exporting www u can just mount it from NFS client
#mount -a -t nfs
or
#mount /var/www /var/www
(mount <sorce directry on NFS server> <destination directory on NFS client>

This all above is a NFS rule provided by nfs protocol.



-jack
 
Old 10-24-2004, 02:47 AM   #11
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
You can't mount what you don't explicitly export.
If you don't export the /var/www then you can't mount that directly, because that resource doesn't exist as far as exports go.
You will have to mount the /var directory and then cd to the right subdirectory on the client.
 
Old 10-25-2004, 12:05 AM   #12
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,291

Original Poster
Rep: Reputation: 52
Thanks to you people for all your suggestions. I definitely have to streamline the set up but I will do it slowly, one thing at a time after I install the new distro as explained before.

I can now see all the shares from the client, form all the directories listed although I am getting the following message after runnung the script "nfs.sh" on the server:
192.168.1.6:/home Invalid argument
which doesn't seem to affect anything and which I can't explain.

Also I have to run the scripts a couple of times after re-booting.
Here are the latest files I used.

Server side
=========
# /etc/exports
/home 192.168.1.6(ro,sync)
/home/rene 192.168.1.6(ro,sync)
/var 192.168.1.6(ro,sync)
/var/dir1 192.168.1.6(ro,sync)
/var/dir2 192.168.1.6(ro,sync)
/var/dir3 192.168.1.6(ro,sync)
/var/dir4 192.168.1.6(ro,sync)
/var/dir5 192.168.1.6(ro,sync)

# hosts.deny
portmap:ALL
lockd:ALL
mountd:All
rquotad:ALL

# hosts.allow
portmap: 192.168.1.6
lockd: 192.168.1.6
rquotad: 192.168.1.6
mountd: 192.168.1.6
statd: 192.168.1.6
ALL: localhost
rpc.mount:: ALL

# "ls -la" of script on server (can only run as root)
-rwx------ 1 root root 169 Oct 24 12:23 nfs.sh
# script nfs.sh
#!/bin/bash
/usr/sbin/exportfs -ra
/sbin/insmod nfs
/usr/sbin/rpc.mountd
/usr/sbin/rpc.nfsd
/sbin/rpc.statd
/sbin/rpc.lockd
/usr/sbin/rpc.rquotad

Client side
========
Appropriate mount points in /mnt to match the exports file on server
Appropriate mount entries in /etc/fstab

# script nfs.sh (can only run as root as above)
#!/bin/bash
/sbin/insmod nfs
/sbin/rpc.lockd
/sbin/rpc.statd
(this script appears unnecessary)

# script stst.sh
/etc/rc.d/init.d/nfs stop
/etc/rc.d/init.d/nfs start
(this script seems necessary)

Last edited by rblampain; 10-25-2004 at 12:09 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Networking 2 linux boxes with NFS?? ludwig W SUSE / openSUSE 4 10-16-2005 03:09 PM
Networking 2 linux boxes together d4harvey Linux - Networking 6 05-29-2004 11:41 AM
Networking with windows boxes SappySE107 Linux - Networking 10 11-18-2003 11:21 PM
Two boxes on university network: NFS Questions mac_phil Linux - Networking 1 09-30-2003 02:17 PM
Networking 2 Linux boxes Jester21 Linux - Networking 4 01-21-2003 03:28 AM

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

All times are GMT -5. The time now is 11:50 PM.

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