Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to mount a directory from one machine to another?

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
Hi

I want to mount a directory from machine (a) on another machine (b), but I don't remember procedure how to mount a directory from one machine onto another one.

If it is just a simple mount, I can do it, but I remember I have to make a share on the host machine, am I right?

Thanks for your help
 
Yes you are correct. I use...

mount -F nfs <boxname>:/mydir /myshare

remeber to create the share.
hope this helps.
 
Hi,
Suppose u want to mount a dir named /home/project on a server hosta on to server hostb,u will give the following commands....
hosta#share -F nfs -o ro /home/project
hosta#dfshares (this cmd shows the shared resources)
Then on hostb...
hostb#mkdir /project
hostb#mount -F nfs hosta:/home/project /project
Now change dir to /project and u can see the contents...
If u want to write also(create,append files) then share the dir on hosta with 'rw' option....
And make sure your nfs daemons are running.....

I hope this helps....
 
Thanks all for your quick response. It helps
 
I have another question.

The command &quot;share...&quot; can do at the prompt command and any where on hosta, right?
While if you want to make it share permanent, you have to put it in a file, am I right? If it is so, then what file and where it is? Do you know?

Thanks
 
Hi,
If u want to make the share permanent then add the same command entry in the file /etc/dfs/dfstab.....
After that restart the nfs daemon as
/etc/init.d/nfs.server start

I hope this is helpful to u.....
 
You may not have to restart the nfs daemon.

try using the command &quot;shareall&quot;
 
Hi,

edit /etc/dfs/dfstab to add the machine and the drive/partition for the directory you wish to share

issue the command &quot;shareall&quot; (no quotes)

Try to mount the drive/directory on your target machine. If it fails re-edit dfstab and use the fully quallified domain name (or even the IP addresss) of the machine whose drive you want to share. Do shareall again.

If it still screws up, restart the automounter thus:

/etc/init.d/autofs stop
/etc/init.d/autofs start

If necessary restart the nfsclient/server as described above.

If at this point you *still* can't mount your directory check with your network people to find if any routers or internal firewalls are blocking traffic. You shoudl also check your sevices file (/etc/services) to make sure that nfs is supported. If not, then att the following to your services file:

nfsd 2049/udp nfs
nfsd 2049/tcp nfs

Then restart inetd this:

/etc/init.d/inetinit stop
/etc/init.d/inetinit start

Check that inetd is running:

rpcinfo -p

In the output that this generates you should see two lines listing port 2049 with nfs listed as a service next to the port.

retry the mount command.

If your problems still persist at this point contact your system vendor.

later
jb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top