ubuntu nfs共享文件夹


如果出现权限问题检查下这个
chmod -R 777 目录名


nfs
apt-get install nfs-kernel-server
vim /etc/exports
新加
/data *(rw,sync,no_root_squash)

/etc/init.d/portmap restart
/etc/init.d/nfs-kernel-server restart

showmount -e
mount -t nfs localhost:/data /mnt



如果是redhat参考
http://linux.chinaunix.net/techdoc/net/2006/03/09/928740.shtml
在54上:
1.	ntsysv
选中nfs
2.[@tc_157_54 ~]# cat /etc/exports 
/opt/cms5/share *(rw)
先让所有机器可以访问,

3.Service portmap start
4.Service nfs start
如果失败开日志/var/log/messages
[@tc_157_54 ~]# cat /proc/filesystems |grep nfs
nodev   nfsd
表示支持nfs
5.Exportfs –a 
刷新,
 [@tc_157_54 ~]# showmount -e
Export list for tc_157_54:
/opt/cms5/share *
[@tc_157_54 ~]#
查看本机已经共享的目录


其他机器
Service portmap start
客户端参数有
rw,bg,async,noac,noatime,nolock,intr,tcp,nfsvers=3,rsize=32768,wsize=32768
修改/etc/fstab
10.11.11.11:/opt/kof/share /opt/kof/share    nfs     defaults,noatime,nodiratime     0 0
mount -a
或
Mount –t nfs 10.11.157.54:/opt/cms5/share/ /mnt/from54

如果mac下访问不了,请关闭所有的防火墙
并且cat /etc/export
/usr *(rw,insecure)

猜你喜欢

转载自haoningabc.iteye.com/blog/1096710