Unable to access 2nd HDD for storage

Forum for questions and support relating to the 1.34.x releases only.
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Unable to access 2nd HDD for storage

Post by rfeyer »

Hi all,
I have a system with 2 HDD's: 750Gig for Ubuntu and another 1Tb HDD meant for ZM storage.
I have no problem using any directory on the 1st drive as storage, but have not found a way to use the second.
Second drive is accessible via Caja or Nautilus via /media/rainer/data/ZM_Data
both data and ZM_Data have read write permissions.
In ZM, under options/ storage, I have entered /media/rainer/data/ZM_Data by itself, and have also tried adding same entry in URL (which is how the manpage/ Wiki shows it.
I have tried adding the shares either via Ubuntu 20.04 via right click then Share, and also by changing the /etc/Samba/smb.conf Each time I make changes I restart smbd and nmbd.

Now, I do have problems getting to the drive and folders on my LAN with another Linux machine (Mint 20.04). I believe it is because the exclusion of SMB1 (but I am certainly not a Linux knowledgable individual). I can, however, access the folders via: smb://ip address/zm_data (zm_data being the share name).

Here is some system info if that helps:
System: Kernel: 5.4.0-60-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: MATE 1.24.0
wm: marco dm: LightDM Distro: Linux Mint 20 Ulyana base: Ubuntu 20.04 focal
Machine: Type: Desktop System: LENOVO product: 5048F1U v: ThinkCentre M81 serial: <filter>
Mobo: LENOVO model: N/A serial: <filter> BIOS: LENOVO v: 9HKT58AUS date: 06/10/2014
CPU: Topology: Quad Core model: Intel Core i7-2600S bits: 64 type: MT MCP arch: Sandy Bridge
rev: 7 L2 cache: 8192 KiB
flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 44699
Speed: 3528 MHz min/max: 1600/3800 MHz Core speeds (MHz): 1: 3508 2: 3173 3: 3300
4: 3254 5: 3675 6: 3315 7: 3329 8: 3455

Memory: 20 gig
User avatar
Andyrh
Posts: 245
Joined: Sat Oct 28, 2017 3:55 am

Re: Unable to access 2nd HDD for storage

Post by Andyrh »

It is unclear what error you are seeing?

My setup:
Under storage I have 2 locations, Default and Store1. Store1 points to my 2nd HD.
In the camera config on the storage tab I selected store1 and all works as expected.

If that does not help please post the error you are seeing.
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Re: Unable to access 2nd HDD for storage

Post by rfeyer »

No telling the storage error was rather silly of me.
I deleted the storage option, so don't have exact verbiage, but, in essence it noted that the storage /media/rainer/data/ZM is not avaliable (or does not exist I think it said)
User avatar
Andyrh
Posts: 245
Joined: Sat Oct 28, 2017 3:55 am

Re: Unable to access 2nd HDD for storage

Post by Andyrh »

Maybe security.
It should look something like this:
drwxr-xr-x 8 www-data www-data 4096 Jun 22 2020 store1

If you can grab the exact error message I am sure better help will be given.
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Re: Unable to access 2nd HDD for storage

Post by rfeyer »

TY
I will add the storage info again and wait for the error, then post!
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Re: Unable to access 2nd HDD for storage

Post by rfeyer »

OK, I added the second HDD storage path into the options/storage field: /media/rainer/data/ZM_Data
Here is the copy/ paste of the file path shown by Caja File Manager: /media/rainer/data/ZM_Data

Here is the error reported by ZM Log (I don't yet know where the log file resides):
2021-01-13 17:05:28 web_php 10385 WAR Storage::disk_usage_percent: path /media/rainer/data/ZM_Data/ does not exist /usr/share/zoneminder/www/includes/Storage.php 74
2021-01-13 17:05:28 web_php 10385 ERR Path /media/rainer/data/ZM_Data/ does not exist.

The Sharing emblem is embedded in the floder icon of folder ZM_Data with all permissions set to owner and guest. A couple of days ago I also had a different folder which I chown'd to 755. After not getting anywhere I deleted the ZM storage option of this folder and deleted the folder itself.
User avatar
Andyrh
Posts: 245
Joined: Sat Oct 28, 2017 3:55 am

Re: Unable to access 2nd HDD for storage

Post by Andyrh »

From the description it looks like a OS issue, maybe permissions.

You can successfully cd into /media/rainer/data/ZM_Data? Touch a file there to make sure that works.
What permissions are set on the directory ZM_Data ?
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Re: Unable to access 2nd HDD for storage

Post by rfeyer »

TY for your reply!
I am able to connec to, and read a file, in the second HDD even over samba with abother PC running Mint 20
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Unable to access 2nd HDD for storage

Post by Magic919 »

To make sure ZM can write there run -

Code: Select all

chown www-data:www-data  /media/rainer/data/ZM_Data
As a test, touch a file there as suggested.

Code: Select all

sudo -u www-data touch /media/rainer/data/ZM_Data/test_file.txt  
-
Paranoid
Posts: 129
Joined: Thu Feb 05, 2009 10:40 pm

Re: Unable to access 2nd HDD for storage

Post by Paranoid »

Open a terminal and run

Code: Select all

df -kh
If your disk does not appear in the list then it isn't mounted and isn't accessible by Zoneminder.
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Re: Unable to access 2nd HDD for storage

Post by rfeyer »

TY both!
It still will give the ame error.
I will try a new HDD when it arrives!

Again, Ty for giving me your time!
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Unable to access 2nd HDD for storage

Post by bbunge »

Your 2nd hard drive should be mounted in the Linux file system. The easy way I do that is to set up the mount for both hard drives when I install Linux. The first HD is mounted as "/" and the second hard drive is mounted as "/zmstore"
It is possible to add the 2nd drive afterwards and here is one way: https://wiki.zoneminder.com/Common_Issu ... ive_or_NAS
Whichever method you use the drive should have a dedicated folder or directory to store events with read write permissions for Zoneminder (Ubuntu used www-data)
This is not hard to do but you need to plan ahead when you set up your server. I have several servers with a SSD for "/" and a conventional (Green) HD for "/zmstore" Both drives were set up and formated off of a mini.iso net installer for Ubuntu
User avatar
Acewiza
Posts: 72
Joined: Thu Dec 31, 2020 4:52 pm

Re: Unable to access 2nd HDD for storage

Post by Acewiza »

There is something funky going on internally with ZM storage assignment(s). I had the same issue initially and did not resolve it until after re-installing, and I'm not sure why it worked the 2nd time around. My wild-assed guess is something in the install/config gets confused when multiple block device storage paths are seen on the system. Mine is probably like a worst-case scenario with differing local drives and NFS mounts as well. Initially ZM refused to recognize my NFS mount, returning that same error. It is not a permissions issue. Users own whatever comes up under their media folder by default. There's bigger issues if ZM can't use that by default.
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Unable to access 2nd HDD for storage

Post by burger »

Wiki link as a reference: https://wiki.zoneminder.com/Using_a_ded ... Hard_Drive

People have had trouble with network mounts. But I believe they can work. Search the forums. I make sure that whatever hdd is added after the first, that it has a name other than "default". That's the only trouble I've seen.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
User avatar
Acewiza
Posts: 72
Joined: Thu Dec 31, 2020 4:52 pm

Re: Unable to access 2nd HDD for storage

Post by Acewiza »

I plan on adding a dedicated drive for zm after I finish it's IOT phase. We'll see how it goes. Storage needs to come in and out of ZM seamlessly at will - especially in cases where legal issues might be at stake.
Post Reply