ubuntu-14.04.3-server-amd64 配置 nfs
0.创建nfs目录:
root@iot-linux:/#mkdir /nfs/rootfs
1.使用163源,更新:
root@iot-linux:/nfs/rootfs# apt-get update
root@iot-linux:/nfs/rootfs# apt-get upgrade
2.安装nfs-kernel-server:
root@iot-linux:/nfs/rootfs# apt-get install nfs-kernel-server
修改/etc/exports文件,在最后一行添加:
/nfs/rootfs *(rw,sync,no_root_squash,no_subtree_check)
/nfs/rootfs :nfs客户端加载目录
* :允许所有的网段访问,也可以使用具体的IP
rw :挂接此目录的客户端对该共享目录具有读写权限
sync :资料同步写入内存和硬盘
no_root_squash :root用户具有对根目录的完全管理访问权限。
no_subtree_check :目录的权限。
注意,*和后面的括号不能出现空格。
3.重启nfs服务:
root@iot-linux:/nfs/rootfs# /etc/init.d/nfs-kernel-server.dpkg-new restart
4.测试nfs服务是否成功
root@iot-linux:/nfs/rootfs# /etc/init.d/nfs-kernel-server.dpkg-new status
nfsd running
root@iot-linux:/nfs/rootfs#touch test.c
ARM linux 挂载 nfs
root@firefly:~#mount -t nfs 192.168.1.3:/nfs/rootfs /mnt -o nolock
root@firefly:/# cd /mnt
root@firefly:/mnt# ls
test.c
root@firefly:/mnt#