NFS学习笔记
Ubuntu下的NFS配置
NFS Server
1. 安装相应的包:nfs-kernel-server
sudo apt-get install nfs-kernel-server
2. 将需要分享的目录export出来
vim /etc/exports
/home/forrest/test IP地址(rw,sync,no_subtree_check)
sudo exportfs
sudo /etc/init.d/nfs-kernel-server restart
NFS Client
1. 安装相应的包: nfs-common
sudo apt-get install nfs-common
sudo /etc/init.d/nfs-common start
2. mount:
mount -t nfs -o rw IP地址:/home/forrest/test /mnt/test
RedHat下的NFS配置
在RedHat下,客户端与服务器端享用一样的软件,一样的启动方式。只是服务器端需要配置一下。
这里先记录一下NFS客户端的操作:
Client
[forrest@host ~]$ /etc/init.d/portmap start
Starting portmap: [ OK ]
touch: cannot touch `/var/lock/subsys/portmap': Permission denied
[forrest@host ~]$ sudo /etc/init.d/portmap start
Starting portmap: [ OK ]
[forrest@host ~]$ sudo /etc/init.d/nfs restart
Shutting down NFS mountd: [FAILED]
Shutting down NFS daemon: [FAILED]
Shutting down NFS quotas: [FAILED]
Shutting down NFS services: [FAILED]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
Starting RPC idmapd: [ OK ]
[forrest@host ~]$ sudo mount 10.20.131.157:/home/admin /mnt/efs/www
必须先启动portmap才能启动nfs后台进程,否则会报如下错误:
可以通过status检查:
|
必须启动NFS后台进程才能够mount成功,否则会mount了很久,然后报如下错误:
原因:
可以用如下status检查:
|
除了使用/etc/init.d/nfs脚本,我们也可以使用简便的命令——service
|
使用chkconfig设置nfs服务在系统重启后自动运行
|
SUSE下的NFS安装与配置
in SUSE, you may need to use
/etc/rc.d/init.d/portmap start
/etc/rc.d/init.d/nfs start
参考文章:系统mount.nfs: Input/output error