Incorrect Disk Usage %

Forum for questions and support relating to the 1.29.x releases only.
Locked
luckysoft
Posts: 3
Joined: Sun Feb 07, 2016 8:33 pm

Incorrect Disk Usage %

Post by luckysoft »

After following the dedicated hard drive guide (https://wiki.zoneminder.com/Using_a_ded ... Hard_Drive), the console shows the disk usage percentage at 5%. However, according to df, it shows 1%. Additionally, I know there is no way I used up 5% of 3.4T since I only began recording with 1 camera connected. Am I doing something wrong?

I am running ZM on Ubuntu Server 14.04, with the events/images stored in /cctv/zone.

Code: Select all

$ df --total -hl
Filesystem                Size  Used Avail Use% Mounted on
udev                      3.9G  4.0K  3.9G   1% /dev
tmpfs                     795M  664K  794M   1% /run
/dev/sda3                  38G  1.8G   35G   5% /
none                      4.0K     0  4.0K   0% /sys/fs/cgroup
none                      5.0M     0  5.0M   0% /run/lock
none                      3.9G  132M  3.8G   4% /run/shm
none                      100M     0  100M   0% /run/user
/dev/mapper/cctv_vg-cctv  3.6T  804M  3.4T   1% /cctv
total                     3.6T  2.7G  3.4T   1% -
My /etc/fstab is:

Code: Select all

UUID=e8a5e08b-baab-470c-914b-d9bcea39006b /cctv         ext4    defaults        0       2
/cctv/zone/images /var/cache/zoneminder/images          none    defaults,bind   0       2
/cctv/zone/events /var/cache/zoneminder/events          none    defaults,bind   0       2
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Incorrect Disk Usage %

Post by knight-of-ni »

What is the exact value of DIR_EVENTS under Options?
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
luckysoft
Posts: 3
Joined: Sun Feb 07, 2016 8:33 pm

Re: Incorrect Disk Usage %

Post by luckysoft »

DIR_EVENTS is left its default value of: events

Am I suppose to change it?
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Incorrect Disk Usage %

Post by knight-of-ni »

No, we just wanted to make sure you had not changed it.

Please execute the following from the command line:

Code: Select all

php -r "print disk_free_space('/usr/share/zoneminder/www/events').' '.disk_free_space('/var/cache/zoneminder/events');"
Followed by the output of "df" again since that has probably changed. Leave the "-h" parameter off so we get report in bytes.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
luckysoft
Posts: 3
Joined: Sun Feb 07, 2016 8:33 pm

Re: Incorrect Disk Usage %

Post by luckysoft »

I get the following:

Code: Select all

calired@CaliRed-CCTV:~$ php -r "print disk_free_space('/usr/share/zoneminder/www/events').' '.disk_free_space('/var/cache/zoneminder/events');"
3682343776256 3682343776256calired@CaliRed-CCTV:~$ df --total -l
Filesystem                1K-blocks     Used  Available Use% Mounted on
udev                        4021848        4    4021844   1% /dev
tmpfs                        813192      684     812508   1% /run
/dev/sda3                  39717272  1822088   35854608   5% /
none                              4        0          4   0% /sys/fs/cgroup
none                           5120        0       5120   0% /run/lock
none                        4065960   135004    3930956   4% /run/shm
none                         102400        0     102400   0% /run/user
/dev/mapper/cctv_vg-cctv 3797514424  8549884 3596038844   1% /cctv
total                    3846240220 10507664 3640766284   1% -
EDIT: If I do ((Total - Available) / Total) * 100, I get 5.3054, which would make sense.

Thanks for your time!
User avatar
andrewa
Posts: 18
Joined: Tue Feb 15, 2011 7:22 pm
Location: Bulgaria

Re: Incorrect Disk Usage %

Post by andrewa »

Old post but similar problem: Disk usage in ZM shows 0%, df shows 87%, filter works OK and deletes old events keeping stored events as expected.
This is observed on just one machine with RAID0 with 3 * 3TB HDD. Below is the output of some commands:
[root@ruters ~]# df -kh
Filesystem Size Used Avail Use% Mounted on
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 1.3G 6.6G 17% /dev/shm
tmpfs 7.8G 2.5M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/fedora-root 50G 21G 27G 44% /
tmpfs 7.8G 120K 7.8G 1% /tmp
/dev/sda2 976M 160M 749M 18% /boot
/dev/sda1 200M 9.5M 191M 5% /boot/efi
/dev/mapper/fedora-home 52G 2.7G 47G 6% /home
/dev/md0 8.2T 6.7T 1.1T 87% /DVR
tmpfs 1.6G 28K 1.6G 1% /run/user/42
overlay 50G 21G 27G 44% /var/lib/docker/overlay2/ce8bc9812de307a7fe4db03ab4252c889a94204698fc9e4d0c34a5d1d9e0a2ad/merged
overlay 50G 21G 27G 44% /var/lib/docker/overlay2/f69e805acd956d13be70380c23da5ec7f85cfef3cca9cbdbb34f41922a31f9f2/merged
shm 64M 0 64M 0% /var/lib/docker/containers/34bbc9c8afbc008c1e83190ba828ecf26220cae52daa19359fe017295f4d1ce4/shm
shm 64M 0 64M 0% /var/lib/docker/containers/6eee150fe459583c7e10007300d991b503ce7ef5fc63301b4b6354fad56f7d6a/shm
tmpfs 1.6G 68K 1.6G 1% /run/user/0

DIR_EVENTS is left its default value of: events

/etc/fstab contains:
/dev/md0 /DVR ext4 defaults 1 1
/DVR/zoneminder/events /var/lib/zoneminder/events none defaults,bind 0 2
/DVR/zoneminder/images /var/lib/zoneminder/images none defaults,bind 0 2

Screenshot from ZM reporting 0% disk usage:
Capture.JPG
Capture.JPG (17.2 KiB) Viewed 5459 times
On 3 other Fedora26 installations without RAID0 array the disk usage shows correct. What am I missing on this machine?
User avatar
andrewa
Posts: 18
Joined: Tue Feb 15, 2011 7:22 pm
Location: Bulgaria

Re: Incorrect Disk Usage %

Post by andrewa »

Forgot one more output:

[root@ruters ~]# php -r "print disk_free_space('/usr/share/zoneminder/www/events').' '.disk_free_space('/DVR/zoneminder/events');"
1124912504832 1124912504832[root@ruters ~]#

/var/cache/zoneminder does not exist.

The old thread is about ZM v.1.29, mine is 1.30.4. Hope problem / solution are similar.
Locked