Skip to main content
All CollectionsVPS Hosting
[CentOS] Mounting storage VPS with NFS
[CentOS] Mounting storage VPS with NFS
Ieva avatar
Written by Ieva
Updated over 3 years ago

Please follow the 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 the 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 a 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 the command:

umount /mnt/nfs/home
Did this answer your question?