Chinaunix首页 | 论坛 | 博客
  • 博客访问: 20261
  • 博文数量: 14
  • 博客积分: 236
  • 博客等级: 入伍新兵
  • 技术积分: 110
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-10 11:57
文章分类

全部博文(14)

文章存档

2012年(14)

我的朋友
最近访客

分类:

2012-05-10 13:34:50

原文地址:Ubuntu 11.10 NFS配置 作者:

安装:

#sudo apt-get install nfs-kernel-server

配置:

#sudo vim /etc/exports
/home/akaedu *(rw,sync,no_root_squash)

注:nfs允许挂载的目录及权限,在文件/etc/exports中进行定义, 各字段含义如下:
/home/akaedu:要共享的目录
* :允许所有的网段访问
rw :读写权限
sync:资料同步写入内在和硬盘
no_root_squash:nfs客户端共享目录使用者权限

使用:

#sudo /etc/init.d/portmap restart <---重启portmap,很重要
#sudo /etc/init.d/nfs-kernel-server restart <---重启nfs服务
#showmount -e <---显示共享出的目录

注:nfs是一个RPC程序,使用它前,需要映射好端口,通过portmap设定
命令执行情况如下:
$ 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/akaedu".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x [ OK ]

* Starting NFS kernel daemon [ OK ]

挂载:
#sudo mount -t nfs ipaddr:/home/akaedu /mnt
注:ipaddr为本机linux的IP地址

卸载:
#sudo umount /mnt

如果用在嵌入式设备上挂载,要加上参数-o nolock

阅读(451) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:73 本免费的语言无关的优秀编程书籍汇总

给主人留下些什么吧!~~