Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1813165
  • 博文数量: 274
  • 博客积分: 2366
  • 博客等级: 大尉
  • 技术积分: 1880
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-22 09:37
文章分类

全部博文(274)

文章存档

2022年(1)

2020年(10)

2019年(7)

2018年(18)

2017年(26)

2016年(32)

2015年(43)

2014年(30)

2013年(44)

2012年(36)

2011年(17)

2010年(10)

分类: LINUX

2011-06-09 11:09:32

nfs安装:apt-get install nfs-common nfs-kernel-server portmap
配置文件:/etc/exports
配置文件举例:
   $ cat /etc/exports
   /home/share 192.168.1.*(rw,sync) *(ro) #所有192.168.1*主机可以访问目录/home/share
# exports –rv  
服务:/etc/init.d/nfs-kernel-server start|stop|restart
主机ip地址修改:/etc/network/interfaces
主机DNS:/etc/resolv.conf
服务:/etc/init.d/networking start|stop|restart
smb fs 安装:apt-get install smbfs
mount
nfs:mount -t nfs //192.168.2.210:/nfsroot /home/mnt -o nolock
cifs/smb:mount -t cifs //192.168.2.210/lxshare /home/mnt --verbose -o user='u1',passwd='p1'
阅读(1178) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

pppStar2018-01-06 22:26:09

在qemu的网络和主机能通信后,就可以使用nfs来从虚拟机访问主机了,方法是在虚拟机内执行命令:




[plain] view plain copy 
1.mount -t nfs -o nolock 192.168.1.100:/home/charles /mnt  

但是,后面发现i一个问题,无法在 /mnt目录下写入新文件,或者删除i一个文件,总是提示不允许。 

经过排查,发现主机的nfs 配置有问题, /etc/exports 缺少了一个选项 no_root_squash.

添加上后就行了:




[plain] view plain copy 
1.$ cat /etc/exports   
2.# /etc/exports: the access control&nb