首先安装:sudo apt-getinstall nfs-kernel-server
sudo apt-get install portmap
完成后添加
运行 sudo gedit /etc/exports
在其中添加 /opt/GTStudio/GT2440/root_qtopia*(rw,sync,no_root_squash) 其中红色部分为要被共享的根目录,*为任意主机可以共享该文件,也可以设置为ip。
启动nfs服务
/etc/init.d/nfs-kernel-serverstart
sudo /etc/init.d/nfs-kernel-server restart
这将启动nfs 服务,可以输入以下命令检验nfs 该服务是否启动。
mount -t nfs localhost:/opt/GTStudio/GT2440/root_qtopia /mnt/ 红色为要共享的目录
如果没有出现错误信息, 您将可以浏览到/mnt 目录中的内容和/home/boot/GT2440/root_nfs是一致的。
使用这个命令可以停止nfs服务:
#/etc/init.d/nfs stop