August 27, 2010
NFS on centos
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.

