NFS挂载根文件系统

来源:互联网 发布:淘宝客服聊天软件 编辑:程序博客网 时间:2024/05/29 14:18

首先确保你的文件系统可以正常工作,通过NFS挂载只是几个服务的事情而已,

我的系统是Ubuntu 10.04

既然是NFS服务器,那么就需要开启相关的服务。

首先来安装吧:

sudo apt-get install nfs-kernel-server

有的服务直接安装apt-get 在10.04上不支持,可能是源没有更新的缘故,我在之前的文章中有介绍,下面是需要的包

http://blog.csdn.net/qianguozheng/article/details/6639675

libnfsidmap2_0.24-1_i386.deb   

librpcsecgss3_0.19-2_i386.deb

xinetd_2.3.14-7ubuntu4_i386.deb

 

NFS是基于UDP的网络协议的,以前在网上看到说还用了RPC远程过程调用,所以要开启portmap服务。

使用NFS服务,至少需要启动以下3个系统守护进程。

1. rpc.nfsd

功能:管理客户端是否能够登入服务器。

2.rpc.mountd

功能:管理NFS的文件系统。当客户端顺利通过rpc.nfsd登录NFS服务器后,在使用NFS服务器所提供的文件前,还必须通过文件使用权限的验证,rpc.mountd会读取NFS的配置文件/etc/exports来对比客户端的权限。

#共享的目录

/arm/root *(rw,sync,no_subtree_check)

3.portmap

功能:进行端口映射工作。

 

把下面的内容做成bash,每次执行挂载前执行,很好的方法

#modefine host ip
sudo ifconfig eth0 192.168.0.1
echo $(ifconfig)
#start portmap server
sudo /etc/init.d/portmap start
echo $(/etc/init.d/portmap start)
#restart nfs-kernel-server
sudo /etc/init.d/nfs-kernel-server restart
echo $(/etc/init.d/nfs-kernel-server restart)
#restart telnet server
sudo /etc/init.d/xinetd restart
echo $(/etc/init.d/xinetd restart)

然后开启系统,配置U-boot就可以挂载了,注意了哦,网线必须的哦

这里对NFS服务器也有较为详细的介绍

http://hmsl666.blog.163.com/blog/static/94722982009314104456888/

http://linux.chinaunix.net/techdoc/net/2006/03/09/928740.shtml