Ubuntu下安装nfs服务
来源:互联网 发布:linux查看内存信息 编辑:程序博客网 时间:2024/05/22 07:48
From: http://blog.csdn.net/shawnrong/article/details/1656668
1. sudo apt-get install nfs-kernel-server
会自动安装nfs-common和portmap
2. 配置portmap:
2.1. 编辑/etc/default/portmap, 将 -i 127.0.0.1 去掉.
2.2. 配置/etc/hosts.deny,禁止任何host能和你的NFS服务器进行NFS连接,加入:
--------------------------------------------------
### NFS DAEMONS
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL
--------------------------------------------------
2.3. 配置/etc/hosts.allow,允许那些你想要的主机和你的NFS服务器建立连接。
下列步骤将允许任何IP地址以192.168.2开头的主机(连接到NFS服务器上),也可以指定特定的IP地址。加入:
--------------------------------------------------
### NFS DAEMONS
portmap: 138.198.177.
lockd: 138.198.177.
rquotad: 138.198.177.
mountd: 138.198.177.
statd: 138.198.177.
--------------------------------------------------
3. 配置/etc/exports
要将/data/rootfs2.6目录让138.198.177.*的IP共享, 则在该文件末尾添加下列语句:
/data/rootfs2.6 *(rw,sync,no_root_squash)
运行 $ sudo exportfs -r 更新。
--------------------------------------------------
这里如果指定ip范围,mount测试的时候得到"权限不够"的错误
/data/rootfs2.6 138.198.177.*(rw,sync,no_root_squash)
--------------------------------------------------
4. 运行 $ showmount -e 查看NFS server的export list.
5. 运行 $ sudo /etc/init.d/nfs-kernel-server restart 重启nfs服务
6. 测试NFS
可以尝试一下挂载本地磁盘(假设本地主机IP地址为:192.128.2.1,将/home/zp/share挂载到/mnt)
$ sudo mount 138.198.177.39:/data/rootfs2.6 /mnt
运行 $ df 看看结果
$ sudo umount /mnt
注意被拷贝文件的读/写权限!
另外, 可以使用一定的参数:
使用加参数的办法:mount -o nolock,rsize=1024,wsize=1024,timeo=15 192.168.2.130:/tmp/ /tmp/
参考文档:
--------------------------------------------------
Debian/Ubuntu的NFS配置
http://www.cublog.cn/u/13991/showart.php?id=107428
--------------------------------------------------
- Ubuntu下安装nfs服务
- 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 12.04 下安装 、配置、启动 FTP、SSH、NFS服务
- Matlab笔记 - GUI图形界面编程
- 日志规范
- Can't connect to MySQL server on (110)
- Apache用户名和密码验证
- the colors of the morning
- Ubuntu下安装nfs服务
- linux环境下的守护进程编写
- OS中的SSTF 和LLF
- 白话经典算法系列之一 冒泡排序的三种实现 .
- cdh4.2的HA安装准备
- hdu 1075 What Are You Talking About
- Ubuntu安装Samba实现跟windows文件共享
- 碰到MySQL无法启动1067错误问题
- ORA-38760: This database instance failed to turn on flashback database