Running out of disk space

Forum for questions and support relating to the 1.29.x releases only.
Locked
baradanikto
Posts: 13
Joined: Mon Feb 08, 2016 11:11 pm

Running out of disk space

Post by baradanikto »

I've read the docs and done what was suggested for filters. However, I still see a large amount of space being consumed in var/cache/zoneminder/events. I'm talking gigs. How do I control that from happening? I've used MySql to clean out the events, but, it appears there's some other files left around.
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Running out of disk space

Post by bbunge »

You use zoneminder to clean out events. If you did it with some other utility you likely messed up the zm database and should dump it and make a new one. You can use filters to delete events and zm will, in time, delete the event images. Or you can turn on fast delete. Online docs cover this well.
baradanikto
Posts: 13
Joined: Mon Feb 08, 2016 11:11 pm

Re: Running out of disk space

Post by baradanikto »

Thanks for your reply. I agree that using MySql workbench probably corrupted something. But, are you taking about dropping the Events table, or, the entire database? I'm assuming that if I drop the entire database I'll lose all definition of my camera(s), etc. What is the recommended way to recreate the ZM database/tables from scratch?
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Running out of disk space

Post by bbunge »

Create Zoneminder database in MySQL (Note: this also creates the default Zoneminder user and permissions in MySQL)

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql

mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"

mysqladmin -uroot -p reload
baradanikto
Posts: 13
Joined: Mon Feb 08, 2016 11:11 pm

Re: Running out of disk space

Post by baradanikto »

Thanks for that. But, before I can attempt anything, I need to resolve the disk space issue with "var/cache/zoneminder/events". There seems to be gigs of data there and I can't delete it because it seems to be owned by a different user. Will your procedure clean up that space also? My fear is that if it doesn't, I still will need to address the disk space as I only have about 192mb left of 500gb.
mikb
Posts: 678
Joined: Mon Mar 25, 2013 12:34 pm

Re: Running out of disk space

Post by mikb »

The steps above won't clear out your disk events directly.

ZMAudit (when it next runs) may get very busy deleting the disk files (jpgs/videos) which no longer have a corresponding database entry (due to you having an empty database.)
baradanikto
Posts: 13
Joined: Mon Feb 08, 2016 11:11 pm

Re: Running out of disk space

Post by baradanikto »

mikb & bunge..... Thanks for your help. I was able to recreate the database following your advice. It took a couple of days, but, it appears that the audit program (or filter) has cleaned out the orphaned files. My free disk space has increased and is now at the expected level.
Locked