Page 1 of 1

ZM filling up root while events being stored on separate drive

Posted: Sun Feb 26, 2017 3:06 pm
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

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

Posted: Sun Feb 18, 2018 2:33 am
by GnuSquid
Did you ever get this resolved. I think I'm having a similar issue.

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

Posted: Sun Feb 18, 2018 3:25 am
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.

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

Posted: Sun Feb 18, 2018 2:37 pm
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

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

Posted: Mon Feb 19, 2018 2:12 am
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.

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

Posted: Mon Feb 19, 2018 1:02 pm
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.

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

Posted: Mon Feb 19, 2018 1:23 pm
by jHeron
Thanks!
Jon

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

Posted: Mon Feb 19, 2018 2:15 pm
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.

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

Posted: Thu Feb 22, 2018 3:54 pm
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/

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

Posted: Thu Feb 22, 2018 4:15 pm
by knight-of-ni
Cool. Didn't know that.