Storage Troubles

I’m having storage issues where the mounted drive for recordings is hitting 100% even though I had 90% set. Also the space used on the Storage page is showing 5x more space used than the HDD has.

I’m running on Ubuntu 24.04.3 on a 256GD SDD and currently using 1 1T HDD mounted to the /var/lib/bluecherry/recordings directory. The HDD is formatted as a Linux (Type 83) partition. I’m running BluecherryDVR 3.1.13

After initial installation and configuration it looks like I was requesting more days than the HDD could support and the Max storage was set to 95%. Everything was OK initially then the disk filled to 100%. I manually deleted the recordings directory and restarted the server and set the days recording to 7 days. Still filled the HDD. Also I did not know about clearing events so I now had a miss-match between events and stored images. Again cleared the recordings directory and cleared the events, as posted in a separate topic. I have also set the storage to only 11% and 1 day of recordings. I’ll watch again but the Max storage does not appear to be working, at least when set to 95% or 90%. Also, even though I reset events, the recording statistics have not reset and I do not know if this will impact storage usage.

The documentation is empty for details on storage and General settings for recordings. Are there any updates that explain these settings in more detail? How does bluecherry determine the max storage space of the mounted file system?

OK more on whats happening

I set the storage max to 11%, tried lower as message says from 1% to 100%, however anyting below 11% the save fails and tells me to use between 1% and 100%. 11% was the loweset I could enter.

Ran over night and I’m up to 19% now.

I looked at the log and saw that Starting optimazation cleanups started when I crossed 11% but storage has continued to grow until now where I’m currently at 19%.

I’m also getting an odd warning message: W(): Suspiciously low min_thresh for /var/lib/bluecherry/recordings

I have included a trimmed log that only has the storage info messages where you can see the progress of disk growth and some attempt to contain it, but past themax threshold I defined of 11%

bluecherry.log (100.4 KB)

I’m still wondering if the issue is due to manually deleting recordings when I was first using the new server. I have since cleared all recordings and used the event delete commands in another thread. Are there additional database records that need to be cleaned up to get the database and disk back in sync?

Unless I find something new, this is the last info on this problem.

Storage continue to climb even though storage max is set to 11% and the log indicates system knows this. Over 42% space consumed now.

I also changed the General Settings "Mas recodr storage age from 3 down to 1, I tried 0 but that just empties the days out and I don’t know what this does, does it just use storage % then?

The attached log is the lates trimmed picking up at 30% until I pulled the log data. It does seem to dete some files (according to the log) but storage space copntinues to climb.

bluecherry4.log (173.0 KB)

If I can’t firgure out whats going on, my last ditch will be to reinstall bluecherrydvr and see if that fixes it.

Well, had a breakthrough.

Learned some basic SQL and investigate the database. Found a table called Media that holds the file descriptors for recordings. Had filenames going back a month and each camera had lots file files. The disk cleanup was limited to 200 files at a time and since it was not finding old files, as I had deleted them, it would stop and never catch up to current files.

I use the commands:
mysql bluecherry
delete from Media where filepath like ‘/var/lib/bluecherry/recordings/2025/0x/yy%’;

where x was the old months and yy was the old days for files that no longer existed.

After purging all old filename records, the next cleanup cycle finally found recordings and did multiple file groups until disk storage was below max %.

I don’t know if any other records need to be cleaned up after manual event and file deletions, however disk storage seems to be managing properly, at least for the moment. I’ll watch for a few days before opening up the majority of the drive.

There really needs to be a better way to clear out unwanted event records and files. This was a pain.