LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   NFS not working.Please help (https://www.linuxquestions.org/questions/linux-newbie-8/nfs-not-working-please-help-805769/)

gardenair 05-04-2010 12:40 AM

NFS not working.Please help
 
Hi,
I am facing a little bit issue regarding to configur NFS server in my test lab.I have two computers for testing and both are using Red Hat Linux connected eachother with a cross cable.Both computers successfully ping eachother. When i use /etc/fatab in the client computer I can't see my share folders which are /home and /music .
Following is my configuration.Please guide me where I am doing mistake.

Kindly revice my settings.



NFS Server i.e Pc1

192.168.1.10



NFS Client i.e Pc2

192.168.1.20





Configuration NFS server i.e PC1:

Quote:

[root@pc1 ~]#vi /etc/exports


#

/home 192.168.1.20 (rw)

/music 192.168.1.20 (rw)


[root@pc1 ~]#chkconfig iptables off

[root@pc1 ~]# chkconfig --level 35 nfs on
[root@pc1 ~]# chkconfig --level 35 nfslock on

Start
[root@pc1 ~]# service nfs start
[root@pc1 ~]# service nfslock start

Client Configuration

[root@pc2 ~]#chkconfig iptables off
[root@pc2 ~]# chkconfig --level 35 nfs on
[root@pc2 ~]# chkconfig --level 35 nfslock on


[root@pc2 ~]# service nfs start
[root@pc2 ~]# service nfslock start

[root@pc2 ~]#cat /etc/fstab

Here i can't see /home and /music mount Points

gardenair

linuxlover.chaitanya 05-04-2010 01:06 AM

Should not portmap service also be running for NFS sharing?

gardenair 05-04-2010 01:19 AM

Thanks for the reply. well unable to understand
Quote:

"Should not portmap service also be running for NFS sharing?"

linuxlover.chaitanya 05-04-2010 02:05 AM

Try starting portmap service and then see if NFS shares are available.

service portmap start

rajivdp 05-04-2010 02:08 AM

Quote:

Originally Posted by gardenair (Post 3956449)
Thanks for the reply. well unable to understand

NFS relies on RPC protocol for communication between client and the server

Remote Procedure Call (RPC) protocol is designed for network programming, in which host machine can invoke a subroutine in remote machine.

The daemon which looks for RPC protocol request is the Portmap daemon which looks port 111.

So for NFS to run we need the Portmap Deamon to be run on both client and server.

Configuration

Server

#service portmap status
#service nfs status
#service nfslock status

above commands should display that all Daemons are running.

#showmount -e localhost

Its should show your exported directories.

Client

NFS client should able to see exported directory from the server

#showmount -e 192.168.1.10

#service netfs status
#service portmap status
#service nfslock status

netfs is used mount the file system provided by RPC with the server.

check it manually,

#mount 192.168.1.10:/home /mnt/home
#mount 192.168.1.10:/music /mnt/music

you should have a mount point /mnt/home and /mnt/music

if mount is success, then made an entry in file system table (/etc/fstab).

if you wnat to learn more follow the LHN link below.

http://www.linuxhomenetworking.com/w...ccess_with_NFS

Regards
Rajiv

gardenair 05-04-2010 04:24 AM

I am extremly thankful to you for the detail reply. The mount point is working...I can see it using run level 5 . How can I see it in terminal ...? I can not still see my mount points in

[root@pc2 ~]#cat /etc/fstab

linuxlover.chaitanya 05-04-2010 05:19 AM

exportfs command should show the nfs shares that are exported.
You need to edit fstab file in clients manually for mounting the nfs shares at boot. No service will edit it.
You can also get information for nfs server with command rpcinfo -p.
From client rpcinfo -p <server-name> should give you information.

gardenair 05-05-2010 06:39 AM

well i want to clear about mount point.This statement for NFS works file.

Code:

[root@pc2 ~]# mount 192.168.1.10:/music /mnt/music
if I create my own folder like

Code:

[root@pc2 ~]#mount 192.168.1.10:/home /mydata/music
mount: mount point /mydata/music does not exits
[root@pc2 ~]#

where mydata is a folder .I does't know why it not work but if I use
#mount 192.168.1.10:/music /mnt/music

it work fine .Please guide me what is the logic of /mnt folder ...?

linuxlover.chaitanya 05-05-2010 06:42 AM

Are you sure mydata folder is present and that music folder is created inside mydata?
If not mkdir -p /mydata/music will create for you. And then you can mount it.

rajivdp 05-05-2010 11:47 PM

Quote:

where mydata is a folder .I does't know why it not work but if I use
#mount 192.168.1.10:/music /mnt/music

it work fine .Please guide me what is the logic of /mnt folder ...?
what is mount point? why it is require?

In windows you will mount the file share as a seperate network drive which usually have drive letter "Z:" and you have a seperate partition like "C:", "D:",...

In linux you will have only one file system that is "/". All partitions should come under "/" file system. So the inorder to access the files and directories in the other partition we should mount that partition under a directory.The directory in which we are mounting the device is call mount point.

#cat /etc/fstab

/dev/sda1 / ext3 defaults 1 2
/dev/sda2 /home ext3 defaults 1 2
/dev/sda3 /var ext3 defaults 0 0
192.168.1.10:/music /mnt/music nfs defaults 0 0

to know more about the fstab entries, follow the link

http://www.tuxfiles.org/linuxhelp/fstab.html

Here first root "/" file system will be mounted and it will be in /dev/sda1 partition.

then under the "/" directory "/home" directory which is already exists, /dev/sda2 will get mounted under the /home directory.

finally the nfs share /music from 192.168.1.10 will be mounetd to the /mnt/music. here we need /mnt/music is a directory which must be already exist.

Regards
Rajiv

linuxlover.chaitanya 05-06-2010 12:04 AM

@Rajiv,

You need to go through the thread completely. You have not understood what OP needs. Please read the thread before replying. OP is not asking just about fstab entries.
He needs mount point to mount the NFS shares and that is valid issue. If the mount point does not exist, system will complain. And that is a valid complaint. And we are not talking about windows here. So it makes no point how windows mounts the shares. And even in windows you can mount on have drive you want. It should just not be already in use.

gardenair 05-06-2010 04:09 AM

thanks again for the reply well as "linuxlover.chaitanya" wrote

Code:

Are you sure mydata folder is present and that music folder is created inside mydata?
If not mkdir -p /mydata/music will create for you. And then you can mount it.

If i use GUI and make mydata folder and sub folder music , it create but when I try to mouch it show me same message
Code:

[root@pc2 ~]#mount 192.168.1.10:/home /mydata/music
mount: mount point /mydata/music does not exits
[root@pc2 ~]#

but If I use terminal windows and use
Code:

mkdir -p /mydata/music
when I use mount command it it successfully mount and i can see all my shares in it.Please guide me what is teh technical reason ?

linuxlover.chaitanya 05-06-2010 04:15 AM

It could be that using GUI, you mistakenly created those folders inside home for root i.e "/root" instead of "/". But when you are creating folders using the command, you are explicitly creating inside "/".

gardenair 05-06-2010 05:37 AM

well i get your point thanks a lot for help me.In my /etc/export file i am using

/music (rw,sync)

from client clide when I want to delete any file it say

Code:

Error while deleting

"/mydata/music/smile.avi"cannot be deleted because
you have not permissions to modify its parent folder.

on the client side i am also using my root account so why this issue ?

linuxlover.chaitanya 05-06-2010 06:46 AM

You need to have to give permissions on the folder on the server. So allow everyone read/write access to /mydata/music on server.


All times are GMT -5. The time now is 04:41 AM.