Sun

[CentOS] Mounting storage VPS with NFS

[CentOS] Mounting storage VPS with NFS

Please follow instructions below in order to successfully mount Storage VPS on other VPS.

1. Actions on the Storage Server side

1.1. Install NFS packages:

yum install nfs-utils nfs-utils-lib

1.2. Edit configuration:

nano /etc/sysconfig/nfs

Uncomment and edit following lines:

MOUNTD_NFS_V3=”yes”
RPCNFSDARGS=”-N 4″
NFSD_MODULE=”noload”

1.3. Start services:

chkconfig nfs on
service rpcbind start
service nfs start

1.4. Now edit exported directories:

nano /etc/exports

For example we add /home directory (change VPS_IP):

/home          VPS_IP(rw,sync,no_root_squash,no_subtree_check)

And export these settings:

exportfs -a

2. Actions on the VPS side

2.1. Install packages:

yum install nfs-utils nfs-utils-lib

2.2. Create mount point:

mkdir -p /mnt/nfs/home

2.3. Mount (change STORAGE_SERVER_IP):

mount STORAGE_SERVER_IP:/home /mnt/nfs/home -o nolock

That’s it. Now check:

df -h

Results should be like this:

Filesystem          Size  Used Avail Use% Mounted on
/dev/simfs           40G  1.4G   39G   4% /
none                2.0G  4.0K  2.0G   1% /dev
none                512M     0  512M   0% /tmp
STORAGE_SERVER_IP:/home   40G  828M   40G   3% /mnt/nfs/home

In order to unmount execute command:

umount /mnt/nfs/home

Was this article helpful?

Related Articles