Solved

how to mount file system using nfs

Posted on 2007-11-23
4
2,489 Views
Last Modified: 2013-12-27
I would like to nfs mount a filesystem on one server to another server. What is the command line for this?
0
Comment
Question by:SyedHNaqvi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 20338641
Hi,

The steps in general are

On the server that is having the dir  to mount:

- You need to add the share command to /etc/dfs/dfstab file
e.g. add a line similar to

share -F nfs /dir

- Start the nfs server( /etc/rc3.d/S15nfs.server start )

On the server that will be mounting the remote nfs share

- create the mount dir

e.g.

mkdir /mydir

- mount the file system with the mount command

mount remoteserver:/dir /mydir


remotehost is the name or ip address of the remote nfs server

- add an entry to /etc/vfstab

e.g. add a line similar to

remotehost:/dir - /mydir nfs - no -o ro

For more info please see

http://www.softpanorama.org/Net/Application_layer/nfs.shtml
http://www.unix.org.ua/orelly/networking/tcpip/ch09_01.htm
http://unixarticles.com/articles/9/1/NFS-configuration-for-Solaris-and-AIX
http://www.uwsg.iu.edu/usail/network/nfs/admin.html
0
 
LVL 22

Expert Comment

by:robocat
ID: 20338818

A quick way to mount the remote filesystem using the automounter is:

cd /net/remoteserver/dir

Just by going to this location or using a file on it, the automounter will automatically mount the filesystem. The automounter will also unmount the filesystem when it's no longer used.

You can use this if you don't need a permanent mount.

0
 
LVL 22

Expert Comment

by:blu
ID: 20347987
You don't mention what version of Solaris you are using. The answer is different on Solaris 10 from prior versions of Solaris, and it
is different on OpenSolaris than on Solaris 10.
0
 
LVL 2

Accepted Solution

by:
geoffry earned 250 total points
ID: 20349037
In Server1:
1. * ensure /etc/rc3.d/S15nfs.server started or start it run /etc/rc3.d/S15nfs.server start
* ensure /etc/dfs/dfstab is share something
# vi /etc/dfs/dfstab   ---> add this line into last line
share –F nfs –o ro,anon=0 /cdrom/cdrom0    --> for share CDROM
share –F nfs –o rw,client1:/export/home    --> for share NFS to client1 only

Client1:
# mount -o ro Server1 /cdrom/YourCD /mnt
or,
# mount –F nfs –o ro Server1:/cdrom/YourCD /mnt
or,
# mount –F nfs –o ro Server1_IPaddress:/cdrom/YourCD /mnt

Command to manually mount;
E.g:
# mount -F nfs remotesvr:/export/home/newuser /mnt
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question