顯示頁面舊版反向連結Fold/unfold all回到頁頂 本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。 ====== 在 PBS(Debian 12) 主機內安裝 NFS 服務 ====== * 安裝環境 PBS 3.0-3 (Debian 12.2) * 預計 NFS 分享的路徑 : /mnt/datastore/zfs-backup/nfsshare * 預計 NFS Client IP 範圍 : 10.20.0.0 - 10.20.2.254 -> 10.20.0.0/22 ===== 安裝與設定程序 ===== * 安裝 NFS 服務套件<cli> apt update apt install nfs-server -y </cli> * 建立與設定分享目錄<cli> mkdir -p /mnt/datastore/zfs-backup/nfsshare chown 1000:1000 /mnt/datastore/zfs-backup/nfsshare chmod 755 /mnt/datastore/zfs-backup/nfsshare vi /etc/exports </cli><file> : /mnt/datastore/zfs-backup/nfsshare 10.20.0.0/22(rw,sync,no_subtree_check,no_root_squash,all_squash,anonuid=1000,anongid=1000) </file> * 關鍵參數解釋: * no_root_squash:允許 root 用戶保留完整權限 * all_squash:將所有用戶映射到匿名用戶 * anonuid=1000:指定匿名用戶的 UID * anongid=1000:指定匿名用戶的 GID * 啟動 nfs 服務與檢查狀況<cli> exportfs -ra systemctl restart nfs-server systemctl enable nfs-server systemctl status nfs-server </cli>如果正常啟動會看到類似以下的訊息<cli> # systemctl status nfs-server ● nfs-server.service - NFS server and services Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; preset: enabled) Active: active (exited) since Thu 2023-10-19 21:49:02 CST; 17s ago Process: 152486 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS) Process: 152487 ExecStart=/usr/sbin/rpc.nfsd (code=exited, status=0/SUCCESS) Main PID: 152487 (code=exited, status=0/SUCCESS) CPU: 3ms Oct 19 21:49:02 pbs-253 systemd[1]: Starting nfs-server.service - NFS server and services... Oct 19 21:49:02 pbs-253 systemd[1]: Finished nfs-server.service - NFS server and services. </cli> ===== 常見問題 ===== * 關閉 NFS Server 服務<cli> systemctl stop nfs-server systemctl disable nfs-server </cli> ===== 參考網址 ===== * https://www.atlantic.net/dedicated-server-hosting/how-to-install-and-configure-nfs-server-on-debian-11/ {{tag>nfs debian pve}} tech/nfs-pve-debian.txt 上一次變更: 2025/03/27 18:20由 jonathan