Solving some NFS issues on Hikvision cameras

I have a DS-2CD3145F-I with v5.3.8 firmware and I mounted a CIFS share on my synology with a user quota of 500GB. I do it the same way as with all my other hikvisions which are running v 5.2.5.
The 2CD3145F keeps reporting 10152GB as capacity where the others just report the assigned quota. Is this a bug in 5.3.8?
 
I have a DS-2CD3145F-I with v5.3.8 firmware and I mounted a CIFS share on my synology with a user quota of 500GB. I do it the same way as with all my other hikvisions which are running v 5.2.5.
The 2CD3145F keeps reporting 10152GB as capacity where the others just report the assigned quota. Is this a bug in 5.3.8?

I had the exact same issue with DS-2CD3345-I on v5.3.8 and v5.3.6. CIFS mount shows the size of the filesystem instead of usable size set by quota (linux quota). Windows client can report the usable size correctly. And the firmware does not support large shares (it can mount them, format, but stays uninitialized). I had to create 199GB filesystems. The firmware is so buggy. The camera does not support current version of samba and NFS
 
After trial and error based on the other posts in this thread, I'm posting my working setup in case it helps people:
5x IP cams (4x DS-2CD2342WD-I firmware 5.3.6 and 1x DS-2CD2D14WD/M firmware 5.3.0)
Windows 10 PC hosting mirrored 6TB drives

I created a partition for each camera and an empty folder in the root folder on each partition and shared that folder. The cameras don't like a non-empty folder to format and the root folder had hidden folders in it -- formatting only worked on the empty folder. Each of these partitions were shared with the same user. No quotas configured since I'm giving each camera a partition and it can use the whole partition.

Also I had old credentials that I had to delete by hitting the "X" button and the clicking on the save button in the web interface. (This tripped me up for a while because it didn't seem to take the new credentials until I did this).
 
So, I have an issue with NFS on my cameras, I doubt this is anything I can fix, I may just have to swap to smb, but I figured I would ask first.

12 2042's and 1 2632 recording on motion via NFS to a CentOS 7 Linux box running 6x6TB drives w/ a PERC H700. Each camera has its own 1TB Virtual Disk carved out on the PERC, which is mounted under /data (e.g. /data/CAMERA1 /data/CAMERA2) and exported vis NFS. This all works well (for the post part).

my exports file

/data/CAMERA1 *(rw,sync,no_root_squash)
...
/data/CAMERAn *(rw,sync,no_root_squash)

The problem I have is: if for some reason the CentOS box reboots (which happens with some regularity as I live in the boonies and we occasionally have power outages, even with a UPS on the server, the battery backup will only last 15-20 minutes before shutting down), all of the cameras stop recording. The status will show as "Offline". They will not automatically reconnect when the server comes back online. They will stay offline, literally, for days. And, if the power failure happens overnight while sleeping, I may not even realize it until a few days later. The only way the cameras will start recording again is if I physically log in to each camera and reboot the camera for it to reestablish the nfs connection. this is becoming a full-time job :)

Is there a different way to configure the NFS exports so the cameras will reconnect? or
Is there a way to reboot the camera remotely, so I can set up a task when the NAS server boots to automatically go out and reboot the camera?
 
The camera does automatically reconnect with cifs/samba.

Or you can probably use something less power hungry for live recording (Intel NUC?) and then move the files to a nearline storage? Or maybe invest in a generator?
 
Already have an MEP-003, but I only use it for prolonged outages :)

I was hoping there was a command I could send thru a web browser (e.g. http://admin:password@mycamera/some/url?cmd=reboot) which I would then be able to automate on startup with lynx..... but, if I have to convert to SMB, I suppose I could, although I think its slower than NFS.

edit update:

updated all my cameras to use smb, reformatted all the shares. Test reboot, only 50% of the cameras reconnected, the others reported "error" or "offline" and required a reboot to connect to the samba server again. :(

Another update:

After much research, I was able to determine I could reboot the cameras remotely using the ISAPI interface. So, I set up a script in /etc/rc.d/rc.local to reboot all my cameras automatically when the NVR powers up:

curl -X PUT http://user : password@ipaddress : port/ISAPI/System/reboot
...
one line for each camera (remove spaces before and after :, had to put them in otherwise the forum converted my :'s into :p's)
...

This will ensure each of my cameras reboots and reconnects to the SMB share when the NVR reboots, regardless of how long the NVR may have been offline.
 
Last edited by a moderator:
I've also problems with an original DS-2CD2342WD-I.

Running the latest firmware: V5.4.1 build 160525

I'm running a Ubuntu Xenial VM with NFS functionality.

I tweaked the previous post in this topic for adding a loop device to use ext4.

PHP:
fallocate -l 256G dome01.img
mkfs -t ext4 dome01.img
file dome01.img
vi /etc/fstab
/mnt/dome/dome01.img    /mnt/dome/dome01        ext4    defaults        0       0
vi /etc/exports
/mnt/dome/dome01 192.168.1.21(rw,sync,no_root_squash,no_subtree_check)
reboot

Then reboot the camera. It sees the 256Gb export and I can format it and stays in normal mode.

Now is the only question what the file limit (read disk size) in the firmware is because the recording disk is a 1.2Tb.
 
Last edited:
  • Like
Reactions: alastairstevenson
I had the "NFS share always returns to unformatted" problem, using firmware 5.3.0 build 151016 on Hikvision DS-2CD2132F-IS. I didn't want to change the firmware, but I was able to work around the problem by creating a separate partition on the server's disk, with just one directory that I used for the camera. After doing that, it works.
 
Hey Folks,

New to the forum, but also was stuck for days o_O on how to setup the SMB/CIFS to connect to the Synology NAS.

CAM: DS-2CD2142FWD-IWS
Firmware: V5.3.8 build 151224

My first problem was I couldn't get the camera to successfully "Test" the connection when using "SMB/CIFS" even though I could test successfully using "NFS" with File Path "/Volume1/Rear1".

I finally was able to get a successful "test" when I corrected my "File Path". Due to the fact that I didn't remove "/Volume1" from "/Volume1/Rear1". When Using SMB/CIFS, Please only list the File Folder name "/Rear1" Hope this helps. to get those that were stuck to "Test" successfully.

I'm using SMB/CIFS, because it allows me to assign specific amounts of drive space for the camera recording. After the above, I was able to see the capacity I assigned in Quota and "Format" successfully. :cool:

The below is a step-by-step with pictures from HIKVISION on how to setup either NFS or SMB/CIFS for Synology. :)

http://overseas.hikvision.com/ueditor/net/upload/2015-06-10/ae9f2fc6-bed2-41f2-81fb-4bfea3d0e0a2.pdf

Now my issue is how to get the cameras to record directly to the NAS??
 
After trial and error based on the other posts in this thread, I'm posting my working setup in case it helps people:
5x IP cams (4x DS-2CD2342WD-I firmware 5.3.6 and 1x DS-2CD2D14WD/M firmware 5.3.0)
Windows 10 PC hosting mirrored 6TB drives

I created a partition for each camera and an empty folder in the root folder on each partition and shared that folder. The cameras don't like a non-empty folder to format and the root folder had hidden folders in it -- formatting only worked on the empty folder. Each of these partitions were shared with the same user. No quotas configured since I'm giving each camera a partition and it can use the whole partition.

Also I had old credentials that I had to delete by hitting the "X" button and the clicking on the save button in the web interface. (This tripped me up for a while because it didn't seem to take the new credentials until I did this).


Thanks, this worked for me. I had been using a usb hard drive connected to my router for nas recording, but it was painfully slow. After creating partition on hard drive I couldn't initialize because I was sharing the root folder. I created an empty folder as you suggested and was able to format through http interface. I haven't tested it yet but I'm sure the performance will be much better. Ty for the post....
 
Hello everyone, I think I have a slightly different issue to those already overcome on this incredibly helpful forum but please point me in the right direction if I've missed a solution to my problem.

Setup
  1. Hikvision DS6704HFI video encoder. FW V1.2.5 build 150522, Encoding version 5.0 build 140409.
  2. Raspberry Pi 2 running OpenMediaVault with NFS share on USB flash drive with capacities of 32GB and 512GB (which I've left to one side until I can get the system working with 32GB as I know there are issues with large shares)
I can get OMV NFS share to show on the DS6704 HDD NAS page and the NFS is allowing a connection from the DS6704 as the log shows it allowing the mount: "May 23 15:52:40 raspberrypi rpc.mountd[22292]: authenticated mount request from 192.168.1.4:920 for /export/folder2 (/export)"

Here's the setting in the Hikvision configuration:
NASsettings.png
Which then leads to "a" share being detected (make a note of the size):
NASidentfied.png
So then to initialize I try formatting and once I've confirmed I want to format the drive, I get it to 6%:
NASformat6.png
And then this happens (it fails):
NASformatfail.png
So I SSH into the Pi to get a closer look at the drive mounts and directories and see the following, which gives me no idea which of the partitions is showing up as the share of size 3.16GB that the DS6407 sees above:NASdirs.png

Please could anyone help me get the NFS share recognised (and at least past 6% formatted) and able to record to it? I've been at this for days to no avail. What other configs would be useful to see in determining the problem/solution? What is the Hikvision seeing when it reports the share size is 3.16GB?

Thank you!
 
I'd speculate that you have created the NSF shares under / as opposed to under the path that /dev/sdb1 is mounted to.
Out of curiosity, what do you see with a
ls -al /
Is there a directory /export ? And if so, do you see the folder2/datadir0 etc that the decoder would have started to create?
Helpful hint : In PuTTY there is a handy 'copy all to clipboard' in the top left menu, that allows you to grab a text transcript. Which you can then quite neatly edit / use in the 'code' tags of the forum, found under the '+' in the menu bar. Easier all round than screen images of command line stuff.
 
After fiddling with this also, I have found that the camera refuses to "format" the share if:
- Size of the filesystem shared is less than 10GB or bigger than 250? GB (unsure of upper limit)
- There are some files or folders in the share (like a folder "lost+found" for instance)
- Rights for the folder where the filesystem is mounted are not correct
- NFS options are not correct in /etc/exports, i use "async,unsecure,all_squash, anonuid=1000,anongid=1000", i think the unsecure is needed. And use "async" at own risk...
After experimenting with this i'm now able to use a Raspberry Pi (2) with USB thumb drives for the cameras, shared via NFS. I have one 32GB drive, partitioned into two 16GB partitions and one 16GB drive. I use EXT4 filesystems and recommend using UUID of the filesystems in /etc/fstab for mounting the drives.
 
  • Like
Reactions: alastairstevenson
Hello everyone,

i have following issue,
i have some of hikvision cams, for example DS-2CD2032-I with fw 5.4.5, and its ran without any issues with my qnap TS253A Nas 4.3.4, connection via CMB/CIFS
But since one week, some of my cams have not taken any records, after some recheck, i could find out that some of them has lost connection to the nas.

Under storage managemant/ net hdd menu i could creat a new connection to the nas with successful test, but if i try to format hdd (hikvision menu), i get every time "device error"

anyone idea why i get this error.


i have allready tested with diverent size of storage (15, 150, 199, 250 GB) but without any results to make the hdd formated.
 
i have some of hikvision cams, for example DS-2CD2032-I with fw 5.4.5, and its ran without any issues with my qnap TS253A Nas 4.3.4, connection via CMB/CIFS
But since one week, some of my cams have not taken any records, after some recheck, i could find out that some of them has lost connection to the nas.
Did you update the firmware in the NAS?
Anything else changed that could cause the problem?
 
hikvision cams, for example DS-2CD2032-I with fw 5.4.5, and its ran without any issues with my qnap TS253A Nas 4.3.4

Why would you do it like so? Use the QNAP Surveillance Station! It records perfectly fine 4 of my cameras when they issue an alarm. I do not see why would I save directly from 4 or less cameras to QNAP if it comes with decent program doing the job for up to 4 cameras for free and I can watch and search all my cameras on two TVs via HDMI?

I do not know if anyhting changes with different fw versions of the cameras, but I have described in detail how things work perfectly well without formatting disks in the post Solving some NFS issues on Hikvision cameras. For me, nothing changed in last 2 years.

I have used that same method for saving to my current NAS which is QNAP TS-253A as I described for Asustor NAS.. On QNAP - Made a folder: /Kamere/Balkon (all my cameras are recorded in the folder /Kamere, each has its own subfolder and user), create the user Balkon with 30 gb quota, create the network share /23Balkon (pointing it to /Kamere/Balkon) and give rw rights to the user Balkon (and others as needed). Then on the camera (e.g. Web interface), point it to NAS IP address, folder /23Balkon (entering / and not \), SMB/CIFS, test, save, change to the previous tab, select your new disk (you may see entire disk capacty now but should see 30gb and Unformatted), format, you will now see 30 gb, and save. And that is it. If not, delete contents of /23Balkon and repeat the process.

I use this method only for cameras over my QNAP 4 free licence limit. I have been test saving to folders at USB3 disk connected to my giga router (but that should never be done in normal usage as it is quite likely this data will get lost).
 
Last edited:
I need to get video recording directly to the NAS on motion and it appears it does at random times and I can't figure out to make it consistently work.

I have a DS-2CD2542FWD and trying to get it to record on motion to my NAS Synology DS216. I followed the directions specified onhttp://overseas.hikvision.com/ueditor/net/upload/2015-06-10/ae9f2fc6-bed2-41f2-81fb-4bfea3d0e0a2.pdf. When the set up seemed complete, we tested with the Hikvision web browser under the HDD settings, it appears it automatically created a datadir0 through datadir34. Under each file was various empty video files. We didn't see any actual video being recorded.

Anytime I reboot the NAS it looks like new backupinfo01.bin and logcurlfile.bin are created in each of the datadir files. See attached screenshot.

In the screenshot you will see video files under the datadir0 for 2/16/18 and under the datadir1 for 2/17/18. I am using HIkvision's web browswer (See attached screenshot) to confirm the live view and the motion events are configured properly, but I don't see any new video files appearing in the NAS. I am expecting to see new video files as the motion is being detected....

Please help. What am I doing wrong?
 

Attachments

  • Screen Shot 2018-02-19 at 11.11.53 AM.png
    Screen Shot 2018-02-19 at 11.11.53 AM.png
    166.1 KB · Views: 30
  • Screen Shot 2018-02-19 at 11.16.10 AM.png
    Screen Shot 2018-02-19 at 11.16.10 AM.png
    165.1 KB · Views: 29
  • Screen Shot 2018-02-19 at 11.25.53 AM.png
    Screen Shot 2018-02-19 at 11.25.53 AM.png
    60.6 KB · Views: 31
When the set up seemed complete, we tested with the Hikvision web browser under the HDD settings, it appears it automatically created a datadir0 through datadir34. Under each file was various empty video files. We didn't see any actual video being recorded.
The Hikvision NetHDD configuration / 'format' creates a fixed set of placeholder folders and files, and some indexes to the content held within these files.
Even when video is being recorded, you will not see any additional or deleted .mp4 files, but the content within will have changed, as will the index that keeps track of what is where.
I am using HIkvision's web browswer (See attached screenshot) to confirm the live view and the motion events are configured properly,
Your screenshots do not show the storage schedule and event configurations for the camera.

Please help. What am I doing wrong?
Unless you use a 3rd-party tool to extract the video via the index files that track them - you need to use the camera's own 'mini NVR' facilities under the Playback menu.
Depending on whether you have configured the camera to do continuous or event-driven recording, you will see either a continuous blue line, or periodic red markers for motion / event recording.

I hope that makes sense.