Linux常用服务配置之nfs服务配置
来源:互联网 发布:企业网易邮箱端口号 编辑:程序博客网 时间:2024/05/17 21:57
安装nfs:
#sudo apt-get install nfs-kernel-server
Ubuntu 10.10中的已经是最新版本了,无需安装
打开/etc/exports文件,在末尾加入:
/home/xgc *(rw,sync,no_root_squash)
注:nfs允许挂载的目录及权限,在文件/etc/exports中进行定义, 各字段含义如下:
/home/xgc:要共享的目录
* :允许所有的网段访问
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设定
命令执行情况如下:
xgc@xgc-VirtualBox:~$ 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
xgc@xgc-VirtualBox:~$ 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 ]
xgc@xgc-VirtualBox:~$ showmount -e
Export list for xgc-VirtualBox:
/home/xgc *
现在可以在本机上试一下:
#sudo mount -t nfs localhost:/home/xgc /mnt
注:localhost为本机linux的IP地址
这样就把共享目录挂到了/mnt目录,取消挂载用:
#sudo umount /mnt
如果用在嵌入式设备上挂载,要加上参数-o nolock
- Linux常用服务配置之nfs服务配置
- Linux常用服务配置之nfs服务配置
- Linux常用服务配置之nfs服务配置
- linux服务配置之NFS
- LINUX笨鸟先飞服务配置之NFS服务
- LINUX笨鸟先飞服务配置之NFS服务
- linux nfs服务配置
- linux配置nfs服务
- linux学习之服务---NFS配置
- Linux下配置nfs服务
- Linux-NFS服务安装配置
- nfs 服务的配置
- NFS服务配置实例
- NFS服务配置
- NFS服务配置
- NFS服务的配置
- Fedora14配置NFS服务
- Fedora14配置NFS服务
- Qc FB驱动 以及 LCD调试过程
- X86 CPU mode switching
- jquery ui tabs详解(中文)
- SQL Server死锁总结
- 图论学习---序列是否可图?
- Linux常用服务配置之nfs服务配置
- Sicily 1902 Counting Problem 简洁dp
- 如何查看firefox的cookie IE的cookie
- 辟谣:地震时“生命三角”救生法不可信!
- jQuery AJAX 分页和支持history hash
- 简化存货核算方法和物料分类帐对比
- Word的页码
- IE7常见bug: <li>下边的3px bug
- Wince下检测SD/USB插拔