Linux Network File System (NFS) configuration, shared folder

Source: Internet
Author: User
Linux Network File System (NFS) configuration, shared folder 1, NFS server installation (server ip192.168.0.105) check whether two software packages nfs-utils and portmap are installed in linux (the two software packages have been installed by RHEL4 by default). command # rpm & amp; ndash; qn...

Linux Network File System (NFS) configuration, shared folder
1. install the NFS server (server ip address 192.168.0.105)

Check whether two software packages nfs-utils and portmap are installed in linux (the two software packages have been installed in RHEL4 by default)

Command # rpm-q nfs-utils portmap

II. check whether the NFS server is enabled

Command # service nfs starus

# Service portmap status

3. if the server is not started, enable the service (nfs is not fully enabled under the default service)

Command # service nfs start

# Service portmap start

4. Specifies the NFS configuration file
Vi/etc/export
/Home/myfile * (sync, rw, no_root_squash)
[Directory to be shared] [ip1 or host name 1 (parameter)] [ip2 or host name 2 (parameter)]

The "configuration options" field in the exports file is placed in the brackets ("()"). multiple options are separated by commas (,).

Sync: sets the NFS server to write data to the disk synchronously, so that data will not be lost easily. we recommend that you use this option for all NFS shared directories.

Ro: Set the output shared directory to read-only and cannot be used together with rw.

Rw: Set the output shared directory to read/write, which cannot be used together with ro.

* Indicates all hosts

5. Make the content of the new "exports" file take effect
# Exportfs-rv
Displays the output list of NFS servers on the current host.

# Showmount-e

Displays the shared directories mounted to and used by NFS clients on the NFS server of the current host.

# Showmount-d

 

Sat. NFS client (ip192.168.0.205)
No need to start (nfs, portmap)
Display NFS server output

# Showmount-e 192.168.0.105
Create a directory to be shared
# Mkdir/home/logfile

Mount the shared directory on the NFS server

# Mount-t nfs 192.168.0.105:/home/myflie/home/logfile

 

7. uninstall the mounted NFS shared directory in the system

Command # umount/home/logfile

Test:
Create ss.txt under/home/logfile

Check whether the file can be viewed and edited in/home/myfile.

 

This article is from "kevenfeng"

Related Article

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.