[EMAIL="alastair@Mint64"]alastair@Mint64[/EMAIL] ~ $ dd if=/dev/urandom of=testfile bs=512 count=500k
512000+0 records in
512000+0 records out
262144000 bytes (262 MB) copied, 30.0246 s, 8.7 MB/s
[EMAIL="alastair@Mint64"]alastair@Mint64[/EMAIL] ~ $ ll testfile
-rw-rw-r-- 1 alastair alastair 262144000 Dec 13 12:48 testfile
[EMAIL="alastair@Mint64"]alastair@Mint64[/EMAIL] ~ $ mkfs -t ext2 testfile
mke2fs 1.42.9 (4-Feb-2014)
testfile is not a block special device.
Proceed anyway? (y,n) y
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
64000 inodes, 256000 blocks
12800 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
32 block groups
8192 blocks per group, 8192 fragments per group
2000 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185
Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
[EMAIL="alastair@Mint64"]alastair@Mint64[/EMAIL] ~ $ file testfile
testfile: Linux rev 1.0 ext2 filesystem data, UUID=d8cdd56e-c16a-4355-b56b-474ad2bc6805
[EMAIL="alastair@Mint64"]alastair@Mint64[/EMAIL] ~ $ mkdir testpoint
[EMAIL="alastair@Mint64"]alastair@Mint64[/EMAIL] ~ $ sudo mount -t ext2 testfile testpoint
[EMAIL="alastair@Mint64"]alastair@Mint64[/EMAIL] ~ $ mount
[snip]
nfsd on /proc/fs/nfsd type nfsd (rw)
/home/alastair/testfile on /home/alastair/testpoint type ext2 (rw)
[EMAIL="alastair@Mint64"]alastair@Mint64[/EMAIL] ~ $
[EMAIL="alastair@Mint64"]alastair@Mint64[/EMAIL] ~ $ cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/home/alastair/testpoint 192.168.1.0/24(rw,sync,no_root_squash,no_subtree_check)
[EMAIL="alastair@Mint64"]alastair@Mint64[/EMAIL] ~ $
[EMAIL="alastair@Mint64"]alastair@Mint64[/EMAIL] ~ $ sudo exportfs -v -a
exporting 192.168.1.0/24:/home/alastair/testpoint
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.
Here is a skeleton of a method that was first suggested by another member (sorry but I forget who, so I can't attribute) and will only be useful to those who are Linux or NAS savvy. Which may be quite a lot.
And it will only work on a NAS that has reasonably good embedded Linux, not on those low-end models with very a very limited implementation.
It's not a recipe to follow by rote - it's an indication of a method, to be understood and adapted for potentially many different environments.
But maybe others will chip in with some ideas or results or other experience.
Summary:
Create a large file, sized for the volume size limitation of the specific camera firmware. 200GB should work for most.
Format the file as a file system, say ext2
Mount the file at a suitable mount point, add an entry to fstab for permanence.
Share the mount point using the NFS protocol.
A worked example is as follows, with some extraneous stuff removed:
Create the file.
Code:alastair@Mint64 ~ $ dd if=/dev/urandom of=testfile bs=512 count=500k 512000+0 records in 512000+0 records out 262144000 bytes (262 MB) copied, 30.0246 s, 8.7 MB/s alastair@Mint64 ~ $ ll testfile -rw-rw-r-- 1 alastair alastair 262144000 Dec 13 12:48 testfile
Format as a file system:
Code:alastair@Mint64 ~ $ mkfs -t ext2 testfile mke2fs 1.42.9 (4-Feb-2014) testfile is not a block special device. Proceed anyway? (y,n) y Discarding device blocks: done Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) Stride=0 blocks, Stripe width=0 blocks 64000 inodes, 256000 blocks 12800 blocks (5.00%) reserved for the super user First data block=1 Maximum filesystem blocks=67371008 32 block groups 8192 blocks per group, 8192 fragments per group 2000 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729, 204801, 221185 Allocating group tables: done Writing inode tables: done Writing superblocks and filesystem accounting information: done alastair@Mint64 ~ $ file testfile testfile: Linux rev 1.0 ext2 filesystem data, UUID=d8cdd56e-c16a-4355-b56b-474ad2bc6805
Create the mount point and mount the file:
Code:alastair@Mint64 ~ $ mkdir testpoint alastair@Mint64 ~ $ sudo mount -t ext2 testfile testpoint alastair@Mint64 ~ $ mount [snip] nfsd on /proc/fs/nfsd type nfsd (rw) /home/alastair/testfile on /home/alastair/testpoint type ext2 (rw) alastair@Mint64 ~ $
The mount point needs to be added to the NFS /etc/exports list, using your favourite text editor, and exported.
Code:alastair@Mint64 ~ $ cat /etc/exports # /etc/exports: the access control list for filesystems which may be exported # to NFS clients. See exports(5). # # Example for NFSv2 and NFSv3: # /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check) # # Example for NFSv4: # /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check) # /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check) # /home/alastair/testpoint 192.168.1.0/24(rw,sync,no_root_squash,no_subtree_check) alastair@Mint64 ~ $ alastair@Mint64 ~ $ sudo exportfs -v -a exporting 192.168.1.0/24:/home/alastair/testpoint
At this point - the share should be available to a camera or NVR via NFS.
To make the mount permanent, to survive a reboot, the mount will need to be added to /etc/fstab
Check out the system logs of your NAS/Linux box for any clues as to why the mount attempt failed.but I can't seen to get the mounting to work properly still.
login as: root
[EMAIL="root@192.168.254.11's"]root@192.168.254.11's[/EMAIL] password:
BusyBox v1.19.3 (2014-07-11 11:25:54 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.
# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
ramfs on /home type ramfs (rw,relatime)
udev on /dev type tmpfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/ubi1_0 on /dav type ubifs (rw,relatime)
/dev/ubi3_0 on /davinci type ubifs (rw,relatime)
/dev/ubi4_0 on /config type ubifs (rw,relatime)
192.168.1.201:/cctv1 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.201)
192.168.1.96:/home/alastair/testpoint on /mnt/nfs01 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.96)
# ls -alR /mnt/nfs01
/mnt/nfs01:
drwxrwxrwx 3 65534 nogroup 4096 Feb 26 15:20 .
drwxrwxrwx 13 root root 1024 Feb 26 15:18 ..
drwxr-xr-x 2 root root 4096 Feb 26 15:19 datadir0
-rwxr-xr-x 1 root root 68 Feb 26 15:20 info.bin
/mnt/nfs01/datadir0:
drwxr-xr-x 2 root root 4096 Feb 26 15:19 .
drwxrwxrwx 3 65534 nogroup 4096 Feb 26 15:20 ..
-rw-r--r-- 1 root root 512 Feb 26 15:20 HIKWS
-rw-r--r-- 1 root root 1120 Feb 26 15:19 backupinfo00.bin
-rw-r--r-- 1 root root 1120 Feb 26 15:19 backupinfo01.bin
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00000.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00000.pic
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00001.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00002.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00003.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00004.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00005.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00006.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00007.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00008.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00009.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00010.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00011.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00012.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00013.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00014.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00015.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00016.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00017.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00018.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00019.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00020.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00021.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00022.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00023.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00024.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00025.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00026.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00027.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00028.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00029.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00030.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00031.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00032.mp4
-rw-r--r-- 1 root root 0 Feb 26 15:19 hiv00033.mp4
-rw-r--r-- 1 root root 698688 Feb 26 15:19 index00.bin
-rw-r--r-- 1 root root 328992 Feb 26 15:19 index00p.bin
-rw-r--r-- 1 root root 698688 Feb 26 15:19 index01.bin
-rw-r--r-- 1 root root 328992 Feb 26 15:19 index01p.bin
-rw-r--r-- 1 root root 16002048 Feb 26 15:22 logCurFile.bin
-rw-r--r-- 1 root root 32004192 Feb 26 15:20 logMainFile.bin
#
[EMAIL="alastair@Mint64"]alastair@Mint64[/EMAIL] ~ $ sudo exportfs -v
/home/alastair/testpoint
<world>(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,no_root_squash,no_all_squash)
[EMAIL="alastair@Mint64"]alastair@Mint64[/EMAIL] ~ $
Hmmm... indeed.
What does the 'Test' button show?
The action is to write a file and delete it, to confirm availability and access control.
Well, that's at least a step along the way.
"Device Error" certainly doesn't help.
I'm not sure what to suggest, sorry.
So you've gone for anonymous access - any particular reason? Was it one of the changes needed to make it work?all_squash
Excellent! Full marks for problem solving, and kudos for sharing to help others.
I wonder if Hikvision will be changing how the devices store to a 'NetHDD'? It's not one of the better designed parts of the firmware.
So you've gone for anonymous access - any particular reason? Was it one of the changes needed to make it work?
/dev/mapper/alph--lvm-home /storage ext4 defaults[COLOR=#ff0000],usrquota,grpquota[/COLOR] 1 2
quotacheck -cug /storage
quotacheck -avug
edquota camera1
python -c "print [COLOR=#ff0000]XXX[/COLOR]*1024**"2"
quota camera1
service smb restart
systemctl enable smb
systemctl start smb
service smb status
Hi everybody!
After 1 week of poking around NFS/Samba I finally managed to set it up correctly with SAMBA (because NFS version used by the cameras does not support user authentication (you'll see later on why we need this)!
Here is my setup:
- 4 Hikvision IP cameras, 3x DS-2CD2T22-I5, firmware V5.3.0 build 151016 and 1x DS-2CD2622FWD-IZS, firmware V5.3.6 build 151105
- powered through a POE switch
- 24h running Linux Fedora 22 X64 server (used for hosting Plex, BOINC, Seafile and other stuff), kernel 4.4.8-200
- RAID LVM partition of 8TB mounted under /storage where I want my cameras to write in
- Samba server ver. 4.2.11
- Quota ver. 4.03
Steps:
- Enabling quota - credits here.
- look into etc/fstab for the words usrquota or grpquota next to the line mounting your desired partition. If it's not there, add it like this:
(no space after the ,)Code:/dev/mapper/alph--lvm-home /storage ext4 defaults[COLOR=#ff0000],usrquota,grpquota[/COLOR] 1 2
- restart or remount if you don't have files in use
- Create one user for each camera with settings like below (8 character passwords, home directory and private group). I created 4 users camera1...4:
- Create one directory for each camera on your desired partition/location. I created 4 directories /storage/camera1...4
- Change owner and group of each directory to each corresponding user created above.
- camera1 directory belongs to user and group camera1 and so on
- Create the quota files (aquota.user and aquota.group) using:
- it has to be done under /storageCode:quotacheck -cug /storage
- Generate the table of current disk usage per file system with quotas enabled using:
Code:quotacheck -avug
- Assign quota per user:
replace the 0 under hard column with your desired value; for 400GB it is 419430400, for 200GB is 20971500. You can compute your own as another user on this thread was kind to tell us by using:Code:edquota camera1
where XXX is your desired GBCode:python -c "print [COLOR=#ff0000]XXX[/COLOR]*1024**"2"
- do it for the other users as well
- Check if it's ok with
. If you want to add more options like time limits etc... please look into the credits link.Code:quota camera1
- Now let's setup SAMBA. I used the GUI /usr/bin/system-config-samba. If you don't have it, install it.
- click on Preferences, Samba Users and add all users created before, camera 1...4
- click on Preferences, Server Settings, Security and make sure, you have it like this:
- View attachment 10606
- Click on add a Samba share and point to the directories created before, camera 1...4, assign a short name like camera1 and check Writable and Visible:
- View attachment 10607
- On tab Access select "Give access to these users and check one corresponding user for each camera
- restart the Samba server by using
Code:service smb restart
- make it run at boot by using
and start it by usingCode:systemctl enable smb
Code:systemctl start smb
- check if it's OK by using
Code:service smb status
- Going back to the camera storage setup. You have to use a short path in the File path exactly like this /camera1...4 with a / not a \. Click on test, then on save, then on HDD Management tab where you'll see the HDD without the values yet. Click again on NetHDD tab and again on test and on save and after you finally get back to HDD Management tab you can select the new HDD and format it.
- Restart everything
- In conclusion, you don't need to set it at around 200GB you can go as much as 400GB or even higher, thing is the camera needs to see all the free space and the capacity for itself, this is why you need to setup the quotas.