ubuntu22.04 支持NFSV2,出现问题;
1. 安装[size=13.3333px]rpcbind 和 [size=13.3333px]nfs-kernel-server
sudo rpt-get install rpcbind nfs-kernel-server
2. sudo vim /etc/exports 在exports文件里添加内容: /home/xxx/linux/nfs *(rw,sync,no_root_squash) 实际的rootfs目录是/home/xxx/linux/nfs/rootfs
3.systemctl restart rpcbind systemctl restart nfs-kernel-server 查看nfs服务是否开启 showmount -e /home/xxx/linux/nfs *信息表示挂载成功
4. systemctl status rpcbind.service 启动状态
5. 配置/etc/default/nfs-kernel-server sudo vim /etc/default/nfs-kernel-server 更改以下参数: RPCNFSDCOUNT="-V 2 8"; RPCMOUNTDOPTS="-V 2 --manage-gids"; RPCSNFSDOPTS="--nfs-version 2,3,4 --debug --syslog"; 有的帖子说是更改 RPCSVCGSSDOPTS="--nfs-version 2,3,4 --debug --syslog"; 试过都不行
6. sudo vim /etc/nfs.conf 更改以下参数: udp=y vers2=y
7.查看nfs配置 nfsconf --dump
gys@gys-ThinkPad-Edge-E431:~$ nfsconf --dump [general] pipefs-directory = /run/rpc_pipefs
[mountd] manage-gids = y
[nfsd] udp=y vers2 = y
8.确认运行版本支持 systemctl restart rpcbind systemctl restart nfs-kernel-server
sudo cat /proc/fs/nfsd/versions 还是 +3 +4 +4.1 +4.2 还是没有出现+2
9.防火墙关闭状态 sudo ufw status status:inactive
10.alpha开发板挂载NFS时,还是报错: [ 102.466758] VFS: Unable to mount root fs via NFS, trying floppy. [ 102.473382] VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6 [ 102.480753] Please append a correct "root=" boot option; here are the available partitions: [ 102.489197] 0100 65536 ram0 (driver?) [ 102.493941] 0101 65536 ram1 (driver?) 在网上查询各种帖子名据说是NFSV2版本支持的问题, 可是为什么改不过来,加不上vers2 啊?
各位有没有遇到这种情况的?
|