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.

Table of Contents


  1. Introduction
  2. Tools
  3. Steps
  4. Housekeeping
  5. Related Articles

Introduction


Back to Top

While this article and all examples are 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). It won’t be covered at any point due to its limits in throughput compared to the rest.
  • 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 fasted, 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.


Tools


Back to Top

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, this is built in natively into your Terminal application. For Windows users, download an SSH client such as PuTTy.
  • About 15 minutes of time.

Steps


Back to Top

1. SSH in to the NVR. For Linux and Mac users using Terminal. For Windows users using PuTTy.  The default credentials are Username: root  Password: ubnt

2. Execute:

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

3. Make a mount point for the NFS storage

mkdir /mnt/videos

4. Mount the NFS share

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

5. Change the ownership of that newly created mount point and its subdirectories

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

chmod -R 744 /mnt/videos

  • Optionally but recommended, log in as UniFi Video to make sure files can be written to that share
su unifi-video
touch /mnt/videos/test.txt
rm -rf /mnt/videos/test.txt
  • If errors are received, do not set the recording path to this directory until errors are resolved get the errors 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] /mnt/videos
chown unifi-video:unifi-video /mnt/videos

7. Reboot the NVR

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

mount

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

10. Change the Recording Path to

/mnt/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

If you used the internal hard drive of the NVR for recording, it's important that you're aware of the following information:

  • 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.

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. Therefore, there need be ample storage on the internal drive at all times.


Related Articles


Back to Top

 

Powered by Zendesk