在ubuntu上配置NFS
来源:互联网 发布:企业seo外包服务 编辑:程序博客网 时间:2024/06/08 01:31
#sudo apt-get install nfs-kernel-server
ubuntu12.04中的已经是最新版本了
2.配置共享目录的路径和访问权限
安装好nfs-common和portmap后还需配置共享目录的路径和访问权限,NFS的配置文件是/etc/exports。
配置的格式如下:
[共享路径][主机名或IP地址(参数,参数)]
举例:
/home/zhcx/nfs_root192.168.1.111(rw,sync,no_root_squash)
3.重启服务:
#sudo /etc/init.d/portmap restart
#sudo /etc/init.d/portmap stop
#sudo /etc/init.d/nfs-kernel-server restart
#showmount -e
#sudo /etc/init.d/portmap restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service portmap restart
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 474
#sudo /etc/init.d/nfs-kernel-server restart
* 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/xgc".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x
[ OK ]
* Starting NFS kernel daemon [ OK ]
#showmount -e
Export list for xgc-VirtualBox:
/home/zhcx/nfs_root
4.挂载文件
现在可以在本机上试一下:
#sudo mount -t nfs localhost:/home/zhcx/nfs_root /mnt
注:localhost为本机linux的IP地址
这样就把共享目录挂到了/mnt目录,在目录/mnt中可以看得到目录/home/zhcx/nfs_root中的文件。
取消挂载用:
#sudo umount /mnt
如果用在嵌入式设备上挂载,要加上参数-o nolock
我在开发板上使用的挂载命令:
mount -t nfs -o nolock 192.168.1.8:/home/zhcx/nfs_root /mnt
- 在ubuntu上配置NFS
- ubuntu上配置NFS服务器
- 在Ubuntu下配置NFS
- 在Ubuntu下安装、配置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上NFS的安装配置
- Ubuntu上NFS的安装配置,启用nfs功能
- FTP、TFTP、NFS、SSH介绍及在 Ubuntu 上的安装配置
- c++-->面向对象
- js中自定义mouseenter、mouseleave的写法
- 对象关系映射
- 『MySQL』时间戳转换
- iOS 使用 宏定义macros (#,##,...,__VA_ARGS_)
- 在ubuntu上配置NFS
- 【QT】2.软件安装及环境
- C++类型转换
- 余世维有效沟通全文字!
- if defined的作用
- 黑马程序员——抽象类, 接口, Object类
- struts2中action接收参数的方法
- HDU 4597 Play Game 解题报告
- uva10570 - Meeting with Aliens(会见外星人)