ubuntu16.04 nfs配置2.04 配置NFS出错

ubuntu12.04的NFS配置
#sudo apt-get
install nfs-kernel-server
ubuntu12.04中的已经是最新版本了,无需***
打开/etc/exports文件,在末尾加入:
/home/kevin
*(rw,sync,no_root_squash)
注:nfs允许挂载的目录及权限,在文件/etc/exports中进行定义,各字段含义如下:
/home/kevin:要共享的目录
:允许所有的网段访问
:读写权限
sync:资料同步写入内在和硬盘
no_root_squash:nfs客户端共享目录使用者权限
重启服务:#sudo /etc/init.d/portmap
restart &---重启portmap,#sudo
/etc/init.d/nfs-kernel-server restart &---重启nfs服务#showmount -e &---显示共享出的目录
注:nfs是一个RPC程序,使用它前,需要映射好端口,通过portmap设定
命令执行情况如下:
/etc/init.d/portmap restartRather than invoking init
scripts through /etc/init.d, use the service(8)
utility, e.g. service portmap restart
Since the script you are
attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart
portmap start/running, process 474
/etc/init.d/nfs-kernel-server restart* Stopping NFS
kernel daemon [ OK ]
* Unexporting directories for NFS kernel daemon... [ OK ]
* Exporting directories for NFS kernel daemon...
exportfs: /etc/exports [1]:
Neither 'subtree_check' or 'no_subtree_check' specified for export
"*:/home/xgc".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x
* Starting NFS kernel daemon [ OK ]
Export list for xgc-VirtualBox:
/home/kevin *
现在可以在本机上试一下:
#sudo mount -t nfs
localhost:/home/kevin /mnt
注:localhost为本机linux的IP地址
这样就把共享目录挂到了/mnt目录,取消挂载用:
#sudo umount /mnt
如果用在嵌入式设备上挂载,要加上参数-o
我在开发板上使用的挂载命令:
mount -t nfs -o
nolock 192.168.1.8:/home/kevin /mnt
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。ubuntu12.04的NFS配置
ubuntu12.04的NFS配置
发布时间: 22:53:24
编辑:www.fx114.net
本篇文章主要介绍了"ubuntu12.04的NFS配置",主要涉及到ubuntu12.04的NFS配置方面的内容,对于ubuntu12.04的NFS配置感兴趣的同学可以参考一下。
#sudo apt-get install nfs-kernel-server
ubuntu12.04中的已经是最新版本了,无需***
打开/etc/exports文件,在末尾加入:
/home/kevin *(rw,sync,no_root_squash)
注:nfs允许挂载的目录及权限,在文件/etc/exports中进行定义,各字段含义如下:
/home/kevin:要共享的目录
* :允许所有的网段访问
rw :读写权限
sync:资料同步写入内在和硬盘
no_root_squash:nfs客户端共享目录使用者权限
重启服务:
#sudo /etc/init.d/portmap restart&&&&&&&&&&&&&&&&&&---重启portmap,
#sudo /etc/init.d/nfs-kernel-server restart&&&&&&---重启nfs服务
#showmount -e&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&---显示共享出的目录
注:nfs是一个RPC程序,使用它前,需要映射好端口,通过portmap设定
命令执行情况如下:
:~$sudo /etc/init.d/portmap restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service portmap restart
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart portmap
portmap start/running, process 474
:~$sudo /etc/init.d/nfs-kernel-server restart
&* Stopping NFS kernel daemon&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&[ OK ]
&* Unexporting directories for NFS kernel daemon...&&&&&&&&&&&&&&&&&& [ OK ]
&* Exporting directories for NFS kernel daemon...&&&&&
&&exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export &*:/home/xgc&.
& Assuming default behaviour ('no_subtree_check').
& NOTE: this default has changed since nfs-utils version 1.0.x
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& [ OK ]
&* Starting NFS kernel daemon&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &[ OK ]
:~$showmount -e
Export list for xgc-VirtualBox:
/home/kevin *
现在可以在本机上试一下:
#sudo mount -t nfs localhost:/home/kevin /mnt
注:localhost为本机linux的IP地址
这样就把共享目录挂到了/mnt目录,取消挂载用:
#sudo umount /mnt
如果用在嵌入式设备上挂载,要加上参数-o nolock
我在开发板上使用的挂载命令:
mount -t nfs -o nolock 192.168.1.8:/home/kevin /mnt
如果远程挂载出现下面错误:
mount: wrong fs type, bad option, bad superblock on 222.122.30.34:/DataCenter/DataBaseBackUp/ZZ/krzz,
& & & & & missing codepage or other error
& & & & & In some cases useful info is found in syslog - try
& & & & & dmesg | tail or so
如果远程挂载出现下面错误:
& & & & & sudo apt-get install nfs-common
一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!
二、互相尊重,对自己的言论和行为负责。
本文标题:
本页链接:

参考资料

 

随机推荐