probably v simple NFS question

Discuss Networking
Post Reply
User avatar
Calum
guru
guru
Posts: 1349
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland
Contact:

probably v simple NFS question

Post by Calum »

well, i wanted to make the laptop (claudia, running mandrake) the server and the desktop (harvey, running rh9) the client, for the nonce, and then make a vice versa situation after i had got it working. i found this excellent doc here: http://mandrakeuser.org/docs/connect/cnfs.html and have been following it fine, i'm up to the bit where i am trying to mount the share on the client, which the article assumes is either mandrake or MacOSX, but i am bright enough to know that i'm running RH9! :-) ,
[root@harvey root]# mount 192.168.0.184:/home/calum/gnutella_received /mnt/claudia_gnutella_received
mount: RPC: Timed out
and the above message is what i see instead of it mounting properly. the IP address is right:
bash-2.05b$ ping 192.168.0.184
PING 192.168.0.184 (192.168.0.184) 56(84) bytes of data.
64 bytes from 192.168.0.184: icmp_seq=1 ttl=64 time=0.494 ms
64 bytes from 192.168.0.184: icmp_seq=2 ttl=64 time=0.255 ms

--- 192.168.0.184 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1003ms
rtt min/avg/max/mdev = 0.255/0.374/0.494/0.121 ms
and these are the only two machines on, and am using one of those little plastic D-Link router boxes.

in the process of this, i think i have found out how to specify static ip address for my machine too using linuxconf, which appears to edit the relevant file for the network interface in /etc/sysconfig/network-scripts/ but how do i now tell the computer which hostname goes with which ip address, so for example if i am upstairs and want to ssh to the mandrake machine, instead of typing ssh 192.168.0.184 i could just type ssh claudia - this is of course incidental to my real question above... although actually now i think of it, the static ip address is necessary if i want to add the nfs shares to my /etc/fstab isn't it? could i use the hostname in the fstab instead of the ip under the circumstance above by the way?

i was hoping not to have to post here about NFS, but i haven't used it before and the article doesn't cater for if you have a problem with the instructions.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

Yeah, static addresses are "almost" a must in the NFS world but you can do it via DHCP (albeit not very securely and not without painful snags when addresses change). Of course name resolution can be done in the standard locations, /etc/hosts (if static) or DNS if static or dynamic).
Did you use the "showmount -e <serveraddress>" from the client to verify that the share is exported and available? Are the portmap and nfs services running on the client? Are any firewall rules getting in the way?

User avatar
Calum
guru
guru
Posts: 1349
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland
Contact:

Post by Calum »

[root@harvey calum]# service portmap start
Starting portmapper: [ OK ]
[root@harvey calum]# service nfs
Usage: nfs {start|stop|status|restart|reload|condrestart}
[root@harvey calum]# service nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@harvey calum]# mount 192.168.0.184:/home/calum/gnutella_received /mnt/claudia_gnutella_received
mount: RPC: Timed out
[root@harvey calum]# showmount -e 192.168.0.184
Export list for 192.168.0.184:
/MUSIC 192.168.1.0/255.255.255.0
/home/calum/gnutella_received 192.168.1.0/255.255.255.0
so, the answer is, when those services are running, it still times out even though the two shares are seemingly correctly specified.

what's this mean in real terms? re: firewall, i wouldn't know, i am ashamed to admit that i know very little about firewall configuration, although i can easily and successfully ssh to from one machine to the other...

thanks for your prompt interest in this, void.

edit: oh yes, what does one do about managing which services start and stop automatically under a particular runlevel? or under more then one runlevel in fact. just so i would be able to have these services start automatically (assuming they don't already)

User avatar
Calum
guru
guru
Posts: 1349
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland
Contact:

Post by Calum »

well, i have installed slack on the desktop instead of RH for a number of reasons, so now my questions abour services and so on are totally irrelevant i suppose. i'll look up how this works again in slack sometime (but probably not soon as am off to australia next week)

incidentally, i noticed that the above makes me look like a rabid music pirate, which is a myth i felt i have to dispell. the directory names are "archaic" and "deprecated" since they contain music, but original music by me and my dad and various bands we've been in, the directory names are from years ago, and i haven't upgraded my brain yet to remember different directory names.

edit:
also, the same problem still occurs (portmap and nfs-utils are both installed), suggesting a problem with the server?
root@harvey:~# showmount -e 192.168.0.184
Export list for 192.168.0.184:
/MUSIC 192.168.1.0/255.255.255.0
/home/calum/gnutella_received 192.168.1.0/255.255.255.0
root@harvey:~# mount 192.168.0.84:/MUSIC /mnt/MUSIC/
mount: RPC: Remote system error - No route to host

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

It would appear by your addresses that you have your machines on two different networks (192.168.0.0/255.255.255.0 and 192.168.1.0/255.255.255.0). Is this correct? The message "no route to host" indications that the machines are on two different networks and there is no router between you that knows where each is. I suspect that you want both machines on the same network after which you should no longer get that message.

User avatar
Calum
guru
guru
Posts: 1349
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland
Contact:

Post by Calum »

i do indeed!

thanks for spotting that! i feel like a right old dimbo! :-)

it works!!!!! thank you! now i feel like i can use nfs, which is 90% of the way to *actually* knowing!

now i'm off to set a dynamic ip on the slack machine.
thanks again!

User avatar
Calum
guru
guru
Posts: 1349
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland
Contact:

Post by Calum »

ok, sorry to ask about another probably very simple nfs problem, since asking that last i have installed slack on harvey (the desktop) and xandros on claudia (the laptop) then i went away to australia and forgot what configuration i had and hadn't done. now i am back and trying to set up nfs. Whatever i try to do, i can't mount the shares from one machine on the other or vice versa. what am i doing wrong here?

Code: Select all

claudia:~# cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
/disks/D 192.168.0.0/255.255.255.255(rw)
/home 192.168.0.0/255.255.255.255(rw)
claudia:~# cat /etc/fstab
# /etc/fstab -- static file system information
# auto generation: on
# generated by: /sbin/etcdev2fstab
#
# NOTE: to make this file readable, it has been formatted for 132 columns
#
#<device>                              <mountpoint>      <fstype>  <options>    
                                   <dbg> <pass>
/dev/ide/host0/bus0/target0/lun0/part6  /                 ext3      defaults    
                                    0     0
/dev/ide/host0/bus0/target0/lun0/part1  /disks/C         vfat  rw,nosuid,nodev,n
oexec,nouser,async,umask=0,showexec=no 0  0
/dev/ide/host0/bus0/target0/lun0/part8  /disks/D         vfat  rw,nosuid,nodev,n
oexec,nouser,async,umask=0,showexec=no 0  0
/dev/ide/host0/bus0/target0/lun0/part7  /home             reiserfs  rw          
                                    0     0
/dev/cdroms/cdrom0                      /mnt/cdrom0       iso9660   ro,nosuid,no
dev,exec,user,noauto,async,unhide   0     0
/dev/fd0                                /mnt/fd0          auto      rw,nosuid,no
dev,exec,nouser,noauto,async        0     0
proc                                    /proc             proc      rw          
                                    0     0
usbdevfs                                /proc/bus/usb     usbdevfs  rw,devmode=0
666                                 0     0
/dev/ide/host0/bus0/target0/lun0/part5  none              swap      sw          
                                    0     0
harvey:/home /mnt/harvey-home nfs defaults,users 0 0
harvey:/mnt/mydocuments /mnt/harvey-mydocuments nfs defaults,users 0 0
claudia:~# mount /mnt/harvey-mydocuments/
mount: harvey:/mnt/mydocuments failed, reason given by server: Permission denied

Code: Select all

root@harvey:/etc/rc.d# cat /etc/exports
# See exports(5) for a description.
# This file contains a list of all directories exported to other computers.
# It is used by rpc.nfsd and rpc.mountd.
/mnt/mydocuments 192.168.0.0/255.255.255.255(rw)
/home 192.168.0.0/255.255.255.255(rw)
root@harvey:/etc/rc.d# cat /etc/fstab
/dev/hda8        swap             swap        defaults         0   0
/dev/hda6        /                reiserfs    defaults         1   1
/dev/hda7        /home            ext3        defaults         1   2
/dev/hda5        /mnt/mydocuments vfat        defaults,umask=0         1   0
/dev/sr0       /mnt/cdrom       iso9660     noauto,defaults,users,ro  0   0
/dev/hdd         /mnt/dvd         iso9660     noauto,defaults,users,ro  0   0
/dev/fd0         /mnt/floppy      auto        noauto,users,umask=0     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
claudia:/home /mnt/claudia-home nfs defaults,users 0 0
claudia:/disks/D /mnt/claudia-mydocuments nfs defaults,users 0 0
/dev/sda1 /mnt/camera auto noauto,users 0 0
none             /tmp/jack        tmpfs       defaults         0   0
root@harvey:/etc/rc.d# mount /mnt/claudia-home/
mount: claudia:/home failed, reason given by server: Permission denied
root@harvey:/etc/rc.d# mount /mnt/claudia-mydocuments/
mount: claudia:/disks/D failed, reason given by server: Permission denied
perhaps another thing to mention is that all shares are at the top level of their logical volum, ie they all have their own partition. also, i think one of the homes is reiserfs and one is ext3 but this should not matter, yes? both of the mydocuments are fat32.

also, a bonus question, the user IDs of all the users on one machine are different from on the other one (as shown in /etc/passwd), how can i make the permissions "work right" on the mounted shares, so that user calum gets access to /mnt/harvey-home/calum but not /mnt/harvey-home/anybodyelse for instance? do i have to sort it out so the user IDs are the same on all the machines? this would seem like a huge headache if scaled up to a site with hundreds of users and dozens of machines.

thanks as always in advance!

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

Before I dig too deep I notice right off your netmasks are wrong (255.255.255.255 should be 255.255.255.0 if you are using a 24 bit subnet). With it set like that is should definitely NOT allow a connection from anywhere but the 192.168.0.0 address (which is your network address). If it still doesn't work after changing it to 255.255.255.0 then I'll look a little more closely.

User avatar
Calum
guru
guru
Posts: 1349
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland
Contact:

Post by Calum »

void main, not only was it a dumb mistake for me to make, it was the SAME dumb mistake i made last time! thank you again for your patience! i can't believe it. I found that the xandros machine does not have an exportfs command installed though:
claudia:~# cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
/disks/D 192.168.0.0/255.255.255.0(rw)
/home 192.168.0.0/255.255.255.0(rw)

claudia:~# exportfs -ra
-su: exportfs: command not found
claudia:~# ls /var/lib/nfs
sm sm.bak state
claudia:~# ssh harvey
...
root@harvey:~# mount /mnt/claudia-home/
mount: claudia:/home failed, reason given by server: Permission denied
this is not a worry since this'll sort itself out next reboot, and since i am going to bed soon, this is imminent. however, this'd be a problem on a xandros system i wasn't planning to shut down anytime soon, i suppose then i would just apt-get it.

Any thoughts on the different-user-ids-when-mounting-other-machines'-partitions-across-nfs dilemma?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

Calum wrote:claudia:~# exportfs -ra
-su: exportfs: command not found
Could it be that it's just not in your current path (like you didn't do a "su -")? Try:

# /usr/sbin/exportfs -ra
Any thoughts on the different-user-ids-when-mounting-other-machines'-partitions-across-nfs dilemma?
Yeah, make all your userids match on both machines. :) Actually I believe in the new version of NFS there is ID mapping capabilities via a daemon.

User avatar
Calum
guru
guru
Posts: 1349
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland
Contact:

Post by Calum »

wow! i'm v surprised this hadn't been addressed before, usually when i ask a question like this you will answer with something like "well, that's one of the cool things about linux, using your zzzz you can simply type a couple of lines of xxxxx into the yyyyy and you're done!".

Post Reply