开发板的nfs服务

来源:互联网 发布:java类中有哪些元素 编辑:程序博客网 时间:2024/06/06 12:34
ubuntu 10.04

sbc2440


(一)NFS服务


# apt-get install nfs-kernel-server
# vim /etc/exports


添加 其中第一个是根目录,第二个允许所有IP,第三个表示访问服务器拥有相应的权限
/sbc2440/rootfs *(rw,sync,no_root_squash)


# service portmap restart
# service nfs-kernel-server restart


测试
# showmount -e
# mount -t nfs localhost:/sbc2440/rootfs /mnt
# umount /mnt


开发板登陆到linux之后可以手动,其中 nolock 是必须的,因为
nfs mount 默认选项包括文件锁,依赖于portmap提供的动态端口分配功能。
解决方法:kill 文件锁(lockd)或者mount -o nolock


# mount -t nfs -o nolock 192.168.3.19:/sbc2440/rootfs /mnt


也可以设置uboot的启动参数从根目录启动
set bootargs noinitrd mem=64M console=ttySAC0,115200 root=/dev/nfs nfsroot=192.168.3.19:/sbc2440/rootfs,rsize=1500,wsize=1500 ip=192.168.0.163:192.168.3.19:192.168.0.1:255.255.252.0::eth0:off
原创粉丝点击