ZM and Ubuntu 18.04: External Hard Drive Folder can't be accessed after time

Forum for questions and support relating to the 1.31.x releases only.
Locked
LennyM
Posts: 2
Joined: Thu May 17, 2018 8:09 pm

ZM and Ubuntu 18.04: External Hard Drive Folder can't be accessed after time

Post by LennyM »

Hello,

I have updated to Ubuntu 18.04 and configured zoneminder to run, based on the scripts of zoneminder wiki.
The recording content is being stored on an external hard drive - and now the problems begin since updating.

The hard drive is mounted as followed:

Code: Select all

# WD Easystore 2tb external USB 3.0
/dev/sdb1 /external ntfs defaults 0 2
/external/zoneminder/images /var/cache/zoneminder/images none defaults,bind 0 2
/external/zoneminder/events /var/cache/zoneminder/events none defaults,bind 0 2
The recording and playback of recordings work perfectly for a few minutes after booting. But after a while the symlinked folder (/var/cache/zoneminder/events) can't be accessed anymore

Error:

Code: Select all

/var/cache/zoneminder/events# ls
ls: reading directory '.': Input/output error
Does anybody know why the folder can't be accessed anymore after a while?

Best regards
Lenny
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: ZM and Ubuntu 18.04: External Hard Drive Folder can't be accessed after time

Post by bbunge »

You cannot use ntfs to store events.
Format the drive with EXT4 and mount it with systemd. See the WIKI for instructions.
LennyM
Posts: 2
Joined: Thu May 17, 2018 8:09 pm

Re: ZM and Ubuntu 18.04: External Hard Drive Folder can't be accessed after time

Post by LennyM »

Hm.

It worked with ubuntu 17 perfectly and with ububtu 18 it runs well for a couple of hours. Why is that?
mikb
Posts: 604
Joined: Mon Mar 25, 2013 12:34 pm

Re: ZM and Ubuntu 18.04: External Hard Drive Folder can't be accessed after time

Post by mikb »

"ls: reading directory '.': Input/output error"

Never mind the usual caution to avoid NTFS/DOS/FAT partitions (as they don't work for ZoneMinder -- they don't support symbolic links), I worry about the hardware you are using given the error you quote.

The upgrade to Ubuntu may be a coincidence.

Please check the SMART parameters of this external drive, and make sure it's not dying quietly -- you could have a sick drive, or a power supply that is quietly going out of spec. I had the latter, which caused the former, and ended up having to replace the drive through not realising quick enough that it was spinning down due to power fluctuations!
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: ZM and Ubuntu 18.04: External Hard Drive Folder can't be accessed after time

Post by bbunge »

I set up one of my test zm installs on Bionic with a USB2 NTFS external drive mounted with systemd per the instructions on the WIKI. After two reboots and four hours of operation it is still writing events to the USB drive. The permissions for the events and images directories are root:root 777 while normally they are www-data:www-data 755. Will keep this going for a while and may have to eat crow over ntfs...
juanmoura
Posts: 91
Joined: Fri Nov 24, 2017 11:46 am

Re: ZM and Ubuntu 18.04: External Hard Drive Folder can't be accessed after time

Post by juanmoura »

Change in the fstab of / dev / sd * to UUID, in my I solved so. For example:

UUID=sad01720sa0j0192093709sad /storage_4tb ext4 defaults 0 0

To find out the UUID use the command

sudo blkid
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: ZM and Ubuntu 18.04: External Hard Drive Folder can't be accessed after time

Post by bbunge »

juanmoura wrote: Fri May 18, 2018 6:41 pm Change in the fstab of / dev / sd * to UUID, in my I solved so. For example:

UUID=sad01720sa0j0192093709sad /storage_4tb ext4 defaults 0 0

To find out the UUID use the command

sudo blkid
Recommend you switch to systemd mount. And the OP is using NTFS not EXT4
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: ZM and Ubuntu 18.04: External Hard Drive Folder can't be accessed after time

Post by bbunge »

Quick Update...
My short test showed that an external drive with NTFS will work with Zoneminder...sometimes. About 98% of the events detected wrote images.folders to the USB drive formatted with NTFS. The other 2% for some reason were listed as New Event and never completed but I was able to delete the events with no ill effect to the system. I also tried to connected to a NTFS drive on a NAS but was not successful and gave up trying as I had other things to work on.

Conclusion: While NTFS may work the chances that it will, in time, cause issues is great and the recommendation to use Linux based file system still stands.

bb

Edit: I revisited my attempt to connect to a NAS, my router, with a USB external drive formatted to NTFS and was successful. I had to tell my Ubuntu PC to connect with SMB version 1 (version 1 is ignored by default) by adding vers=1 in the options string. Will let this run for a while to see what happens but I expect the same results as an attached drive.
Locked