8
6
|
I want to mount a folder from a Linux machine on another Linux machine. How do I do that? Do I need to update
/etc/fstab or /etc/export ?
My target is to mount
/tmp from the other Linux machine. I have Debian 5.1. 10.45.40.165 , that is the IP of the other machine.
For example I tried:
| |||
migrated from serverfault.com Jun 22 '11 at 14:39
This question came from our site for system and network administrators.
| ||||
7
|
What you are doing is NFS share. On a Debian system you should install the tools necessary. Lets assume that the client (the machine on which you want to mount the remote folde) and server (the machine where remote folder is)
On server you'll need to install
in new debian versions
On the client you'll need to install:
My package selection could have more or less what you need but, some combinations will do.
Now what you need to do is put the folders you want to share with remote machine in /etc/exports:
Then:
Here 192.168.0.2 is the address of your local machine, replace that with your own IP. exports file has the list of machines that can access the shared folder. If your machines don't have firewall restrictions to each other (you can solve this by adding host to /etc/hosts.allow).
Now on your local machine you can use the command:
If you want to have automatic mount on boot you need to edit your /etc/fstab file and put the line on your client:
This is just an example of settings (copy pased from my own), you need to check nfs help to see what suites you best.
| ||||||||||||
|
/etc/exports
and the output ofnetstat -plant
andiptables -L
from the server. – Ignacio Vazquez-Abrams Jun 22 '11 at 14:48