Hikvision NVR and FreeBSD NFS/NAS setup (with ZFS)

salival

n3wb
Joined
Oct 11, 2015
Messages
5
Reaction score
3
Hi guys,

Tonight I thought i'd finally work out how to correctly set up a NFS share on my FreeBSD server so I could use the NAS hdd function in the Hikvision interface. This isn't comprehensive guide but it worked for me.

This is done under FreeBSD 10.2, using ZFS as my main drive setup and whatever version of NFS comes with FreeBSD.

In your /etc/rc.conf, add these lines:

Code:
rpcbind_enable="YES"
nfs_server_enable="YES"
mountd_enable="YES"
mountd_flags="-r"
My ZFS pool is called storage, it doesn't really matter what it's called, though:
Code:
df -h /storage
Filesystem    Size    Used   Avail Capacity  Mounted on
storage       7.0T    5.9T    1.1T    84%    /storage
Create the cameras sub pool:
Code:
zfs create storage/cameras
If you want to change the zfs mount point for whatever reason, use:
Code:
zfs set mountpoint=/new/path/you/want storage/cameras
I stuck with /storage/cameras
Set the quota that you want that sub pool to have, I've used 400gb as an example:
Code:
zfs set quota=400G storage/cameras
Verify the quota worked if you like:
Code:
df -h /storage/cameras
Filesystem         Size    Used   Avail Capacity  Mounted on
storage/cameras    400G    154K    400G     0%    /storage/cameras
I have ZFS snapshot directorys turned on by default, you will NEED to turn these off or the initialization of the drive in the Hikvision GUI will fail. Use this command to turn it off:
Code:
zfs set snapdir=hidden storage/cameras
Now you need to edit /etc/exports which how NFS knows what you want to export to clients, I used this syntax in it, yours may vary:
Code:
/storage/cameras -network=192.168.1.0/24 -maproot=root
Issue these 2 commands to restart nfsd and mountd:
Code:
service nfsd restart
service mountd restart
Then go into your hikvision NVR (I guess this would work for the newer cameras, too) then goto: Storage\Storage Management \Net HDD
Server address would be the IP of your server, mine is 192.168.1.1 so I input that there.
File path is the mount point you chose when setting up the NFS share previously, mine is /storage/cameras
Type is NAS
Make sure to click Save

Then go back to HDD Management
The drive may take a minute or two to come online, You will need to initialize it, same as a physical hard drive.
Click the left check box by your NAS hdd you have just added and click on the drive then click format.

THE ZFS DIRECTORY MUST BE EMPTY OR IT WILL FAIL! (Device Error) This is why you hide the zfs snap dir.

This may not be the best way to do this but it works for me.
Cheers.
 

Srbo

n3wb
Joined
Nov 15, 2016
Messages
8
Reaction score
0
Is there a way to make the Hikvision NVR work with NFS Share on Ubuntu?
 

pgdh

n3wb
Joined
Aug 25, 2020
Messages
2
Reaction score
1
Location
York
Is there a way to make the Hikvision NVR work with NFS Share on Ubuntu?
Yes, it should be just the same from a ZFS perspective (though the NFS setup may be slightly different). You just need to make sure the ZFS filesystem's quota property is set, and that snapdir=hidden (which is the default on other ZFS plaforms such as SmartOS and OmniOS)
 

Trax95008

Getting the hang of it
Joined
Apr 22, 2016
Messages
303
Reaction score
52
Are you using the NAS drive as an extension of the NVR, or for “redundant” recording? Have you tried to play back footage on the NVR yet? I set up a NAS a while back, and set it to redundant so that I would have footage in the event the NVR was ever stolen. I found that the playback feature would respond extremely slow, and often crash! I eventually gave up on it
 
Top