Operating System - Linux
1820254 Members
2584 Online
109622 Solutions
New Discussion юеВ

How to created NFS share on linux

 
maint141
Occasional Advisor

How to created NFS share on linux

Hi,

I want ot create NFS share on Linux server & access it form Sun solaris server.

Regards
Varian
4 REPLIES 4
Stuart Browne
Honored Contributor

Re: How to created NFS share on linux

Start by reading 'man exports'.

This will tell you the format of the '/etc/exports' file needs to be in. Add the appropraite entry for the path you wish to be mounted by NFS.

Ensure that the 'portmap', 'nfslock' and 'nfs' services are running '(rpcinfo -p localhost' should tell you), then type 'exportfs -a'.

This should export the entry you made in the exports file.

You should then be able to mount it from Solaris.
One long-haired git at your service...
Alexander Chuzhoy
Honored Contributor

Re: How to created NFS share on linux

if you for example wish to share /shared directory from linux to solaris and have write access to it:
add an entry to /etc/exports on linux machine
/shared /32(rw)

no space between /32 and (rw)
after adding this entry do:
exportfs -r
This command reexports all directories.
Then from sun you can change into shared directory on linux like this:
cd /net//shared
Gopi Sekar
Honored Contributor

Re: How to created NFS share on linux


make sure you have NFS server installed on your system. search for nfsd program in your path or do a rpm query to find out if you have installed NFS server.

start the nfs service and make sure it runs properly. eg: /etc/init.d/nfs start
if it is not able to start, fix that problem first before proceeding on to any further

locate the directory which needs to be exported. eg: /home/nfs

edit /etc/exports file add the above directory entry to it:
eg: /home/nfs *(ro,async)

above are default and safe settings. * indicates any machine which can reach your server can mount the share. ro is to grant read only access (rw for read/write). async is asynchronous mode.
for more options and to give range of ip address in allowed hosts check for 'man exports'

run exportfs -r to instruct NFS server to reload its configuration to incorporate above newly added directory

now you are done with server side.

From client side, make sure you have portmap service running which is required for nfs client package.

then, run the mount command from client to mount the NFS share
eg: 192.168.1.1:/home/nfs /mnt/disk

if you have done things correctly then you should be able to access the NFS files through /mnt/disk

Regards,
Gopi
Never Never Never Giveup
varian_1
Advisor

Re: How to created NFS share on linux

Hi ,

Thanks a lot for help now I am able to mount my shared folder from Linx to Solaris.

Regards

varian