Mounting with NFS on Ubuntu

Suppose you want to mount /home/sharedata on the 192.16.2.101 server to /home/receive_data on the 192.16.2.102 server

1. Server

1. Install the NFS server

sudo apt-get install nfs-kernel-server

2. Modify the NFS mount configuration file

sudo vim /etc/exports

Enter in the file

/home/sharedata 192.16.2.102(rw,no_root_squash,async)

3. Start and restart the service

sudo /etc/init.d/nfs-kernel-server start
sudo /etc/init.d/nfs-kernel-server restart

2. Client

1. Install related packages

sudo apt-get install nfs-common portmap

2. Create a mount directory

mkdir /home/receive_data

3. Mount the file of the specified server

 sudo  mount  -t  nfs  -o  nolock  192.16.2.101:/home/sharedata  /home/receive_data

After doing the above operations, you can find the sharedata folder under /home/receive_data

Guess you like

Origin blog.csdn.net/qq_38964360/article/details/132173353