UniFi Video - How to Add a Network File Share to the NVR Appliance


Overview


Users will learn how to mount an NFS share to the airVision-C/UVC-NVR, as well as other Linux servers.

ADVANCED: External storage is for advanced users only and requires systems' administration experience. This is not in our support scope and our agents will not be able to assist you.

Table of Contents


  1. Introduction
  2. Steps: How to Add a NFS to the NVR
  3. Housekeeping
  4. Related Articles

Introduction


Back to Top

While this article is based on the NVR appliance, these same steps can be applied to any Linux installation. There are 4 main types of external storage you can use:

  • Samba (Windows File Sharing)
  • NFS (Network File Sharing)
  • iSCSI (Internet Small Computer System Interface)
  • USB 3.0

Samba, NFS, and iSCSI are predominantly NAS based storage protocols whereas USB 3.0 would be used for a dedicated, individual storage unit. If ordered by speed: NFS is the fastest, then iSCSI, then USB 3.0, then Samba (protocol version dependent). However, depending on network and storage, these speeds may vary. See Related Articles below for information about alternative extra storage options.

NOTES & REQUIREMENTS: To complete this process, the following are needed:
  • UVC-NVR or airVision-C powered up and plugged into the network. In the rest of this article, this will simply be referred to as "NVR".
  • The IP address of the NVR.
  • The configured NFS share, this should also have a filesystem already set up on it, so no data loss will occur.
  • An SSH client. For Linux and Mac users, you may use the natively-built Terminal. For Windows users, download an SSH client such as PuTTy.

Steps: How to Add a NFS to the NVR


Back to Top

1. SSH in to the NVR (Need help with SSH? See this article). The default credentials will be either root/ubnt or ubnt/ubnt.

2. Type the following and hit enter:

apt-get update && apt-get upgrade -y && apt-get install nfs-common && apt-get clean

3. Make a mount point for the NFS storage by issuing this command:

mkdir /videos

4. Mount the NFS share with the following:

mount [NAS IP address]:[/pre/configured/path/in/nfs/server] /videos

5. Change the ownership of that newly created mount point and its subdirectories by issuing these commands:

chown -R unifi-video:unifi-video /videos

chmod -R 744 /videos

 It is recommended to log in as UniFi Video to make sure files can be written to that share

su unifi-video
touch /videos/test.txt
rm -rf /videos/test.txt

If errors are received, do not set the recording path to this directory until errors are resolved.

6. Set the NFS share to mount at boot. This is the only step that will vary between the airVision-C/UVC-NVR.

  • If a Linux install is being used that is not the airVision-C/UVC-NVR, then use /etc/fstab (please lookup the proper parameters to put in to fstab).
  • If using the airVision-C/UVC-NVR:
apt-get install nano
Nano /etc/rc.local

Insert the following lines before the ‘exit 0 line’

mount [NAS IP address]:[/pre/configured/path/in/nfs/server] /videos
chown unifi-video:unifi-video /videos

7. Reboot the NVR. You can do so via the power button, running `reboot` via ssh, or rebooting it via the management page at the top right of the NVR main page.

8. When it comes back up, check the following, to ensure that the NFS share mounted:

mount

  • You will see a line near the bottom that explicitly states your mount path. In our case, it will be "/videos." 

9. If the share mounted, go to Settings > NVR Settings > Configure tab

10. Change the Recording Path to

/videos

11. Click Save

It will take a minute or two for the Disk Utilization bar to update with the new space used. Also, be sure to adjust the Space to Keep Free setting. It is recommended for this setting to be 5% or more of the overall storage size.


Housekeeping


Back to Top

1. If you used the internal hard drive of the NVR for recording, it's important to know:

  • Space to keep free (storage based purging): This applies to the current storage location only and cannot be disabled. It will purge the oldest recordings to keep xGB (default of 10GB) free on the storage partition specified at all times. Note that if you're using an external drive or storage larger than 500GB total, you should set this to 5% of the overall storage of the drive (overall storage of the drive * 0.05). Each filesystem has a specified "reserved file space" that is supposed to be kept empty so the filesystem can use this space for deleting, copying, moving, etc.
  • Time-Based Purging: This applies to all recordings regardless of their storage location and can be disabled/enabled (disabled by default). It will purge any recordings older than the time you specify.

2. If you used the internal hard drive for recording and have now switched to external storage, it is strongly recommended to use Time-Based Purging temporarily so the recordings that remain on the internal drive are properly purged. Although you have moved the location of the recordings using this article to external storage, the database still uses the internal storage.


Related Articles


Back to Top

UniFi Video - How to Add a Network Volume to the NVR Appliance?

UniFi Video - How to Add an External Hard Drive to the NVR Appliance


We're sorry to hear that!