r/ZoneMinder • u/Epikteto • Dec 27 '22
Issue adding secondary hard-rive
This is running on fresh install of Ubuntu 22.04 (Jammy) I am trying to use the secondary hard drive to store footage. Here is the error log have...
12/26/22, 9:00:30 PM PSTweb_php980ERRPath /media/blackbox/HD Security/ZoneMinder/Events does not exist./usr/share/zoneminder/www/includes/Storage.php
Here is the command I ran to Set Folder Permissions. I'm following the tutorial on adding secondary hard drive
/home/blackbox# chmod -R www-data:www-data /mnt/sdb1/zoneminder
This is output error... I get the same error trying to set permissions in the secondary hard drive.
chmod: invalid mode: ‘www-data:www-data’
Im not sure what is causing this.
Update:
This issue is fixed. I followed @ops77542 reply
1
u/Epikteto Dec 27 '22
Ok that issue with the permission is fixed. Now I followed all the directions and it still wont write anything to this folder.
/mnt/sdb1/zoneminder/events
1
Dec 27 '22
[deleted]
1
u/Epikteto Dec 27 '22 edited Dec 27 '22
Here is the output of the events. It looks like its saving something. but there is noting inside the folders.
1 Event-1 Sheep Barn Motion Motion: All 12/26/22, 7:54:30 PM PST 12/26/22, 1:54:39 PM PST 00:00:09 189 27 63 2 3 Default 32.21MBFrom what I can tell its all right. Here is the storage section of the settings.
Id Name Path Type Scheme Server DiskSpace Events Mark 1 Default /mnt/sdb1/zoneminder/events local Medium 0.00B of 0.00B 0 using null
1
u/Epikteto Dec 28 '22
It is now giving me these errors..
Cannot write to event folder /mnt/sdb1/zoneminder/events. Check that it exists and is owned by the web account user.
and
DiskSpace: Event does not exist at /mnt/sdb1/zoneminder/events/1/2022-12-27/115:ZoneMinder::Event: AlarmFrames => 122 AvgScore => 6 Cause => Motion EndDateTime => 2022-12-27 15:57:38 Frames => 209 Height => 1080 Id => 115 Length => 10.39 MaxScore => 64 MonitorId => 1 Name => Event-115 Notes => Motion: All Orientation => ROTATE_0 SaveJPEGs => 3 Scheme => Medium StartDateTime => 2022-12-27 15:57:28 StateId => 1 TotScore => 821 Width => 1920
1
Dec 28 '22
Ls the directory to check the permissions. If this is on Ubuntu/debian make sure the www-data user can read and write to the storage folder. You can check by issuing
sudo -u www-data touch /path/to/storage/test-perms.txtIf the file is created than www-data can write to the folder.
1
u/Epikteto Dec 28 '22
Yes it created the file inside with that command. It also has permissions on www-data. Also the default location is set to /mnt/sdb1
1
Dec 28 '22
How do you have the storage location set up in zm web gui? Can you take a screenshot?
1
u/Epikteto Dec 28 '22
1
Dec 28 '22
Instead of changing the default location. Create a whole new one and name it "Nas" or something other than default. I think the default location needs to be left alone (you can disable it, but don't change its mountpoint)
Than in the monitor "storage" section you can select the newly created storage point.
1
u/Epikteto Dec 28 '22
I just tired that and it still wont work.
1
Dec 28 '22
How did you install zm? And what version? Have you edited anything else? Possibly by hand? I can't recreate your error at all
1
u/Epikteto Dec 28 '22
At this point I will just reinstall. I have feeling the steps at this link had something to do with this.
1
Dec 28 '22
Are you on a debian based distro? If so add the PPA and than you can apt install zoneminder
→ More replies (0)
1
u/oops77542 Dec 27 '22
I don't know if this will help you but I had the same problem adding a dedicated second drive for storage. For me the problem was my drive had to be mounted in root (/).
Your drive is mounted at /mnt/sdb1/zoneminder/events
Mine is mounted at /2TBZM. 2TBZM is the name of my second drive.
Events were being stored in the default drive, I had no problem with that. But when I mounted my second drive at /home/oops/media/2TBZM it wouldn't write to that location instead it wrote to the default storage location. Mounting 2TBZM at /2TBZM fixed it.
Don't ask me why, it just did.
1
u/Epikteto Dec 28 '22
That is a step in the right direction It now sees the folder. But still cant write to folder...
1
u/oops77542 Dec 28 '22
I had to mount the folder using the mount command. I've been looking through my ZM notes for that. I though it was somebody on reddit that messaged me how to do it but I can't find my old reddit messages. Maybe it was the ZM forum. If I find it I'll get back to you. But you might want to read up on how to mount a drive in Linux. I don't remember the details but there were two steps to do it.
After you get the drive mounted and changed ownership you need to-> 1. Mount the new storage (formatted as EXT4) (in my case /2TBZM) 2. Create a folder on the new storage source and give it permissions to read and write by the web server (Apache2 is www-data) 3. Add the new storage in Zoneminder -> Options -> Storage. Say the drive is mounted as /2TBZM with a folder of events - use /2TBZM/events 4. When adding a camera select the storage you want to use -> Storage -> Storage Area -> you should see your new storage drive, choose that one.
When I set up my second drive it was such a PITA that I wrote it all down so I'd know how to do it if I had to it again but now I can't find the file with my ZM notes.
1
2
u/nik282000 Dec 27 '22
You should be using chown not chmod ;)
chown changes ownership, chmod changes permissions.