Instructions for Mounting a Storage Server on Another VPS
- On the Storage Server:
1.1. Install NFS Packages:
yum install nfs-utils nfs-utils-lib
1.2. Edit Configuration:
Open the NFS configuration file:
nano /etc/sysconfig/nfs
Uncomment and modify the following lines:
MOUNTD_NFS_V3="yes"
RPCNFSDARGS="-N 4"
NFSD_MODULE="noload"
1.3. Start NFS Services:
Enable and start the necessary services:
chkconfig nfs on
service rpcbind start
service nfs start
1.4. Configure Exported Directories:
Edit the exports file:
nano /etc/exports
Add the directory you want to export (replace VPS_IP with the actual IP address of the VPS):
/home VPS_IP(rw,sync,no_root_squash,no_subtree_check)
Apply the export settings:
exportfs -a
- On the VPS:
2.1. Install NFS Packages:
yum install nfs-utils nfs-utils-lib
2.2. Create a Mount Point:
mkdir -p /mnt/nfs/home
2.3. Mount the Storage Server:
Replace STORAGE_SERVER_IP with the IP address of the storage server:
mount STORAGE_SERVER_IP:/home /mnt/nfs/home -o nolock
Verify the Mount:
Check the mounted filesystems:
df -h
You should see output similar to:
plaintext
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
To Unmount:
umount /mnt/nfs/home