ANS Documentation

Improve This Doc
  • Cloud
  • Desktop and Office Solutions
  • Domains and DNS management
  • Backup and High Availability
  • eCommerce Stacks
  • Security
  • Email
  • Monitoring and usage management
  • Networking
  • Operating systems
    • Linux
      • Basics
      • Apache
      • Control Panels
      • FTP
      • Magento
      • Miscellaneous
      • MySQL
      • NGINX
      • PHP
      • PHP-FPM
      • Setting up Websites
      • NFS
      • VPN
      • Percona
      • SSH
      • SSL
      • Git
      • Redis
      • Elasticsearch
      • MongoDB
      • Ncdu
    • VMware ESXi
    • Windows
  • Webcelerator
  • MyUKFast
  • Home >
  • Operating systems >
  • Linux >
  • NFS >
  • Network File System (NFS)

Network File System (NFS)¶

Install NFS on client server¶

You can install NFS on a RPM-based server with the following command:

yum install nfs-utils nfs-utils-lib

You can install NFS on an Ubuntu server with the following command:

apt install nfs-common

Distributed Files / Folders¶

It’s very important to only use NFS for files / folder which need to be distributed between multiple servers. We strongly advise against having the entire document root of your website on NFS.

Direct Mount Point¶

You can directly mount NFS to the folder within your document root:

NFSSERVER/nfsshare/media -> /var/www/vhosts/domain.com/htdocs/media

You can do this with the following entry in /etc/fstab:

cat /etc/fstab | grep -i nfs
NFSSERVER:/nfsshare/media /var/www/vhosts/domain.com/htdocs/media nfs rw,noatime,nodiratime,async,timeo=1800 0 0
mount /var/www/vhosts/domain.com/htdocs/media

Symbolic Links¶

You can use Symbolic Links (symlinks) to link files / folders from your document root to the NFS mount point.

ln -s /var/www/vhosts/domain.com/htdocs/media /nfsshare/media

Open File Check¶

You can see all the NFS open files with the following command:

lsof -N

Write Speed Test¶

Using the dd command you can write a file to the local file system and then to the NFS mount point to then compare the speed results. The write speeds over NFS should always be slower

Local File System¶

dd if=/dev/zero of=/root/testfile bs=1G count=1 oflag=direct
1073741824 bytes (1.1 GB) copied, 1.12829 s, 952 MB/s
rm -f /root/testfile

NFS Mount Point¶

This write speed test creates the file /nfsshare/testfile with NFS being mounted to /nfsshare/

dd if=/dev/zero of=/nfsshare/testfile bs=1G count=1 oflag=direct
1073741824 bytes (1.1 GB) copied, 1.82611 s, 588 MB/s
rm -f /nfsshare/testfile

Next Article > VPN

  • Useful Links
  • SMB
  • Enterprise
  • Channel
  • Public Sector
  • ANS Data Centres
  • About ANS
  • Careers
  • Blog
  • Get in touch
  •  
  • Sales 0800 458 4545
  • Support 0800 230 0032
  • Get in touch

© ANS Group Limited | Terms and Conditions | Corporate Guidance | Sitemap
ANS Group Limited, registered in England and Wales, company registration number 03176761, registered office 1 Archway, Birley Fields, Manchester M15 5QJ