开始之前,我们要了解目的【Ubuntu下搭载nfs服务器】- 这个目的所引用的文章更具参考性,下文只是手段之一。
Ubuntu 12.04 LTS nfs-util 安装及配置手记
Note for Installing nfs-util on Ubuntu 12.04 LTS
写在前面:you have to know first:
【Client端install the nfs-common package. Server端install nfs-kernel-server】
is recommended.
1. Intall nfs-kernel-server:
$ apt-get install nfs-kernel-server
2. Create a folder:
$ mkdir -p /opt/share
3. Change Permission:
$ chmod -R 777 /opt/share
4. Configure /etc/exports:
$ sudo chmod a+w /etc/exports #change "read only" into writeable.
opt/share 10.112.18.0/255.255.255.0(rw,no_root_squash)
5. Configure /etc/hosts.allow:
portmap:10.112.18.0/255.255.255.0
6. Configure /etc/hosts.deny:
portmap:ALL
7. Restart two services:
service portmap restart
service nfs-kernel-server restart
-----
8. Insatll nfs-common on another Ubuntu:
apt-get install nfs-common
9. Create new folder:
mkdir ~/test
然后运行测试命令看一下:
# showmount -e 10.112.18.158
Export list for 10.112.18.158:
/opt/share 10.112.18.0/255.255.255.0
找到nfs server的挂载目录了。现在手工挂载:
mount -t nfs4 10.112.18.158:/opt/share ~/test/
现在可以测试了,应该成功。
[reference]http://www.linuxidc.com/Linux/2012-09/70728.htm
- 在实验中可暂时关闭NFS服务器主机中的iptables网络防火墙服务
# service iptablesstop
======================= 执意安装 nfs-utils ====================
1. 检查本机是否安装nfs-utils
Check if the nfs-utils has been installed on Linux
Command:
$ rpm -q nfs-utils
We get:(if nfs-utils is not installed)
$ rpm -q nfs-utils
package nfs-utils is not installed
2. 下载nfs-utils安装包
Download nfs-utils Installation package
Google: nfs-utils,
we find nfs-utils-1.2.9.tar.bz2 at:
http://sourceforge.net/projects/nfs/
Download it to ~/Download
----------------------------------------------------
$cd ~/Download
$tar -jxvf nfs-utils-1.2.9.tar.bz2
// unpack it
$cd nfs-utils-1.2.9
// enter this folder
$cat readme
//open and read the readme file
----------------------------------------------------
We can see there are instructions, and we notice:
--------------------
1. COMPILING
Unpack the sources and run these commands:
# ./configure
# make
To install binaries and documenation, run this command:
# make install
---------------------
Try the commands given above:
------------------------------------
$ ./configure
we met an error and gave it up.. :(