cancel
Showing results for 
Search instead for 
Did you mean: 

mount via NFS

SOLVED
Go to solution
Yarok
Regular Advisor

mount via NFS

Hello,

I went through the HP's NFS document and tried to perform the NFS procedure.

I would like to know several things:

1. Why when I am trying to perform an NFS connection to the home directory "/" (i.e, mount IP_ADDRESS:/ /MACHINE_NAME) I receive “permission denied "?

2. Why when I am trying to perform an NFS connection to the opt or var usr and so on (i.e, mount IP_ADDRESS:/var /MACHINE_NAME) I receive " nfs mount: mount_nfs: /machine_name: device busy"?
What should I do in order to overcomes it?

3. What is the significant of the /etc/exports file? is it a must file?

4. I don't understand exactly the function of the -annon option.

BR,

Yaron



my systems parameters: HP-UX C-8000 B.11.11
4 REPLIES
Bob_Vance
Esteemed Contributor
Solution

Re: mount via NFS

to set up:

1) NFS must be enabled and started on the server AND the client


Pine4 ## grep -e ^NFS_CLIENT -e ^NFS_SERVER /etc/rc.config.d/nfsconf
NFS_CLIENT=0
NFS_SERVER=0

Pine3 ## grep ^NFS_SERVER /etc/rc.config.d/nfsconf
NFS_CLIENT=0
NFS_SERVER=0

*** enable them
Pine3 ## vi /etc/rc.config.d/nfsconf
Pine4 ## vi /etc/rc.config.d/nfsconf

Pine3 ## grep -e ^NFS_CLIENT -e ^NFS_SERVER /etc/rc.config.d/nfsconf
NFS_CLIENT=0
NFS_SERVER=1

Pine4 ## grep -e ^NFS_CLIENT -e ^NFS_SERVER /etc/rc.config.d/nfsconf
NFS_CLIENT=1
NFS_SERVER=0



2) start NFS on server and client

Pine3 ## /sbin/init.d/nfs.server start

Pine4 ## /sbin/init.d/nfs.client start


3) set up /etc/exports ON SERVER
(( see: man exports
man exportfs
))
Pine3 ## vi /etc/exports
Pine3 ## cat /etc/exports
/var/tmp -anon=2,access=pine4.wgl.com


4) export directories listed in /etc/exports

Pine3 ## exportfs
nothing exported
Pine3 ## exportfs -a
Pine3 ## exportfs
/var/tmp -anon=2,access=pine4.wgl.com


5) mount on client

Pine4 ## mount pine3:/var/tmp /tmp_mnt/tmp

Pine4 ## ll /tmp_mnt/tmp
drwxrwxrwt 2 root sys 96 May 20 2009 .oracle
-rw-r--r-- 1 root sys 223 Oct 15 2009 AAAa01907




Note that starting the nfs server automatically does the exportfs -a


Pine4 ## umount pine3:/var/tmp

Pine3 ## /sbin/init.d/nfs.server stop
Pine3 ## exportfs
nothing exported

Pine3 ## /sbin/init.d/nfs.server start
Pine3 ## exportfs
/var/tmp -anon=2,access=pine4.wgl.com


NOTE:
You can only mount at or below what is exported on the server

Pine4 ## mount pine3:/var /tmp_mnt/tmp
Permission denied


Pine3 ## mkdir /var/tmp/testNFS
Pine3 ## touch /var/tmp/testNFS/f1

Pine4 ## mount pine3:/var/tmp/testNFS /tmp_mnt/tmp
Pine4 ## ll /tmp_mnt/tmp
-rw-r--r-- 1 root sys 0 May 15 09:13 f1


The
NOTE:mount point cannot be in use (no processes can be running in it)

Pine4 ## umount pine3:/var/tmp/testNFS
Pine4 ## cd /tmp_mnt/tmp
Pine4 ## mount pine3:/var/tmp /tmp_mnt/tmp
nfs mount: mount_nfs: mount: /tmp_mnt/tmp: Device busy


bv
"The lyf so short, the craft so long to lerne." - Chaucer
Dennis Handly
Acclaimed Contributor

Re: mount via NFS

>1. Why when I am trying to perform an NFS connection, I receive "permission denied"?

Did you allow this client/fs on the server?

>2. Why when I am trying to perform an NFS connection, I receive device busy"?

As Bob said, did you cd to that directory?

>3. What is the significant of the /etc/exports file? is it a must file?

This allows you to automatically export a list of filesystems, so you don't have to do an exportfs(1m) on each one, every boot.

>4. I don't understand exactly the function of the -anon option.

This option specifies who the "root is less than dirt" option is mapped to. This is for all clients that aren't in the root= list.
Yarok
Regular Advisor

Re: mount via NFS

Dears,

Thank you for the answers.

>> Did you allow this client/fs on the server?


Sure I enabled both the NFS Client and NFS server on both machines. In addition I set automount = 1
start_mountd = 1
autofs = 1

>>As Bob said, did you cd to that directory?

I did not cd into that directory. On the other hand I can't rm -r this directory (from the / directory of machine that I perform the mount) - It says:

" rm: directory Pine3 not removed. Cannot remove mountable directory "

Regarding /etc/export. Can I set the file to export the / directory (i.e. / -annon=2) ?

I can mount to pine3 only to a specific directory, calls /scc. I really don't know why? I did everything right.
If I try to other directory with the same privilege it say permission denied.

Bob_Vance
Esteemed Contributor

Re: mount via NFS

Do you want really to use the automounter?
Do you know how to use the automounter ?
Turn those OFF and test without them.

or

Can you give us the results of

On server:
## cat /etc/exports
## exportfs
## mount

Client:
## mount

After that give us the ACTUAL commands that you are executing and their results.

bv
"The lyf so short, the craft so long to lerne." - Chaucer