Solving some NFS issues on Hikvision cameras

electric

n3wb
Joined
May 17, 2015
Messages
13
Reaction score
0
This is very disappointing.

I have a DS-2CD2132F-IS running V5.2.0 build 140721. I have a 1 TB drive in my NAS (unRAID) that I have tried sharing with NFS, but I get the same reversion to "uninitialized" that is described in this thread. When I try SMB/CIFS, I can successfully connect to the share ("test successful"), but I am unable to format the share - it immediately goes to "complete" then resets to "uninitialized."

I am quite frustrated, and right now my view is that the cameras I bought for $1000 are not really fit for purpose. In the data sheets, all these cameras claim to support NAS.
 

bubba123

Young grasshopper
Joined
Feb 5, 2015
Messages
47
Reaction score
13
Buy a RPi if your unraid doesn't support quotas. Then setup different users for each camera and share out via smb. I'm doing something similar but have separate 75GB partitions for each camera on a USB drive connected to my RPi
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,929
Reaction score
6,777
Location
Scotland
An odd limit indeed.
Yes, user quotas of under 200GB work OK. 250GB doesn't, so the boundary is somewhere in between. And if you can do flexible volumes of specific size that works OK too. It's not free space that's the limit, its total size allowed.
 

badbob

n3wb
Joined
May 18, 2015
Messages
2
Reaction score
0
Location
Russia
This solution works fine for my V5.1.0 build 131202 (DS-2CD2132-I)
Thank you very much for this post.
 

LittleBrother

Pulling my weight
Joined
Sep 16, 2014
Messages
480
Reaction score
119
The firmware is pretty sloppy and when I got my SMB/CIFS shares working last year it was more or less dumb luck that I happened to only have 200 GB free to do it with. I currently have a few cams, each with their own dedicated SMB/CIFS 200 GB partition--or more accurately, one camera has a 200 GB partition off of a main 1 TB drive, and the other two each connect to 200 GB USB drives I had spare, so each one is just taped to the PC.
 

electric

n3wb
Joined
May 17, 2015
Messages
13
Reaction score
0
Buy a RPi if your unraid doesn't support quotas. Then setup different users for each camera and share out via smb. I'm doing something similar but have separate 75GB partitions for each camera on a USB drive connected to my RPi
Do you mean that I can use a Raspberry Pi as a kind of intermediary device to create the quotas on my unRAID box?

I am kind of attached to the unRAID box, it is a 24 drive unit and I have it set up to back up the really critical stuff offsite. I'd like to use it if possible. Inexplicably and sadly, it does not seem to support quotas.
 

artembond

n3wb
Joined
May 18, 2015
Messages
2
Reaction score
0
Hello I'm try to setup recording to my NAS (linux)
It's a known troubles: camera lost nas after reboot.
My setup:
camera DS-2CD2032-I
V5.2.5 build 141201, Encoding Version V5.0 build 140714
Pv4 Address 10.42.0.21
.

Linux eth2:1 inet addr:10.42.0.1
------------------------------
Configs:
/etc/exports:
/mnt/sdb1/ipcam001 10.42.0.21(rw,fsid=1,root_squash,no_subtree_check,anonuid=1002,anongid=1002)

/etc/passwd:
ipcam001:x:1002:1002::/home/ipcam1:

Code:
sudo quota -u ipcam001 -s
Disk quotas for user ipcam001 (uid 1002): 
     Filesystem   space   quota   limit   grace   files   quota   limit   grace
      /dev/sdb1 100000K* 100000K 100000K             326   10000   10000
ls -l /mnt/sdb1 | grep ipcam
drwxrwxrwx 9 ipcam001 ipcam1 4096 тра 18 18:42 ipcam001

-----------------------------
On ipcam:
Advanced Configuraton > Storage > NAS
server Adress 10.42.0.1
File Path : /mnt/sdb1/ipcam001

button TEST is ok. Format - OK. But after reset or even some time camera lost the NAS.
Free Space 0.00GB and Status Uninitialazed.

Any ideas?
 

id5

Young grasshopper
Joined
Nov 23, 2014
Messages
31
Reaction score
4
NAS is most likely to be reporting the full free space to the camera that it has available and not the amount remaining of the users quota. To check telnet into the camera and after the Test completes okay do a 'df' to check the reported free space. I have the same problem with the latest QNAP firmware but the previous version works fine.
 

artembond

n3wb
Joined
May 18, 2015
Messages
2
Reaction score
0
NAS is most likely to be reporting the full free space to the camera that it has available and not the amount remaining of the users quota. To check telnet into the camera and after the Test completes okay do a 'df' to check the reported free space. I have the same problem with the latest QNAP firmware but the previous version works fine.
Code:
# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    7.9M      6.5M      1.4M  83% /
/dev/root                 7.9M      6.5M      1.4M  83% /
udev                     46.6M     80.0K     46.5M   0% /dev
/dev/ubi1_0              19.8M     10.2M      8.6M  54% /dav
/dev/ubi3_0               1.3M    108.0K      1.1M   9% /davinci
/dev/ubi4_0               1.3M     76.0K      1.1M   6% /config
10.42.0.1:/mnt/sdb1/ipcam001
                        917.1G    326.8G    543.7G  38% /mnt/nfs00
Ok. same problem. Can I fix it?
 

id5

Young grasshopper
Joined
Nov 23, 2014
Messages
31
Reaction score
4
Size of 917.1G is the culprit, You will need to fix it on your NAS so it reports the quota, perhaps a different firmware or patch, or perhaps can you carve up a smaller device and export that.
 

TD22057

n3wb
Joined
Mar 14, 2015
Messages
26
Reaction score
1
Mine works fine running Ubuntu 14.04. Here's what I did:

Setup directories, user account, and quota. I used 30 GB which needs to be converted to blocks to enter in the edquota command: python -c "print 30*1024**2"

Code:
adduser seccam01
mkdir /media/disk2/cams
mkdir /media/disk2/cams/cam01
chown -R seccam01:seccam01 /media/disk2/cams/cam01
edquota seccam01
My quota config looks like this:

Code:
sudo quota -u seccam01 -s
Disk quotas for user seccam01 (uid 1003):
     Filesystem   space   quota   limit   grace   files   quota   limit   grace
      /dev/sdc1  29397M      0K  30720M             143       0       0
Set up the share by editing /etc/samba/smb.conf

Code:
[Camera01]
        guest ok = no
        create mask = 0755
        comment = Security Camera 01
        browsable = yes
        path = /media/disk2/cams/cam01
        write list = seccam01
        create mask = 0755
Then I set everything up in the camera and it worked fine.
 

badbob

n3wb
Joined
May 18, 2015
Messages
2
Reaction score
0
Location
Russia
Hi, everyone.
Here is the patch for 5.2.5.

DCC09DE54900001A0B005CE14700001A - original
DCC09DE5000000000B005CE100000000 - patched

Pay attention on packing davinci back to davinci.tar.gz. This is not a gzip! This is LZMA! You can check it in /dav/initrun.sh. There is an instruction tar -axf, where -a key means lzma.
So, the right way to pack davinci.tar.gz is:

Code:
[COLOR=#000000][FONT=Tahoma]# tar -cf davinci.tar davinci[/FONT][/COLOR]
[COLOR=#000000][FONT=Tahoma]# lzma davinci.tar[/FONT][/COLOR]
[COLOR=#000000][FONT=Tahoma]# mv davinci.tar.lzma davinci.tar.gz[/FONT][/COLOR]
UPD: By default shedule has type other on each day and hour. Set this into "Continious" and it'll be allright.

Here is the link for 5.2.5 patched davinci.tar.gz with NFS patch.
If you can read russian, more info you can find here.
 
Last edited by a moderator:

ichi

n3wb
Joined
May 26, 2015
Messages
4
Reaction score
0
Been trying to get the NAS recording to work for over a week now. The Quota work around seemed most promising but I'm using Mac server as my NAS and it is presenting the entire disk to the NFS client even with quotas set. So I have decided to bite the bullet change the firmware and now that there is a patch for 5.2.5 I don't feel like I am down grading. The problem is, regardless if I change to 5.2.5 or downgrade to 5.1.6 the System -> Maintenance -> Remote Upgrade process always results in "Upgrade failed". I am following the instructions in the DS-2CD2032-I Users manual but it is always the same result. Note I am assuming that the .dav file is the upgrade file and not the .zip file. I am currently running a ~1 week old purchased DS-2CD2032-I at firmware revision: V5.2.0 build 140721, Encoding Version: V5.0 build 140714 and all I want is to get the recording to work. I already appreciate all the useful posts on this thread and any additional pointers to get there would be even more appreciated.
 

speed111

n3wb
Joined
Jun 3, 2015
Messages
6
Reaction score
0
Hi, everyone.
Here is the patch for 5.2.5.

DCC09DE54900001A0B005CE14700001A - original
DCC09DE5000000000B005CE100000000 - patched

Pay attention on packing davinci back to davinci.tar.gz. This is not a gzip! This is LZMA! You can check it in /dav/initrun.sh. There is an instruction tar -axf, where -a key means lzma.
So, the right way to pack davinci.tar.gz is:

Code:
[COLOR=#000000][FONT=Tahoma]# tar -cf davinci.tar davinci[/FONT][/COLOR]
[COLOR=#000000][FONT=Tahoma]# lzma davinci.tar[/FONT][/COLOR]
[COLOR=#000000][FONT=Tahoma]# mv davinci.tar.lzma davinci.tar.gz[/FONT][/COLOR]
UPD: By default shedule has type other on each day and hour. Set this into "Continious" and it'll be allright.

Here is the link for 5.2.5 patched davinci.tar.gz with NFS patch.
If you can read russian, more info you can find here.
Hello, can you provide a link or explain the process of using this file? I am on a 5.25 firmware, did the process explained here: and now in English interface.
I moved your davinci file in /dav folder of my camera, rebooted, but still, my NAS (windows shared disk remains Uninitialized after formatting, I don't see any progress during formating, just the "complete" indication that flashes for less than a second.
 

speed111

n3wb
Joined
Jun 3, 2015
Messages
6
Reaction score
0
Is there a way to have the camera automatically "reconnect" to the NAS if for some reason my storage machine reboots? I am using NFS and is working fine, but after every reboot of the storage, it appears "Uninitialized" untill I manually reboot the camera

EDIT: probably my fault, something was not mounted properly after the reboot
 
Last edited by a moderator:

jimmyt

Getting the hang of it
Joined
Sep 12, 2014
Messages
101
Reaction score
4
mine has never had a problem.. in fact rebooted the nas a few times over the past few days and the camera has no trouble getting going again
 

LittleBrother

Pulling my weight
Joined
Sep 16, 2014
Messages
480
Reaction score
119
Is there a way to have the camera automatically "reconnect" to the NAS if for some reason my storage machine reboots? I am using NFS and is working fine, but after every reboot of the storage, it appears "Uninitialized" untill I manually reboot the camera
I haven't had this problem and I specifically tested for its occurrence. If my main PC, which is housing CIFS/SMB 200 GB shares, one dedicated per camera, reboots then the camera will send me an email saying that it has lots its HD, but as soon as the PC comes back up it is able to jump right back in on those shares. This is with firmware 5.2.0.
 

speed111

n3wb
Joined
Jun 3, 2015
Messages
6
Reaction score
0
Thanks for your quick replies, I edited my post, seems it was a misconfiguration on my fstab/losetup script!
 

jordanb

Young grasshopper
Joined
Feb 11, 2015
Messages
96
Reaction score
2
Location
Scotland
Through my work in the next week or so I have a job to add a camera to a synology NAS running surveillance station. The system has a hik 2032 running at present, and the customer is sorting out an additional license. The plan is for me to add another 2032 camera to the system, though having never worked with that type of system before, and reading about 200GB or so storage limits for the cameras, I would like to go as clued up as possible. Should it just be a case of copying the same settings from the original camera to the new one, or would I need to create a new folder or partition for the new camera? or does the programme handle all the storage and I dont need to set up much?
Im not sure of the exact model of NAS or version of surveillance station.

thanks in advance :)
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,929
Reaction score
6,777
Location
Scotland
If you are adding the new camera to Synology Surveillance Station (which I guess you will be as you mentioned adding another licence) you don't need to worry about the volume size limitation - that's only relevant if the camera is recording 'direct to disc'. SS handles it's own storage.
Synology SS just connects to the camera's video stream as specified in the SS camera configuration and does what you specify - eg motion detection recording, continuous recording etc.

But - if the cameras were using the Storage menu 'NAS' destionation, ie direct to disc, then you need a separate share per camera.
 
Top