External storage

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
racelife
Posts: 84
Joined: Mon Mar 22, 2010 11:38 pm

External storage

Post by racelife »

I'm having some trouble recording to an external hard drive. I added the drive in fstab and it shows just fine. added it in the storage section and ZM sees it and reports the size but when I have a camera try to record to it there are errors and nothing gets recorded
Maybe a permissions error?

an example of some errors:
DiskSpace: Event does not exist at /media/data/2/2020-03-24/2:ZoneMinder::Event: AlarmFrames => 37 AvgScore => 12 Cause => Motion DefaultVideo => 2-video.mp4 EndTime => 2020-03-24 12:29:48 Frames => 97 Height => 480 Id => 2 Length => 9.71 MaxScore => 48 MonitorId => 2 Name => Event- 2 Notes => Motion: All Orientation => ROTATE_0 SaveJPEGs => 1 Scheme => Medium StartTime => 2020-03-24 12:29:39 StateId => 1 StorageId => 2 TotScore => 476 Width => 704

Could not open out file '/media/data/1/2020-03-24/3/3-video.mp4': No such file or directory

Can't open /media/data/1/2020-03-24/3/01031-capture.jpg for writing: No such file or directory
racelife
Posts: 84
Joined: Mon Mar 22, 2010 11:38 pm

Re: External storage

Post by racelife »

Additional info:

lsblk:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
└─sda1 8:1 0 465.7G 0 part /media/data
sdb 8:16 0 29.8G 0 disk
└─sdb1 8:17 0 29.8G 0 part
├─slime--vg-root 253:0 0 28.9G 0 lvm /
└─slime--vg-swap_1 253:1 0 976M 0 lvm [SWAP]
ls -lstra:
total 36
4 drwxr-xr-x 3 root root 4096 Mar 23 18:43 ..
4 -rw-r--r-- 1 rach rach 807 Mar 23 18:43 .profile
4 -rw-r--r-- 1 rach rach 3771 Mar 23 18:43 .bashrc
4 -rw-r--r-- 1 rach rach 220 Mar 23 18:43 .bash_logout
4 drwx------ 2 rach rach 4096 Mar 23 18:44 .cache
0 -rw-r--r-- 1 rach rach 0 Mar 23 18:47 .sudo_as_admin_successful
4 -rwxr-xr-x 1 root root 850 Mar 23 18:48 zm-install
4 -rw------- 1 rach rach 35 Mar 24 12:14 .bash_history
4 drwx------ 3 rach rach 4096 Mar 24 12:15 .gnupg
4 drwxr-xr-x 4 rach rach 4096 Mar 24 12:15 .

Screenshot at 2020-03-24 13-45-37.png
Screenshot at 2020-03-24 13-45-37.png (52.67 KiB) Viewed 2452 times
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: External storage

Post by snake »

Did you chown the mount to www-data (deb) or apache (centos)?

I put instructions for 1.32.3 here https://wiki.zoneminder.com/Using_a_ded ... Hard_Drive
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: External storage

Post by bbunge »

I have been successful with "external" drives when I set them up with the OS. Have used Ubuntu and Debian and when the install gets to formatting drive I choose manual, do the external with EXT4 mounted as /zmstore. Once set up I create an events directory on zmstore and give the drive www-data ownership. Just remember to set up the storage in zoneminder.
Using a systemd mount is also good. See the wiki.
racelife
Posts: 84
Joined: Mon Mar 22, 2010 11:38 pm

Re: External storage

Post by racelife »

Thanks bbunge and snake!

After some reading and before your replies I did try to chown but was unsuccessful. After some more research I figured out that Vfat wouldn't let me change the owner so I reformatted the drive to ext4 and it works great! That wiki section from snake was perfect.

I added the storage to the purge filter and now I just will wait for it to fill up :D
Post Reply