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"