PC为服务端,开发板为客户端
一、PC端配置
1.安装nfs
junior@junior-pc:~$ sudo apt-get install nfs-kernel-server
2.配置
a.PC端创建nfs共享目录
junior@junior-pc:~$ mkdir nfs
b.修改配置文件
junior@junior-pc:~$ sudo vim /etc/exports
在/etc/exports文件最后加上:
/home/junior/nfs/ 10.0.88.* (sync,rw,no_root_squash)
10.0.88.*为允许nfs客户端的IP地址,*为通配符。(*后面有空格)
“rw” 表示允许读写,“ro” 表示为只读。
sync :表示同步写入到内存与硬盘中。
no_root_squash : 表示当客户端以root身份访问时赋予本地root权限。
c.加载配置文件
junior@junior-pc:~$ exportfs -a
3.重启相关服务
a.重启rpcbind服务
junior@junior-pc:~$ sudo service rpcbind restart
b.重启nfs服务
junior@junior-pc:~$ sudo service nfs-kernel-server restart
二、客户端配置
mount -t nfs -o nolock 10.0.88.248:/home/junior/nfs /mnt/nfs
10.0.88.248为客户端IP
/mnt/nfs为开发板挂载的目录
三、异常分析
1.查看挂载项
junior@junior-pc:~$ showmount -e
2.查看系统日志
junior@junior-pc:~$ cat /var/log/syslog
977






