Mocord running all the time (filling my disk)

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
thesun
Posts: 17
Joined: Sun Nov 10, 2019 4:26 pm

Mocord running all the time (filling my disk)

Post by thesun »

So...I am running 1.32.3 and have 5 zones set up on my camera (a Foscam G2) and monitoring works great, but I'd like to record triggered motion events if I can for security. I've successfully added 5 zones and am trying to test it out but have found that the camera simply gung ho records everything non-stop, in exactly 10 min Event segments, starting the next the moment after the previous one stops. It's filling up my hard disk, so one question is if there's an easy way to get ZM to delete the oldest entries after a certain threshold is reached. I have found the Filter but thus far nothing shows if I click the "List Matches" button. And my drive is now 94% full.

So my questions are:

1. Is Mocord working properly or do I need to further tweak it (perhaps with the Presets?) so that it only records real events?

2. How do I use the Filter properly (and ideally, is it something I can run automatically? So far I manually click "Filter" then select one, then click...I don't want to be out for the day and come back to a totally full disk.

3. Since for the time being I probably want to delete the whole event list and keep testing, where are these events stored and can I safely delete them in bulk? (Currenly I've been using the browser console.)

Thank you very much in advance!
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Mocord running all the time (filling my disk)

Post by snake »

See viewtopic.php?f=38&t=28341

Yes you can delete all the events on the HDD. Check storage tab for where they are stored, typically default is /var/cache/zoneminder. If you delete the movies and jpegs from the HDD, then zmaudit will delete the DB entries after some time.
thesun
Posts: 17
Joined: Sun Nov 10, 2019 4:26 pm

Re: Mocord running all the time (filling my disk)

Post by thesun »

Hmmm, so I thought I had done this all correctly but clearly not, as now Zoneminder claims to be recording events but when I try to view them, it says they're unavailable.

1. I've made a conf file pointing to a new directory (/my/external/drive/zoneminder/events <--- trailing slash needed?).
2. I've changed the ownership of that file to "www-data" (how can I check and verify that's actually what ZM is using? Could this be incorrect?)
3. I've deleted the default directory in Storage and added the new one.
4. I've done "ln -s /my/external/drive/zoneminder/events/ /var/cache/zoneminder/events/" <---- is that the right syntax? Did I reverse it??

And that's where I'm at. When running, Zoneminder has my external drive listed as the storage location but just says 0% used even if I've left it running all night. I've got a hunch that maybe the ownership needs to be something other than "www-data" but "apache" wasn't it. (I'm on a Lubuntu system...so I tried the one often used by Debian distros.)

Thank you as always for continued help or suggestions!
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Mocord running all the time (filling my disk)

Post by snake »

For storage configuration with a new 1.32 install, you don't need a conf file. Edit the web gui storage tab (there are two storage tabs, one global on the main console page, and one for each camera - just a drop down).

Make sure ownership of the whole directory is recursively www-data (for debian, centos/rhel uses apache as you mentioned, i think), and there are write permissions.

Code: Select all

chown -r or chown -R www-data:www-data /videosgohere/
chmod for write permissions
Don't create any symbolic links to /var/cache/zoneminder.

There's no need to delete the original storage directory. Just leave it. It can be confusing if you make a new one with the same name of default, then you have two defaults, the old and the new.

Make sure the path in the global storage tab is correct.

Review logs for further troubleshooting.
thesun
Posts: 17
Joined: Sun Nov 10, 2019 4:26 pm

Re: Mocord running all the time (filling my disk)

Post by thesun »

Thank you, @snake for the additional suggestions. I will try these things. In the meantime I tested by deleting (from the console>options>storage the directory and redoing (I had already deleted the default) the dir...and it started recording again. So perhaps it's just a simple issue of permissions as you say. I'll do that and keep fingers crossed.
thesun
Posts: 17
Joined: Sun Nov 10, 2019 4:26 pm

Re: Mocord running all the time (filling my disk)

Post by thesun »

I don't know what the heck is going wrong. But is it because it's an external hard drive?

I've chowned it to www-data:www-data, the chmod is 777. The path exists if I go to an xterm and fill it in.../media/me/myusbhardrive/zoneminder/events/ I've added it in the Global settings and then also selected it in the camera pulldown.

But if I pull "myusbharddrive" in the storage pulldown, the camera immediately stops recording. If I leave it for default, it records.

And in the log it says "path doesn't exist." (But it does. Really. I promise!)
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Mocord running all the time (filling my disk)

Post by snake »

External HDDs are not a problem.

Post the output of lsblk and df -h
Also the output of stat . in the root directory of the external hdd.

Take a screenshot of storage settings on the global console, and in the camera.

Alternatively, you could follow the old guide on the wiki for 1.30.4 and earlier with external HDDs, but possibly with the above info, it will be apparent what the problem is. https://wiki.zoneminder.com/Using_a_ded ... Hard_Drive
thesun
Posts: 17
Joined: Sun Nov 10, 2019 4:26 pm

Re: Mocord running all the time (filling my disk)

Post by thesun »

Thank you!

Relevant parts of df -h are:
/dev/sdf1 931G 453G 479G 49% /media/my/extusbdrive

Relevant parts of lsblh are:

sdf 8:80 0 930.9G 0 disk
└─sdf1 8:81 0 930.9G 0 part /media/my/extusbdrive

(for security/privacy I've changed the actual path above, but they're identical in structure to what I'm seeing; screenshots mean revealing the actual pathname which I'd rather not do in a public forum, but there are no typos below, I promise. If you feel screenshots are vital, may I PM them to you?)

For the settings in the Options:
Name myusb
Path /media/my/extusbdrive/zoneminder/events/
Url (blank)
Server Remote/No specific
Type Local
Scheme Medium
Do Deletes Yes

At the top of the Console in blue, it has "Storage: var: 78%, extusbdrive: 0%, Default: 78% /dev/shm: 6%"

As soon as I choose "extusbdrive" from the individual camera's storage pulldown, recording stops. (Or it says "Not Capturing" to be specific.) If I switch it back to "Default" it works again.

Thank you for your continued support on this. If you're US-based, have a nice Turkeyday!
mikb
Posts: 586
Joined: Mon Mar 25, 2013 12:34 pm

Re: Mocord running all the time (filling my disk)

Post by mikb »

snake wrote: Thu Nov 28, 2019 6:01 am External HDDs are not a problem.
But sometimes the choice of filesystem is.

What filesystem is the external drive using? (FAT/NTFS/ext2-3-4/other?)

Does it understand "permissions" at all? (This can be a problem, where your attempts to set the permissions don't actually do anything, and everything ends up owned by "root.root" or something, and attempts to set user permissions are dumbed down to affect "user, group and other" to try and appease you :)
thesun
Posts: 17
Joined: Sun Nov 10, 2019 4:26 pm

Re: Mocord running all the time (filling my disk)

Post by thesun »

This may be the problem. Despite sudo-ing a chown -R www-data:www-data for that folder, it remains "myuser:myuser" So at the very least, that's part of the problem.

And df -T shows the filesystem type as "fuseblk" (but I believe it's NOT an ext2, 3, or 4). NTFS or ExFAT?

Is there a way to force it to change the user and ownership? Or am I just better off dedicating a different disk to this endeavor?

Thank you!
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Mocord running all the time (filling my disk)

Post by snake »

Use a new hard drive, or reformat the existing one, is the easiest.

I updated the wiki with some instructions for adding a storage area:
https://wiki.zoneminder.com/Using_a_ded ... structions
thesun
Posts: 17
Joined: Sun Nov 10, 2019 4:26 pm

Re: Mocord running all the time (filling my disk)

Post by thesun »

Well I am stumped.

I have mounted a new hard drive. Reformatted it as ext4.

I have chowned it www-data:www-data (any chance since I'm on Lubuntu this isn't correct???!!).

I have made perms 777.

I have selected the storage in both the global and the camera as per the (excellent!) wiki.

And it's still not recording.

Records fine if I switch to the var default.

Just gives me an error: "The video could not be loaded, either because the server or network failed or because the format is not supported."

As per an earlier "you don't need it" instruction I have NOT done a conf file...should I??

Really baffled. As always, thank for the help and I appreciate your sticking with me. I may have to just use live monitoring, as I can't run the risk of my Zoneminder filling up my hard disk while I'm away from home. Anyone think of anything I've overlooked??

Here's my "ls -la" of the events folder:
drwxrwxrwx 2 www-data www-data 4096 Dec 1 17:37 events

Thank you!!!
thesun
Posts: 17
Joined: Sun Nov 10, 2019 4:26 pm

Re: Mocord running all the time (filling my disk)

Post by thesun »

I think I'll stop at this point. Seems like I can record pretty easily with VLC and I'll just dedicate that hard drive to it instead. Hopefully 1 terabyte will give me a decent amount of recording time and I won't need the motion recording after all. A shame, but I guess it's just not going to work for me. Thanks for the assistance til now! :-)
Post Reply