nfs0
nfs # archlinux nfs-utils 包含客户端和服务端实现 sudo pacman -S nfs-utils # ubuntu, nfs client sudo apt install nfs-common nfs server nfs 依赖时钟, 需要 ntp 服务 archlinux enabled ntp by default https://blog.wiloon.com/ntp mkdir -p /data/nfs /mnt/nfs mount --bind /mnt/nfs /data/nfs vim /etc/fstab /mnt/nfs /data/nfs none bind 0 0 # NFS 服务的主配置文件 # 格式:[共享的目录] [主机名或IP(参数,参数)] vim /etc/exports /data/nfs *(rw,async,no_root_squash) # reload nfs config exportfs -arv # 查看 export dir exportfs -v sudo systemctl restart nfs-server sudo systemctl enable nfs-server showmount -e 127.0.0.1 nfs client linux client showmount -e servername mount server:/ /mountpoint/on/client windows client # 挂载之前先改注册表 需要读写权限的需要修改注册表 通过修改注册表将windows访问NFS时的UID和GID改成0即可,步骤如下 1. 在运行中输入regedit,打开注册表编辑器; 2. 进入HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default条目; 3. Create two DWORD values namely AnonymousUid and AnonymousGid,十进制值跟nfs服务端文件 所属用户 的用户 id一致。 # 重启windows的NFS client service C:\Windows\system32>hostname DESKTOP-AE0D2H0 C:\Windows\System32>nfsadmin client DESKTOP-AE0D2H0 config casesensitive=yes The settings were successfully updated. C:\Windows\system32>nfsadmin client DESKTOP-AE0D2H0 stop The service was stopped successfully. C:\Windows\system32>nfsadmin client DESKTOP-AE0D2H0 start The service was started successfully. C:\Windows\system32> #win10 mount nfs 打开控制面板 > 程序 > 启用或关闭 Windows 功能,找到NFS服务打开子目录勾选NFS客户端与管理工具。 showmount -e [server] 显示 NFS 服务器导出的所有共享。 showmount -a [server] 列出客户端主机名或 IP 地址,以及使用"主机:目录"格式显示的安装目录。 showmount -d [server] 显示 NFS 服务器上当前由某些 NFS 客户端安装的目录。 # 挂载nfs mount -o anon \\192.168.50.220\data\nfs\data Z:\ #卸载 umount z: https://wiki.archlinux.org/index.php/NFS#Installation ...