Ubuntu 10.04 NFS配置(补充终端中通过NFS 启动的过程)(经测试)
2013-10-22 17:01
387 查看
之前解决了"mount.nfs:access denied by server while mounting"
今早终于成功从NFS启动,所以跟踪此贴,补充下从NFS启动的过程
First
配置NFS,并在本地测试
环境 ubuntu 10.04 vm 7.1
终端
ifconfig 得到 ubuntu资料
INET ADDR 192.168.0.3
BCAST 192.168.0.255
MASK 255.255.255.0
一 安装NFS
$ sudo apt-get install nfs-kernel-server
$ sudo apt-get install nfs-common
二 配置NFS
1 $ sudo dpkg-reconfigure portmap , 对Should portmap be bound to the loopback address? 选N
2 $ sudo vi /etc/default/portmap 末行清除 "-i 127.0.0.1"
三 配置hosts.deny
$ sudo vi /etc/hosts.deny
文本末添加
### NFS DAEMONS
portmap: ALL
lockd: ALL
mountd: ALL
rquotad: ALL
statd: ALL
四 配置hosts.allow
$ sudo vi /etc/hosts.allow
文本末加入
### NFS DAEMONS
portmap: 192.168.0.
lockd: 192.168.0.
rquotad: 192.168.0.
mountd: 192.168.0.
statd: 192.168.0.
$ sudo /etc/init.d/portmap restart 重启portmap daemon.
显示如下
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart portmap
portmap start/running, process XXXX
五 配置/etc/exports
$ sudo vi /etc/exports
文本末添加
/home/work *(rw,sync,no_root_squash)
$ sudo showmount -e
显示 clnt-create : RPC : Program not registered
$ sudo exportfs -r 更新
$ sudo showmount 192.168.0.3 -e
显示
Export list for 192.168.0.3:
/home/work *
六 启用
$ sudo /etc/init.d/nfs-kernel-server restart 重启nfs服务
显示如下
* Stopping NFS kernel daemon [ OK ]
* Unexporting directories for NFS kernel daemon... [ OK ]
* Exporting directories for NFS kernel daemon...
exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/home/work".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x
* Starting NFS kernel daemon [ OK ]
挂载
mount -t nfs 192.168.0.3:/home/work /mnt
mount -t nfs 192.168.0.3:/home/work /mnt -o nolock
不出现警告即成功挂载 ,
$sudo ls /nfsmnt . 看到与/home/work中的内容一样.
SECOND
从NFS启动系统
我配置NFS的目的是为了方便调试程序.把程序下到板子里测试.
$sudo umount /nfsmnt
$sudo cd /home
$sudo mkdir nfsroot
$sudo cd nfsroot
$sudo cp -a /home/cheung/works/nfsroot/* ./
(前路径是我用BUSYBOX***的文件系统 ,在这里,我把它都移到/home/nfsroot,方便以后使用)
(但并不建议像我这样复制,很多情况是不行的,还是直接在NFSROOT里做系统)
至于文件系统这里不赘述了,我也是个菜鸟,就自己学着做了个.
$sudo chmod 777 -R /home/nfsroot
更改NFS配置
$sudo vi /etc/exports
把FIRST中的/home/work改成/home/nfsroot
$sudo exportfs -r 更新
$sudo /etc/init.d/portmap restart
$sudo /etc/init.d/nfs-kernel-server restart
接下来,打开win下的secureCRT或者minicom
在开机或者复位时迅速按下enter , 进入uboot控制台,以下是我的开机参数
"
U-Boot 2009.11-rc2 (Jun 11 2010 - 15:39:57)
DRAM: 64 MB
Flash: 2 MB
NAND: 128 MiB
In: serial
Out: serial
Err: serial
Net: dm9000
dm9000 i/o: 0x30000000, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 12:34:56:78:90:12
operating at 10M full duplex mode
Hit any key to stop autoboot: 0
NewMsg9261> print
bootargs=console=ttyS0,57600 root=/dev/mtdblock0 rw rootfstype=jffs2 init=/linuxrc
bootcmd=nand read 0x22000000 0xA0000 0x200000; bootm
bootdelay=3
baudrate=57600
ethact=dm9000
ethaddr=12:34:56:78:90:12
ipaddr=192.168.0.5
serverip=192.168.0.2
Environment size: 243/131067 byte
"
先把nand flash中原有的jffs2删除掉
<newmsg9261> nand erase 0x300000(这里是我之前存放jffs2文件系统的地址)
设置启动参数bootargs
<newmsg9261> setenv bootargs console=ttyS0,57600 root=/dev/nfs rw mem=128M nfsroot=192.168.0.3:/home/nfsroot ip=192.168.0.5:192.168.0.3:192.168.0.1:255.255.255.0:newmsg9261:eth0: off
(在minicom中可能不会自动换行 , 那就按ctrl+A,然后w, ok)
这里解释一下参数
"nfsroot=" 后面是我NFS主机的IP地址和我的文件系统的路径, 上面说过
"ip="后面
一 目标板IP 192.168.0.5(我的启动参数里print给大家了,就是ipaddr)
二 主机IP 192.168.0.3
三 目标板网关 192.168.0.1
四 子网掩码 255.255.255.0
五 开发板名字(随你便)
六 eth0(网卡设备名称)
<newmsg9261>sa (保存设置)
<newmsg9261>boot 启动
以下是我启动成功的图片
我也是菜鸟一个, 最近配置这些 , 也是花了很长时间和力气 。
这只是我的一点心得。
有帮助的,谢谢大家顶下。 高手的,也别拍砖 。 ^_^
今早终于成功从NFS启动,所以跟踪此贴,补充下从NFS启动的过程
First
配置NFS,并在本地测试
环境 ubuntu 10.04 vm 7.1
终端
ifconfig 得到 ubuntu资料
INET ADDR 192.168.0.3
BCAST 192.168.0.255
MASK 255.255.255.0
一 安装NFS
$ sudo apt-get install nfs-kernel-server
$ sudo apt-get install nfs-common
二 配置NFS
1 $ sudo dpkg-reconfigure portmap , 对Should portmap be bound to the loopback address? 选N
2 $ sudo vi /etc/default/portmap 末行清除 "-i 127.0.0.1"
三 配置hosts.deny
$ sudo vi /etc/hosts.deny
文本末添加
### NFS DAEMONS
portmap: ALL
lockd: ALL
mountd: ALL
rquotad: ALL
statd: ALL
四 配置hosts.allow
$ sudo vi /etc/hosts.allow
文本末加入
### NFS DAEMONS
portmap: 192.168.0.
lockd: 192.168.0.
rquotad: 192.168.0.
mountd: 192.168.0.
statd: 192.168.0.
$ sudo /etc/init.d/portmap restart 重启portmap daemon.
显示如下
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart portmap
portmap start/running, process XXXX
五 配置/etc/exports
$ sudo vi /etc/exports
文本末添加
/home/work *(rw,sync,no_root_squash)
$ sudo showmount -e
显示 clnt-create : RPC : Program not registered
$ sudo exportfs -r 更新
$ sudo showmount 192.168.0.3 -e
显示
Export list for 192.168.0.3:
/home/work *
六 启用
$ sudo /etc/init.d/nfs-kernel-server restart 重启nfs服务
显示如下
* Stopping NFS kernel daemon [ OK ]
* Unexporting directories for NFS kernel daemon... [ OK ]
* Exporting directories for NFS kernel daemon...
exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/home/work".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x
* Starting NFS kernel daemon [ OK ]
挂载
mount -t nfs 192.168.0.3:/home/work /mnt
mount -t nfs 192.168.0.3:/home/work /mnt -o nolock
不出现警告即成功挂载 ,
$sudo ls /nfsmnt . 看到与/home/work中的内容一样.
SECOND
从NFS启动系统
我配置NFS的目的是为了方便调试程序.把程序下到板子里测试.
$sudo umount /nfsmnt
$sudo cd /home
$sudo mkdir nfsroot
$sudo cd nfsroot
$sudo cp -a /home/cheung/works/nfsroot/* ./
(前路径是我用BUSYBOX***的文件系统 ,在这里,我把它都移到/home/nfsroot,方便以后使用)
(但并不建议像我这样复制,很多情况是不行的,还是直接在NFSROOT里做系统)
至于文件系统这里不赘述了,我也是个菜鸟,就自己学着做了个.
$sudo chmod 777 -R /home/nfsroot
更改NFS配置
$sudo vi /etc/exports
把FIRST中的/home/work改成/home/nfsroot
$sudo exportfs -r 更新
$sudo /etc/init.d/portmap restart
$sudo /etc/init.d/nfs-kernel-server restart
接下来,打开win下的secureCRT或者minicom
在开机或者复位时迅速按下enter , 进入uboot控制台,以下是我的开机参数
"
U-Boot 2009.11-rc2 (Jun 11 2010 - 15:39:57)
DRAM: 64 MB
Flash: 2 MB
NAND: 128 MiB
In: serial
Out: serial
Err: serial
Net: dm9000
dm9000 i/o: 0x30000000, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 12:34:56:78:90:12
operating at 10M full duplex mode
Hit any key to stop autoboot: 0
NewMsg9261> print
bootargs=console=ttyS0,57600 root=/dev/mtdblock0 rw rootfstype=jffs2 init=/linuxrc
bootcmd=nand read 0x22000000 0xA0000 0x200000; bootm
bootdelay=3
baudrate=57600
ethact=dm9000
ethaddr=12:34:56:78:90:12
ipaddr=192.168.0.5
serverip=192.168.0.2
Environment size: 243/131067 byte
"
先把nand flash中原有的jffs2删除掉
<newmsg9261> nand erase 0x300000(这里是我之前存放jffs2文件系统的地址)
设置启动参数bootargs
<newmsg9261> setenv bootargs console=ttyS0,57600 root=/dev/nfs rw mem=128M nfsroot=192.168.0.3:/home/nfsroot ip=192.168.0.5:192.168.0.3:192.168.0.1:255.255.255.0:newmsg9261:eth0: off
(在minicom中可能不会自动换行 , 那就按ctrl+A,然后w, ok)
这里解释一下参数
"nfsroot=" 后面是我NFS主机的IP地址和我的文件系统的路径, 上面说过
"ip="后面
一 目标板IP 192.168.0.5(我的启动参数里print给大家了,就是ipaddr)
二 主机IP 192.168.0.3
三 目标板网关 192.168.0.1
四 子网掩码 255.255.255.0
五 开发板名字(随你便)
六 eth0(网卡设备名称)
<newmsg9261>sa (保存设置)
<newmsg9261>boot 启动
以下是我启动成功的图片
我也是菜鸟一个, 最近配置这些 , 也是花了很长时间和力气 。
这只是我的一点心得。
有帮助的,谢谢大家顶下。 高手的,也别拍砖 。 ^_^
相关文章推荐
- Ubuntu10.04+mini2440下ARM-linux开发环境搭建(2)----NFS服务器的配置及通过NFS启动linux
- Mini2440通过nfs启动ubuntu-10.04系统总结
- Ubuntu上snmp安装、配置、启动及远程测试完整过程 推荐
- Ubuntu 10.04下安装配置NFS过程
- Ubuntu上snmp安装、配置、启动及远程测试完整过程
- Ubuntu 10.04下安装配置NFS过程
- ubuntu 10.04 tftp配置,测试通过
- Ubuntu10.04 NFS配置
- Ubuntu10.04 nfs安装与配置
- ubuntu10.04 bochs 安装配置及启动
- 【Ubuntu使用技巧】vsftpd 虚拟用户配置(Ubuntu 10.04环境下通过)
- Ubuntu 10.04上NFS服务的安装、配置
- Ubuntu配置ecilpse终端启动
- Ubuntu通过NFS启动OK6410 arm linux系统
- ORB_SLAM运行详细过程(ubuntu14.04系统和ROS Indigo环境搭建,配置及测试运行)
- solr5.5安装配置过程-本人测试通过
- Ubuntu 11.10 通过配置vnc使windows可以远程桌面,自动启动【转】
- Debian 3 通过nfs 共享 ubuntu 10.04的数据
- ubuntu下配置pxe启动网络安装系统(pxe+dhcp+tftp+nfs)
- ubuntu(virtualbox)上和mini6410之间通过NFS共享目录的问题(含虚拟机网卡配置)