afddwfadwfadwf
Young grasshopper
- Joined
- Mar 28, 2016
- Messages
- 83
- Reaction score
- 12
The problem is that with linux quota, an actual Windows will report the correct volume size, but Hikvision reports the actual disk size. So the camera is going to try writing more than allowed, resulting hdd errors and broken overwrite feature?
For example, quota for the camera user is 500GB on a 4TB drive. Windows reports the share as 500GB in size, but hikvision reports it as 4TB.... Isn't that going to cause problems?
Actually it did not work...After formatting it still says uninitialized...info.bin only has the serial number.
Can someone post your working info.bin?
The workaround is as mentioned earlier, mount a file of fixed size instead. But I prefer I cleaner way to fix this issue...
For example, quota for the camera user is 500GB on a 4TB drive. Windows reports the share as 500GB in size, but hikvision reports it as 4TB.... Isn't that going to cause problems?
Actually it did not work...After formatting it still says uninitialized...info.bin only has the serial number.
Can someone post your working info.bin?
The workaround is as mentioned earlier, mount a file of fixed size instead. But I prefer I cleaner way to fix this issue...
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.
Last edited by a moderator: