ZM filling up root while events being stored on separate drive

Forum for questions and support relating to the 1.30.x releases only.
Locked
jHeron
Posts: 73
Joined: Sun Jun 16, 2013 5:06 pm

ZM filling up root while events being stored on separate drive

Post by jHeron »

Fedora 25_64
I am mounting a separate 1TB drive and directing the events folder to it via fstab like this;

Code: Select all

#big disk auto mount
UUID=3571f3d0-9874-4c89-b4f4-8cdb4c22c11d /home/pvr/bigDisk	ext4	defaults	0 1
#mounts for zm 
/home/pvr/bigDisk/zm/images /var/lib/zoneminder/images none defaults,bind 0 2
/home/pvr/bigDisk/zm/events /var/lib/zoneminder/events none defaults,bind 0 2
Which was working fine until after a reboot mariadb failed to start and /root was reporting 0mb of free space.
Disk analyser showed the issue to be the /var/lib/zoneminder/events folder?
I deleted a bunch of events but the free space indicator wont update?
I had to use this trick to adjust the space reserved for root;
http://unix.stackexchange.com/questions ... -files-now

Code: Select all

# tune2fs -m4  /dev/sda4
Which got mariadb running again. zm audit did its thing and removed all the db entries for the events I deleted manually but I still cant get my free space back and dont understand why /root is filling up when events is on a different drive?
When I check the size of the /var/lib/zoneminder folder (via nautilus) it shows its full for /root but when I check the size of /var/lib/zoneminder/events it shows the size of the separate 1TB drive as it should.
I am at a loss for what I need to do to fix this and am wide open to suggestions!
Cheers,
Jon
GnuSquid
Posts: 2
Joined: Sat Sep 16, 2017 4:11 pm

Re: ZM filling up root while events being stored on separate drive

Post by GnuSquid »

Did you ever get this resolved. I think I'm having a similar issue.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: ZM filling up root while events being stored on separate drive

Post by bbunge »

You are better off using systemd to mount the storage. That way you can control if Zoneminder starts if the mount fails. Ubuntu procedures on the WIKI and RH procedures exist somewhere.
jHeron
Posts: 73
Joined: Sun Jun 16, 2013 5:06 pm

Re: ZM filling up root while events being stored on separate drive

Post by jHeron »

Nope, I ended up formatting the drive and giving it more space to fill...
I will look into the systemd method on the next install.
Cheers,
Jon
timelyfiasco
Posts: 12
Joined: Sun Jul 30, 2017 5:22 am

Re: ZM filling up root while events being stored on separate drive

Post by timelyfiasco »

I dont know if my experience is useful to you. But I save the recordings in a network drive and when it fails to mount the recording goes into the local /var/cache/zoneminder so I tried to change the permission of the folder so then it happens nothing is written to the folder and an error is shown in the log files.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: ZM filling up root while events being stored on separate drive

Post by knight-of-ni »

Do what bbunge said and create a systemd mount unit to mount your dedicated drive, partition, or network share.

My original writeup on that is here:
http://zoneminder.blogspot.com/p/blog-page.html

....but I think bbunge has a newer writeup.

Systemd can automatically prevent ZoneMinder from starting if the dedicated drive or partition fails to mount first. See the writeup for details.
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/
jHeron
Posts: 73
Joined: Sun Jun 16, 2013 5:06 pm

Re: ZM filling up root while events being stored on separate drive

Post by jHeron »

Thanks!
Jon
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: ZM filling up root while events being stored on separate drive

Post by knight-of-ni »

I just had another thought which also might help....

Linux has no problem mounting a drive or share to a folder with files already in it. When that happens, the files in the original folder are no longer accessible, but of course they are still taking up space on your root volume. To fix that, stop zoneminder and unmount your dedicated driver or share. Now inspect the /var/lib/zoneminder/events folder and delete anything you see in there. When done, remount your dedicated drive and start zoneminder back up.
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/
Paranoid
Posts: 129
Joined: Thu Feb 05, 2009 10:40 pm

Re: ZM filling up root while events being stored on separate drive

Post by Paranoid »

knnniggett wrote: Mon Feb 19, 2018 2:15 pm I just had another thought which also might help....

Linux has no problem mounting a drive or share to a folder with files already in it. When that happens, the files in the original folder are no longer accessible, but of course they are still taking up space on your root volume. To fix that, stop zoneminder and unmount your dedicated driver or share. Now inspect the /var/lib/zoneminder/events folder and delete anything you see in there. When done, remount your dedicated drive and start zoneminder back up.
There is no need to stop everything and umount, simply bind mount the root directory and you can then access it.

Code: Select all

mount --bind / /mnt
You can then delete anything under /mnt/var/lib/zoneminder/events/
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: ZM filling up root while events being stored on separate drive

Post by knight-of-ni »

Cool. Didn't know that.
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/
Locked