Linux下簡單配置nfs檔案系統

2021-06-02 02:35:19 字數 1988 閱讀 6706

文中使用的是rhel4 版本的linux,其他版本會有不同。

伺服器端:

1、配置/etc/exports

格式說明:

共享目錄

指定ip位址的主機(192.168.1.123)/網段中所有主機(192.168.10.0/24)

(共享引數)

/u01/workspace  192.168.10.0/24(rw,sync)

/u01/archives   192.168.10.0/24(rw,sync)

nfs 訪問許可權說明

ro                     

唯讀訪問

rw            

讀寫訪問

sync          

所有資料在請求時寫入共享

async        

nfs在寫入資料前可以相應請求

secure        

nfs通過1024以下的安全tcp/ip埠傳送

insecure       

nfs通過1024以上的埠傳送

wdelay          

如果多個使用者要寫入nfs目錄,則歸組寫入(預設)

no_wdelay  

如果多個使用者要寫入nfs目錄,則立即寫入,當使用async時,無需此設定。

hide                   

在nfs共享目錄中不共享其子目錄

no_hide                

共享nfs目錄的子目錄

subtree_check    

如果共享/usr/bin之類的子目錄時,強制nfs檢查父目錄的許可權(預設)

no_subtree_check 

和上面相對,不檢查父目錄許可權

all_squash       

共享檔案的uid和gid對映匿名使用者anonymous,適合公用目錄。

no_all_squash   

保留共享檔案的uid和gid(預設)

root_squash     

root使用者的所有請求對映成如anonymous使用者一樣的許可權(預設)

no_root_squas   

root使用者具有根目錄的完全管理訪問許可權

anonuid=***     

指定nfs伺服器/etc/passwd檔案中匿名使用者的uid

2、重啟伺服器端的nfs服務:

service portmap restart

service nfs restart

使修改生效

3、配置客戶端

mount -t nfs -o rw,bg,hard,nointr,rsize=32768,wsize=32768,timeo=600,actimeo=0 192.168.10.121:/u01/archives /u01/archives

mount -t nfs -o rw,bg,hard,nointr,rsize=32768,wsize=32768,timeo=600,actimeo=0 192.168.10.121:/u01/workspace /u01/workspace

/etc/fstab

192.168.1.101:/oracle/archive /oracle/archive    nfs    defaults       0 0 

或者/etc/rc.d/rc.local 使之開機啟動

mount -t nfs -o rw,bg,hard,nointr,rsize=32768,wsize=32768,timeo=600,actimeo=0 192.168.10.121:/u01/archives /u01/archives

mount -t nfs -o rw,bg,hard,nointr,rsize=32768,wsize=32768,timeo=600,actimeo=0 192.168.10.121:/u01/workspace /u01/workspace

Linux下簡單配置nfs檔案系統

文中使用的是rhel4 版本的linux,其他版本會有不同。伺服器端 1 配置 etc exports 格式說明 共享目錄 指定ip位址的主機 192.168.1.123 網段中所有主機 192.168.10.0 24 共享引數 u01 workspace 192.168.10.0 24 rw,sy...

Linux下配置安裝NFS

1 nfs 的啟動與停止 service nfs start service nfs stop service nfs restart 2 nfs 分為伺服器和客戶端 伺服器提供檔案共享的機器 客戶端就是訪問伺服器的機器 3 伺服器端配置1 etc exports格式 目錄選項 share 192....

NFS簡單配置

應用環境 os linux as4 nfs sever 192.168.3.96 hostname rac01 nfs client 192.168.3.97 hostname rac02 檢查系統是否安裝了包nfs utils及portmap,其中protmap軟體包中的portmap服務,為nf...