CentOS7掛載NFS

本文記錄CentOS7做爲客戶端掛載NFS文件共享(含開機自動掛載)vim

環境示例說明

NFS 服務端: nfs.server.exp(192.168.1.10/24)
NFS 客戶端: nfs.client.exp(192.168.1.100/24)ssh

客戶端安裝必要的包

# yum install nfs-utils

配置客戶端

修改域名(可選)

# vim /etc/idmap.conf

...
# 填寫域名,此處是server.exp
Domain = server.exp
...

啓動設置rpcbind服務

nfs服務依賴rpc遠程過程調用服務ide

# systemctl start rpcbind
# systemctl enable rpcbind

準備掛載的目的路徑

自定義目的路徑,此處爲"/vol/data"code

# mkdir -p /vol/data

掛載NFS共享目錄

服務端共享目錄名爲/nfsshareserver

# mount -t nfs nfs.server.exp:/nfsshare /vol/data

或者使用IPrpc

# mount -t nfs 192.168.1.10:/nfsshare /vol/data

若是要指出掛載的NFS版本,添加相應的參數,以下:域名

# mount -t nfs -o vers=3 nfs.server.exp:/nfsshare /vol/data

配置自啓自動掛載

# vim /etc/fstab

...
nfs.server.exp:/nfsshare    /vol/data    nfs    default    0 0
...
相關文章
相關標籤/搜索