August 27, 2010

NFS on centos

by Matnet @ 3:33 pm in BSD & *NIX

It's been a long time I'm not using NFS.

Today i need to generate a backup for web and mysql, so preferable i save this backup to another HDD on the others place.

Then NFS come out on my head. So here is the simple step to mount network drive for your CENTOS box using NFS


Server IP : 172.31.0.1
Client IP : 172.31.0.2

On the Server
1. Create backup folder

mkdir /backup


2. Edit /etc/exports
vi /etc/exports

add this line
/home/sharing 172.31.0.2/255.255.255.255(rw,sync)


3. Edit /etc/hosts.allow
vi /etc/hosts.allow

add this line
portmap: 172.31.0.0/255.255.255.0


4. Restart NFS and portmap
/etc/init.d/nfs restart
/etc/init.d/portmap restart


On the Client
1. Start portmap
/etc/init.d/portmap start[quote]


2. Edit /etc/fstab and add this line
vi /etc/fstab
172.31.0.1:/backup /mnt/backup nfs rw,hard,intr 0 0


3. mount the nfs
mount 172.31.0.1:/backup /mnt/backup


If you r using CSF as firewall make sure add your server ip address on /etc/csf/csf.allow.

That's all.


Comments
* Name


* Email Address (will not be published)


Site



*Image Validation (?)

Comments

HTML: NO


:: Shout Me ::



:: About Me ::



They call me : Yachiru
Name : Yachiru Kusajishi
Birthday : February 12
Working Field : Shinigami lieutenant - 11th Division
E-mail : matnet80 [at] yahoo [dot] com


:: Calendar ::

February 2012
S M T W T F S
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29