Page 1 of 1

Change EVENTS and IMAGES folder location into a shared folder

Posted: Wed Sep 28, 2016 10:25 am
by yogui
Dear all,

After reading many articles looking for a way for recording IP cameras, I've found Zoneminder looks awesome. So I've just set up a computer with W10 and a virtual machine (HyperV) with Ubuntu server and Zoneminder.

Why like this? One program I need to use is just for Windows, and feel more comfortable (easier for me) do most of the things with Windows and the VM just for the Zoneminder service.

So, my idea is to put in a HDD the VM and the recorded files (folders events and images) outside the virtual driver. I don't want to manage a huge 500GB virtual driver, it's easier to backup a 15GB file.

The steps I already did:
- Install Ubuntu Server 16.04 LTS with LAMP => Following the Installation Guide: https://zoneminder.readthedocs.io/en/st ... untu-16-04 (so it's the latest update)
- Create a user in Windows for the shared folder. Set permissions (shared and NTFS) for that user.
- Mount the windows shared folder, following: https://help.ubuntu.com/community/Mount ... ermanently

Until here, everything is fine. With my user and with root, I can create and delete files in the mount folder /mnt/DATA/

After that, I followed this guide to change Zoneminder events and images location: https://wiki.zoneminder.com/Using_a_ded ... Hard_Drive
(I didn't put "/dev/sdX1 /newdrive ext3 defaults 0 2", is it necessary? I don't think so because it's not a drive, is a shared folder...)

Actually, my fstab file is with these extra lines:

Code: Select all

	//192.168.1.10/GLaDOS /mnt/DATA cifs iocharset=utf8,credentials=/home/jordi/.sm$

	/mnt/DATA/images /var/cache/zoneminder/images none defaults,bind  0 2
	/mnt/DATA/events /var/cache/zoneminder/events none defaults,bind 0 2
But after that, the log continues giving me this:

Code: Select all

- 2016-09-28 12:04:40.656596	web_php		1249	ERR	Cannot write to content dirs('events','images'). Check that these exist and are owned by the web account user	/usr/share/zoneminder/www/index.php	147
The folders are not owned by www-data. I tried to change it with chown but looks like it's not working, (without giving any message error).

Code: Select all

	jordi@GLaDOS:/mnt/DATA$ ls -lh
	total 0
	drwxr-xr-x 2 jordi root 0 Sep 22 23:28 DATA
	drwxr-xr-x 2 jordi root 0 Sep 23 15:51 events
	drwxr-xr-x 2 jordi root 0 Sep 22 16:38 images
I've read it's due to NTFS permissions from the Windows folder, and followed this: http://linuxnewbieguide.org/?p=687 to fix it. I made the group called "ntfs" and added www-data but still the same. I don't know if I'm following the guide right, because it's again with a whole drive instead of a shared folder and I don't know if there is a difference.

Any one can help me on this? Don't know what else to do :(


Many thanks in advanced, have a nice day!

Re: Change EVENTS and IMAGES folder location into a shared folder

Posted: Wed Sep 28, 2016 12:23 pm
by knight-of-ni
You can't use a Microsoft NTFS filesystem to store your events, or for that matter any other filesystem which does not natively support Unix style symbolic links.

Re: Change EVENTS and IMAGES folder location into a shared folder

Posted: Wed Sep 28, 2016 6:29 pm
by mikb
... and in addition to not supporting Symbolic Links, as you may have gathered, it doesn't understand user-group ownership permissions. So you can't chown ownership to apache.apache, www-data etc. -- also you can't get fine detail control of chmod settings like rwx rw- r-- for user-group-other

These things can be fudged at mount time with options, but tend to affect everything under the mount point, and are a fiddle :(

Re: Change EVENTS and IMAGES folder location into a shared folder

Posted: Tue Oct 04, 2016 1:52 pm
by yogui
Dear all,

Thanks a lot for the answers. It's a pity that you can't use this (take note developers! a simple way to change destination folders...! :roll: )

At the end, and to whom it may concern, I created a new virtual disk of 400GB and added to the virtual machine. Mounted (following this guide: https://help.ubuntu.com/community/Insta ... wHardDrive ) and after that, to change de default location for the events and images, the zoneminder guide: https://wiki.zoneminder.com/Using_a_ded ... Hard_Drive . The bonus would be to install and set up a SAMBA, but for the moment I don't need it.

Now looks like it works! Yes, looks like because I haven't been able to make my IP cameras work... Still working on it, will ask for help if I can't find the answer in the forum :cry:.

Re: Change EVENTS and IMAGES folder location into a shared folder

Posted: Tue Oct 04, 2016 4:46 pm
by bbunge
The most up to date install procedures are at: https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

Re: Change EVENTS and IMAGES folder location into a shared folder

Posted: Tue Oct 04, 2016 5:35 pm
by mikb
yogui wrote:It's a pity that you can't use this (take note developers! a simple way to change destination folders...! :roll: )
You can move the images/events around just fine. I did within short order of installing ZM (and didn't even really follow the guides, I just put a symbolic link to shift the rather large events directory to a new home! -- from /home/zoneminder/events to /mnt/somewhere-else/cctv/zoneminder/events)

But, if you choose to use an inadequate, underspecified filing system such as NTFS, then there's little the ZM developers can do to help you :)

NTFS and FAT32 have many limitations, being as they are older and designed for the single user, small-filed, security-free free-for-all that is Windows and DOS.