How to share NFS files in Linux

Source: Internet
Author: User

1) Create an NFS share operation:

0. You have logged on to the system as the root user.

1. By default, the system does not start the NFS service.
Service NFS status
Service NFS start

2. Modify the NFS configuration file/etc/exports, for example
# More/etc/exports
/Nfs 192.168.xx.xxx (RW, sync, no_root_squash) 192.168.xx.xxx (RW, sync, no_root_squash) 192.168.xx.xxx (RW, sync, no_root_squash)

/Nfs indicates which directory is shared, 192.168.xx.xxx and later IP addresses indicate the IP addresses that are allowed to be accessed, RW indicates readable and writable, and sync indicates memory Hard Disk Synchronization, no_root_squash indicates that if the NFS server is mounted as root, the identity is root.

3. Run the command to make the configuration take effect.
The exportfs command takes effect immediately, but it is best to restart the NFS server.
Service NFS restart

 
2) use the mount command to establish a connection with the shared directory of the LAN

Mount-t nfs 192.168.xx.xxx:/nfs/mnt
The/nfs must be the same as the shared directory in the/etc/exports configuration file above.

3) if other machines want to load the directory on the machine, use the above command. If/mnt has been loaded, you can use umount/mnt to uninstall the resource, or mount it to another directory.

4) release resources and disconnect

Umount/mnt

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.