ITPub博客

首页 > Linux操作系统 > Linux操作系统 > linux nfs

linux nfs

原创 Linux操作系统 作者:netwant 时间:2011-12-30 22:27:35 0 删除 编辑
linux nfs[@more@]

nfs 共享目录被保存在/etc/exports 文件里。默认为空,即没有任何共享目录。
exports文件格式:
目录(绝对路径) 客户端(选项1,选项2,选项n)
客户端可是ip地址,主机名,域名,ip网段如(1.1.1.1/255.255.255.0)

选项中有读写权限,同步异步等安全性设置。

例子:
[root@lvs ~]# more /etc/exports
/home 193.168.10.11(rw,sync)

/home 193.168.10.11(rw,sync)
/home 193.168.10.11 (rw,sync) 带有空格的,打开了全局共享。

[root@lvs ~]#service portmap restart
[root@lvs ~]#service nfs restart

查看共享目录
[root@lvs ~]# exportfs -v
/home 193.168.10.11(rw,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)

挂载
mount -t nfs 193.168.10.10:/home /mnt

[root@emc ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
18G 3.2G 14G 20% /
/dev/sda1 99M 13M 82M 14% /boot
tmpfs 124M 0 124M 0% /dev/shm
193.168.10.10:/home 19G 5.1G 13G 30% /mnt

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/309902/viewspace-1056994/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: dba 职责
请登录后发表评论 登录
全部评论

注册时间:2010-11-17

  • 博文量
    61
  • 访问量
    180996