ubuntu下为tiny6410搭建nfs服务器的方法
来源:互联网 发布:刘姥姥性格知乎 编辑:程序博客网 时间:2024/05/19 22:05
建立 nfs 服务器
在嵌入式 linux 开发的时候,常常需要使用 nfs 以方便程序的调试。使用 nfs,用户可以
将板子要用到的根文件系统放在主机目录下,开发板则通过以太网挂载到这个目录并将这个
目录下的文件作为根文件系统的内容,这样用户的程序更新后不比重新烧写板子的根文件系
统便能被重新使用,这点能够大大加快程序的调试。
Ubuntu 下安装 nfs 服务器的步骤如下:
1 进行 NFS 服务器端与客户端的安装:
sudo apt-get install nfs-kernel-server nfs-common portmap
安装客户端的作用是可以在本机进行 NFS 服务的测试。
2 配置 portmap
两种方法任选一种就可以:
(1):sudo emacs /etc/default/portmap
去掉 -i 127.0.0.1
(2)sudo dpkg-reconfigure portmap
运行后选择“否”
另外很重要的一点,要用 sysv-rc-conf (而不是 chkconfig)工具查看一下当前 nfs 和 portmap
的状态,若是 off,则用 sudo sysv-rc-conf portmap on 或 sudo sysv-rc-conf nfs-kernel-server on
打开
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync) hostname2(ro,sync)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt)
# /srv/nfs4/homes gss/krb5i(rw,sync)
#
/home/rootfs *(rw,sync)
解释一下:
#后面的都是解释
/home/rootfs 是 NFS 的共享目录,*表示任何 IP 都可以共享这个目录,你可以改为受限的 IP,rw
表示的是权限,sync 是默认的。
4.3.4 更新 exports 文件
只要你更改了/etc/exports, 你不可以通过 sudo exportfs -r 来更新 这个文件
4.3.5 重启 NFS 服务
Sudo /etc/init.d/portmap start
sudo /etc/init.d/nfs-kernel-server restart 重启 nfs 服务
6 本机进行测试
尝试一下挂载本地磁盘(我的 linux 系统 IP 为 192.168.1.104,将/home/rootfs 挂载到/mnt)
$ sudo mount 192.168.1.104:/home/rootfs /mnt
运行 $ df 看看结果
在嵌入式 linux 开发的时候,常常需要使用 nfs 以方便程序的调试。使用 nfs,用户可以
将板子要用到的根文件系统放在主机目录下,开发板则通过以太网挂载到这个目录并将这个
目录下的文件作为根文件系统的内容,这样用户的程序更新后不比重新烧写板子的根文件系
统便能被重新使用,这点能够大大加快程序的调试。
Ubuntu 下安装 nfs 服务器的步骤如下:
1 进行 NFS 服务器端与客户端的安装:
sudo apt-get install nfs-kernel-server nfs-common portmap
安装客户端的作用是可以在本机进行 NFS 服务的测试。
2 配置 portmap
两种方法任选一种就可以:
(1):sudo emacs /etc/default/portmap
去掉 -i 127.0.0.1
(2)sudo dpkg-reconfigure portmap
运行后选择“否”
另外很重要的一点,要用 sysv-rc-conf (而不是 chkconfig)工具查看一下当前 nfs 和 portmap
的状态,若是 off,则用 sudo sysv-rc-conf portmap on 或 sudo sysv-rc-conf nfs-kernel-server on
打开
4.3.3 配置挂载目录和权限
vim /etc/exports
我的配置如下:# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync) hostname2(ro,sync)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt)
# /srv/nfs4/homes gss/krb5i(rw,sync)
#
/home/rootfs *(rw,sync)
解释一下:
#后面的都是解释
/home/rootfs 是 NFS 的共享目录,*表示任何 IP 都可以共享这个目录,你可以改为受限的 IP,rw
表示的是权限,sync 是默认的。
4.3.4 更新 exports 文件
只要你更改了/etc/exports, 你不可以通过 sudo exportfs -r 来更新 这个文件
4.3.5 重启 NFS 服务
Sudo /etc/init.d/portmap start
sudo /etc/init.d/nfs-kernel-server restart 重启 nfs 服务
6 本机进行测试
尝试一下挂载本地磁盘(我的 linux 系统 IP 为 192.168.1.104,将/home/rootfs 挂载到/mnt)
$ sudo mount 192.168.1.104:/home/rootfs /mnt
运行 $ df 看看结果
$ sudo umount /mnt
7 在开发板上测试(将主机的/home/rootfs挂载到开发板的/mnt目录)
mount -t nfs -o nolock 192.168.1.104:/home/rootfs /mnt
- ubuntu下为tiny6410搭建nfs服务器的方法
- ubuntu下为Tiny6410搭建nfs服务器
- ubuntu下tiny6410通过NFS启动系统的方法总结
- fedora 9下搭建Tiny6410 的nfs服务器的方法 非常详细(by 星空武哥)
- Ubuntu下nfs服务器的搭建
- UBUNTU环境下的NFS服务器搭建
- ubuntu下搭建nfs服务器
- ubuntu下搭建nfs服务器
- ubuntu下搭建nfs服务器
- ubuntu下搭建nfs服务器
- ubuntu下搭建nfs服务器
- Ubuntu下搭建nfs服务器
- ubuntu下搭建nfs服务器
- ubuntu下搭建nfs服务器
- ubuntu下搭建nfs服务器
- ubuntu下搭建nfs服务器
- ubuntu下tft服务器和nfs服务器的搭建
- ubuntu 10.04下的tftp/nfs服务器搭建
- jQuery textbox select checkbox radio 取值,设置值
- Java EE ベースの大規模開発における単体テストの実践的アプローチ
- http://acm.nyist.net/JudgeOnline/problem.php?pid=119&&Rmq
- GCC compiler static libraries and dynamic library
- TCP连接探测中的Keepalive 和心跳包
- ubuntu下为tiny6410搭建nfs服务器的方法
- JavaScript面向对象(一)
- Android 中的context, service,active和intent使用详解
- Write a routine that prints out a 2-D array in spiral order
- C语言位运算详解
- [ISAPI_Rewrite] httpd.ini伪静态实现不带www域名自动跳转到带www域名
- 3-3 要求不区分大小写,如abcBA仍认为是回文
- 4_1_小思
- 决策树分类