How to setup another storage for camera?

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
andrkac
Posts: 10
Joined: Tue Dec 21, 2021 10:22 pm

How to setup another storage for camera?

Post by andrkac »

I have only one camera.
Default storage is for the events /var/cache/zoneminder/events. I want to change it to /mnt/storage, which is additional disk. The same directory I want to share via smb. Sharing via smb works with various combinations of ownershi and priviledges (775, 777, root:root, www-data:www-data) but i cannot manage zoneminder to use this storage - I've tried to add second one and switch camera storage the added one, and edit directory of default storage; in both cases I've rebooted machine and ...nothings changed.

What should I set up?
In zmc_m1.log i can see:
10/27/24 02:43:07.148749 zmc_m1[1072].ERR-zm_event.cpp/555 [Can't mkdir /mnt/storage/1: Permission denied]
(and similar)
But - why?
# ls -l /mnt/
total 4
drwxrwxrwx 3 www-data www-data 4096 Oct 27 03:05 storage
User avatar
eracc
Posts: 107
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: How to setup another storage for camera?

Post by eracc »

The problem could be the mount options. What does the mount command show for the flags on that additional disk?
andrkac
Posts: 10
Joined: Tue Dec 21, 2021 10:22 pm

Re: How to setup another storage for camera?

Post by andrkac »

It is mounted by fstab:

/dev/sda1 /mnt/storage ext4 defaults 0 1
User avatar
eracc
Posts: 107
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: How to setup another storage for camera?

Post by eracc »

I understand that is in your /etc/fstab. Regardless, what does the mount command show for that mount point when you run it?
andrkac
Posts: 10
Joined: Tue Dec 21, 2021 10:22 pm

Re: How to setup another storage for camera?

Post by andrkac »

Here's the result:

# mount | grep storage
/dev/sda1 on /mnt/storage type ext4 (rw,relatime)
I still do not see anything suspicious here. No idea how to debug it.
User avatar
eracc
Posts: 107
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: How to setup another storage for camera?

Post by eracc »

Okay, yeah, that looks normal. Since you have its perms at drwxrwxrwx, can your normal user account write to that mounted storage directory? Meaning whatever you login as that is not root.

Oh, and I am presuming ZoneMinder is running as the www-data user too. Here it is running as the www user and my box is using ZFS. But I am running it on FreeBSD and that is how the pkg install set it up. When I add another storage area on my second ZFS mirror I am going to copy how the original storage directory is permissioned:

Code: Select all

root@ealexhome:~ # ls -dl /var/db/zoneminder
drwxr-xr-x  3 www  www  3 Oct 10 14:43 /var/db/zoneminder
andrkac
Posts: 10
Joined: Tue Dec 21, 2021 10:22 pm

Re: How to setup another storage for camera?

Post by andrkac »

Unfortunately - I can write to this folder, locally by common user and remotely - via samba. And yes, www-data is the user zoneminder is working on.

And now the strangest part: I've "hacked" the system - removed original events directory and created it as a link to /mnt/storage. And... it works as expected!
I still can't understand the big picture...
Post Reply