NFS is short for NetworkFileSystem, which is a network file system. A protocol used for distributed file systems. Through the network, different machines and operating systems can share data in batches, allowing applications to access data on the server through the network on the client, it is a way to share disk files between Unix-like systems. NFS is independent of the operating system and allows different hardware and operating system systems to share files. By using NFS, users and programs can access files as they access local files.
NFS is short for Network File System, that is, Network File System. A protocol used for distributed file systems. Through the network, different machines and operating systems can share data in batches, allowing applications to access data on the server through the network on the client, it is a way to share disk files between Unix-like systems.
NFS is independent of the operating system and allows different hardware and operating system systems to share files. By using NFS, users and programs can access files on the remote system just like accessing local files.
Check whether NFS is installed in CentOS:
| |
# Rpm-qa | grep nfs # rpm-qa | grep rpcbind |
Nothing is displayed, indicating that NFS has not been installed
Attach a CD
| |
# Mount/dev/cdrom/mnt/cdrommount:/dev/sr0 is write-protected, mounting read-only |
Go to the installation package and view the nfs installation package
| |
# Cd/mnt/cdrom/Packages/# ls * nfs * libnfsidmap-0.25-9.el7.x86_64.rpmnfs4-acl-tools-0.3.3-13.el7.x86_64.rpmnfsometer-1.7-0.el7.noarch.rpmnfstest-1.0.2-2.el7.noarch.rpmnfs-utils-1.3.0-0.el7.x86_64.rpmsblim-cmpi-nfsv3-1.1.1-9.el7.x86_64.rpmsblim-cmpi-nfsv4-1.1.0-10.el7.x86_64.rpmtexlive-mfnfss-svn19410.0-32.el7.noarch.rpmtexlive-psnfss-svn23394.9.2a-32.el7.noarch.rpm |
When installing nfs, there will be some dependency packages during the installation process. if you use yum for installation, you don't need to end the dependency relationship.
| |
# Rpm-ivh nfs-utils-1.3.0-0.el7.x86_64.rpm keyutils-1.5.8-3.el7.x86_64.rpm libevent-2.0.21-4.el7.x86_64.rpm libnfsidmap-0.25-9.el7.x86_64.rpm libtirpc-0.2.4-0.3.el7.x86_64.rpm: rpcbind-0.2.0-23.el7.x86_64.rpmwarning: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEYPreparing... ################################# [100%] Updating/installing. .. 1: libtirpc-0.2.4-0.3.el7 ################################ [17%] 2: rpcbind-0.2.0-23.el7 ################################# [33%] 3: libnfsidmap-0.25-9.el7 ################################ [50%] 4: libevent-2.0.21-4.el7 ################################ [67%] 5: keyutils-1.5.8-3.el7 ################################ [83%] 6: nfs-utils-1: 1.3.0-0. el7 ################################# [100%] |
Start nfs service
| |
# Service rpcbind startRedirecting to/bin/systemctl start rpcbind. service [root @ bogon Packages] # service nfs startRedirecting to/bin/systemctl start nfs. service |
Check whether nfs is installed again.
| |
# Rpm-qa | grep rpcbindrpcbind-0.2.0-23.el7.x86_64 # rpm-qa | grep nfsnfs-utils-1.3.0-0.el7.x86_64libnfsidmap-0.25-9.el7.x86_64 |
Edit the nfs configuration file and set the directory to be shared to/home/iso/
| |
# Vi/etc/exports/home/iso * (rw, sync, no_root_squash) |
# Exportfs-
Display mounted shared discs:
| |
# Showmount-e localhostExport list for localhost:/home/iso * |