Events no longer being created since linking to NAS

Forum for questions and support relating to the 1.26.x releases only.
Locked
helpme1986
Posts: 8
Joined: Sat Feb 08, 2014 10:47 am

Events no longer being created since linking to NAS

Post by helpme1986 »

Pulling my hair out the last 6 hours trying to figure out how to move events and images to my NAS

Been followinging this guide: http://www.zoneminder.com/wiki/index.ph ... Hard_Drive

Its rather confusing and it seems to change the way it wants to do it half way down and changes the example drive from /newdrive to /otherdrive part way through (well i think anyway, could be why im going wrong)

My fstab looks like this:

Code: Select all

//192.168.1.3/CCTV-1 /mnt/CCTV cifs defaults,username=admin,password=password 0 2
/mnt/CCTV/events /var/cache/zoneminder/events non defaults,bind 0 2
/mnt/CCTV/images /var/cache/zoneminder/images non defaults,bind 0 2
/mnt/CCTV/events /usr/share/zoneminder/events non defaults,bind 0 2
/mnt/CCTV/images /usr/share/zoneminder/events non defaults,bind 0 2
this appears to work as when i go to /usr/share/zoneminder/events and mkdir i can see it on my NAS but when i start the zoneminder service no new events are created (and old ones still exist, i was expecting them to disappear as i didnt copy old ones over)

Ive also noticed that when Stopping Zoneminder (/etc/init.d/zoneminder stop) i get this error

Code: Select all

rm: cannot remove '/var/lock/zm': Operation not permitted
then when i start it i get

Code: Select all

Starting Zoneminder: Chown: Changing ownership of 'var/run/zm': operation not permitted
chown: changing ownership of '/tmp/zm': operation not permitted
success

touch: cannot touch 'var/lock/zm': permission denied

Does this make sense to anyone? I havent changed anything else (that I can think of... was a fresh install yesterday)
helpme1986
Posts: 8
Joined: Sat Feb 08, 2014 10:47 am

Re: Events no longer being created since linking to NAS

Post by helpme1986 »

Got a step closer,

added the uid of www-data to the mount to make it the owner and events are being logged however no images,

got this in the log:
2014-02-08 14:40:01.178272 zmc_dvideo0 1352 WAR Last image read from shared memory 3 seconds ago, zma may have gone away zm_monitor.cpp 2761
2014-02-08 14:40:01.160349 zmc_dvideo0 1352 WAR Buffer overrun at index 28, image 12388, slow down capture, speed up analysis or increase ring buffer size zm_monitor.cpp 2755
2014-02-08 14:39:58.887703 zmc_m2 1366 INF BabyRoom: 6000 - Capturing at 8.40 fps zm_monitor.cpp 2783
2014-02-08 14:39:58.695120 zmdc 1328 ERR 'zma -m 1' exited abnormally, exit status 255 zmdc.pl
2014-02-08 14:39:58.666784 zma_m1 1704 FAT Can't symlink events/1/14/02/08/.22 -> events/1/14/02/08/14/39/57: Operation not supported zm_event.cpp 133
Think this is the main issue: (renamed everything to eventsn/imagesn to see if new folders would help...)

Can't symlink eventsn/1/14/02/08/.10 -> eventsn/1/14/02/08/15/01/11: Operation not supported zm_event.cpp 133
mikb
Posts: 661
Joined: Mon Mar 25, 2013 12:34 pm

Re: Events no longer being created since linking to NAS

Post by mikb »

helpme1986 wrote:Can't symlink eventsn/1/14/02/08/.10 -> eventsn/1/14/02/08/15/01/11: Operation not supported zm_event.cpp 133
Vague worry here about a CIFS/Samba (with underlying FAT filesystem, no doubt) combined with very VERY optimistic attempt to use symbolic links ... I don't think that works.

Let's try ...

Code: Select all

root@perkin:/mnt/nas02/Public# touch a-file
root@perkin:/mnt/nas02/Public# ls
a-file
root@perkin:/mnt/nas02/Public# ln -s a-file linky-file       
ln: failed to create symbolic link `linky-file': Operation not supported
Ah. No. That's not going to work, someone may be able to suggest a way to keep the symlinks for the camera "friendly names" to "number-names" out of the NAS, but keep the event ON the NAS.

I'm thinking -- keeping your "events" directory OFF the NAS (on a linux file system), and maybe mounting the next nodes down.

Code: Select all

//192.168.1.3/CCTV-1 /mnt/CCTV cifs defaults,username=admin,password=password 0 2
/mnt/CCTV/events/1 /var/cache/zoneminder/events/1 non defaults,bind 0 2
/mnt/CCTV/events/2 /var/cache/zoneminder/events/2 non defaults,bind 0 2
/mnt/CCTV/events/3 /var/cache/zoneminder/events/3 non defaults,bind 0 2
/mnt/CCTV/events/4 /var/cache/zoneminder/events/4 non defaults,bind 0 2
etc...

But if it's going to start doing symlinks deeper down into the directory structure, that's not going to help either.

Also, some NAS drives (landrives and clones) are incredibly good at corrupting your filenames and directories, you can end up with a directory with multiple entries, all the same name, yet all different content. Multiple copies of "." and "..". How crazy is that?

I had to add some extra options to knock that off, "nounix,noperm,noserverino" -- had endless BS dealing with permissions not working correctly (first two options) and duplicated file entries (third option).

Just watch out for that :)
helpme1986
Posts: 8
Joined: Sat Feb 08, 2014 10:47 am

Re: Events no longer being created since linking to NAS

Post by helpme1986 »

Cheers,

I ended up starting all over again and justing NFS instead, working great now but i cant see the folders/files written by Zoneminder other than from zoneminder itself (e.g. from windows explorer)

I know its there because i cant create a new folder with the same name
helpme1986
Posts: 8
Joined: Sat Feb 08, 2014 10:47 am

Re: Events no longer being created since linking to NAS

Post by helpme1986 »

Well I thought it was working but the percentage is totally wrong and looks like its still writing locally.

Not getting any errors, ive created a folder on the NAS and can see it when navigating to /var/cache/zoneminder in linux....

Any ideas?
mikb
Posts: 661
Joined: Mon Mar 25, 2013 12:34 pm

Re: Events no longer being created since linking to NAS

Post by mikb »

Saw your post in the other thread ...

I see you have a smarter NAS than I thought then, if it provides NFS access it probably has a linux-friendly file system underneath, none of this FAT32 nonsense, so you should be better off now.

I was worrying/assuming that you had a cheaper one, like mine, that is FAT only, and CIFS/SMB only, which limits doing clever stuff like that.
Locked