LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-04-2010, 12:40 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 576

Rep: Reputation: 31
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
 
Old 05-04-2010, 01:06 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
Should not portmap service also be running for NFS sharing?
 
Old 05-04-2010, 01:19 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 576

Original Poster
Rep: Reputation: 31
Thanks for the reply. well unable to understand
Quote:
"Should not portmap service also be running for NFS sharing?"
 
Old 05-04-2010, 02:05 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
Try starting portmap service and then see if NFS shares are available.

service portmap start
 
Old 05-04-2010, 02:08 AM   #5
rajivdp
Member
 
Registered: Oct 2008
Posts: 34

Rep: Reputation: 17
Quote:
Originally Posted by gardenair View Post
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
 
Old 05-04-2010, 04:24 AM   #6
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 576

Original Poster
Rep: Reputation: 31
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

Last edited by gardenair; 05-04-2010 at 04:40 AM.
 
Old 05-04-2010, 05:19 AM   #7
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
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.
 
Old 05-05-2010, 06:39 AM   #8
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 576

Original Poster
Rep: Reputation: 31
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 ...?
 
Old 05-05-2010, 06:42 AM   #9
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
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.
 
Old 05-05-2010, 11:47 PM   #10
rajivdp
Member
 
Registered: Oct 2008
Posts: 34

Rep: Reputation: 17
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
 
Old 05-06-2010, 12:04 AM   #11
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
@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.
 
Old 05-06-2010, 04:09 AM   #12
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 576

Original Poster
Rep: Reputation: 31
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 ?
 
Old 05-06-2010, 04:15 AM   #13
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
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 "/".
 
Old 05-06-2010, 05:37 AM   #14
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 576

Original Poster
Rep: Reputation: 31
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 ?

Last edited by gardenair; 05-06-2010 at 05:38 AM.
 
Old 05-06-2010, 06:46 AM   #15
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

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


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
Automount (NFS) is not working justemail Linux - General 4 05-19-2009 04:35 PM
NFS not working methodtwo Linux - Networking 3 05-09-2008 11:20 PM
nfs is not working nehra13 Linux - Networking 7 01-22-2008 01:15 PM
NFS shares not working windsurfer Linux - Software 6 04-10-2007 04:58 AM
NFS share not working ahmedb72 Red Hat 3 02-22-2006 02:38 AM


All times are GMT -5. The time now is 06:19 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration