How to get hikivision cameras to record using NFS and quotas.

ak_camguy

n3wb
Joined
May 15, 2015
Messages
7
Reaction score
0
I have a NAS with the bullet hikivision cameras running EXT4 file system and user quotas. I have created a user for each camera and set each user with a 250gb quota.

I am running NFS with all folders/NFS shares residing on the same RAID array.

Each NFS share uses a seperate username so they apply the quota.

Is there anything else I am missing?

In the Camera Settings under Storage>NAS it does not allow me to set a username/password for NFS only for CIFS/SMB.

If i login to the camera, 192.168.1.101 using telnet and show mounts this is what I get for the camera NFS.

192.168.1.20:/raid0/data/_NAS_NFS_Exports_/CCTV_DOOR on /mnt/nfs00 type nfs (rw,sync,relatime,vers=3,rsize=4096,wsize=4096,namlen=255,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,soft,noac,nolock,proto=tcp,port=65535,timeo=70,retrans=3,sec=sys,local_lock=all,addr=192.168.1.20)

My experience with NFS has been you always set the permissions on the NFS share using system permissions/accounts....

So I assume I would change who has access to the share on the NFS server/NAS and the camera should just take affect using that username?
 
Last edited by a moderator:

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,979
Reaction score
6,802
Location
Scotland
I'm using both NFS and SMB/CIFS on my QNAP NAS as destinations for camera and NVR data.
By default the NFS share on my NAS does not demand a username/password, access has been controlled by host IP address. And the volume size of the share can be set arbitrarily, so I don't have to rely on user quotas.
Does your NAS support SMB/CIFS? Maybe that would be the simplest way to apply the needed user quotas.
 

ak_camguy

n3wb
Joined
May 15, 2015
Messages
7
Reaction score
0
I can enable Samba or NFS on my particular NAS. My issue is when I create a drive or RAID array even if I share a folder out using NFS the camera sees the whole drive. Which in turn only allows me to record using the first camera that attached to the NAS.

So basically I need a way to either A) create multiple partitions B) create folders with user quotas so the camera only sees that disk space
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,979
Reaction score
6,802
Location
Scotland
B) create folders with user quotas so the camera only sees that disk space
Yes, I believe that's what you'd have to do, each destination needs to be separate, the 'format' creates a framework of placeholder files.
But I think there are some additional complications. It's a feature that's seen some revisions and improvements with updated firmware, but I've not tracked the changes, others may have and may comment.
With SMB/CIFS in earlier firmware, say 5.2.3 it was necessary to connect to a share, a folder tree could not be specified. Cumbersome.
With later firmware, and I'm not exactly sure what version, the ceiling on the maximum size that could be handled was lifted, and the ability to use a folder path as target was implemented.
But a quick bit of experimentation will confirm what your cameras are capable of.
 

ak_camguy

n3wb
Joined
May 15, 2015
Messages
7
Reaction score
0
Thanks for trying to assist.

So I am running JBOD for disk type and have a huge array. 6TB.

I separate the NFS shares out by different folder names, however they are located on the same physical disk. I am trying to find someone that has done this successfully. If SMB is the way to go I will try and find a module for my NAS. I basically am just looking on how to get by the cameras programming as wanting to see the whole disk size without creating separate partitions as my NAS does not allow me that capability.

Ok, got CIFS/SMB running....



I am running 5.1 firmware on all cameras.
 

Attachments

Last edited by a moderator:

ak_camguy

n3wb
Joined
May 15, 2015
Messages
7
Reaction score
0
Here is what I get when I try and use CIFS.



This is not actually true, as the directory does exist.

 

ak_camguy

n3wb
Joined
May 15, 2015
Messages
7
Reaction score
0
Ok, managed to get CIFS to work.

Had to put a "/" in front of the file path. However, its still seeing the overall size of the disk even when enabling quotas.... Hmm...
 

ak_camguy

n3wb
Joined
May 15, 2015
Messages
7
Reaction score
0
Since no one else has replied I will let you know my educated guess how to make this work. You will need a NAS that supports folder quotas, not user quotas. I do not have a nas device that does this currently so I can't confirm 100 percent, but I am going to make a home made nas here shortly using ZFS as the file system and report back after I have set folder quotas.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,979
Reaction score
6,802
Location
Scotland
There was what I thought was a creative alternate way to do this posted by someone recently - but I can't find it in the search.
The method was to create an empty file of defined size, say 200GB. This can be done with dd, or another NAS-specific Linux utility, but I forget what. It may come back to me later.
Anyway - having creating an empty file of the required size, the next step was to mount it and offer it as a share.
 
Top