tiny4412 NFS(非文件系统)的挂载

来源:互联网 发布:淘宝如何省钱ppolo 编辑:程序博客网 时间:2024/06/05 02:43

1、开发板准备:

在uboot命令行设置正确的ip地址,确保系统起来之后PC与开发板能够互相ping通。

若开发板地址与PC端不在同一个网段,可通过以下方法修改开发板IP地址:

vi /etc/eth0-setting

将其中的ip地址改成你想要的ip,重启。pc和开发板能ping通

2、PC 端准备:

安装:sudo apt-get install nfs-kernel-server nfs-common portmap

配置:vim /etc/exports,在最后一行加入:/home/nfs *(rw,sync,no_root_squash,no_subtree_check)

3、重启:

sudo /etc/init.d/rpcbind restart 

sudo /etc/init.d/nfs-kernel-server restart

4、本机测试:

sudo mount -t nfs localhost:/home/nfs  /mnt

查看内容,以便确定是否挂载成功

取消挂载:

sudo umount /mnt

5、在开发板上挂载nfs:

mount -t nfs -o nolock 192.168.1.100:/home/nfs /mnt


至此挂载完成

若想实现开机自动挂载,可在/etc/init.d/里的rcS 末尾添加:

mount -t nfs -o nolock 192.168.1.100:/home/nfs /mnt       便可实现开机自动挂载nfs

1 0