nfs配置及常见错误

来源:互联网 发布:vip软件 编辑:程序博客网 时间:2024/05/16 06:50

买了块am335x开发板,然后就是各种搭建环境,这是我在弄nfs时找的资料

1.要使用mount挂载网络文件系统,主机就要有nfs服务
apt-get install nfs-kernel-service nfs-common portmap

2.配置
打开/etc/exports 在末尾加入:
/tftpboot *(rw,sync,no_root_squash)
解释:
/tftpboot ---nfs目录
*   ---所有网段
sync ---数据同步写入内在和硬盘
no_root_squash ---nfs客户端共享目录使用者权限
3.重启服务
sudo service portmap restart
sudo service nfs-kernel-server restart

4.测试
在本机可以测试下:
sudo mount -t nfs localhost:/tftpboot /mnt
没出错即表示成功


错误情况:
1.mount -t nfs -o rw 192.168.0.123:/tftpboot /mnt/work
mount: mounting 192.168.0.123:/tftpboot on /mnt/work failed: No such file or directory
本机的/mnt/work目录不存在


2.mount -t nfs -o rw 192.168.0.123:/tftpboot/ /mnt/
mount: mounting 192.168.0.123:/tftpboot/ on /mnt/ failed: Connection refused
参数错误,把rw换成nolock即可成功


3.mount -t nfs -o rw 192.168.0.123:/tftpboot /mnt/work
mount: RPC: Remote system error - Connection refused
服务器没有安装nfs服务

0 0
原创粉丝点击