power outage safe zoneminder

Support and queries relating to all previous versions of ZoneMinder
henke
Posts: 60
Joined: Thu Nov 10, 2005 8:16 am

power outage safe zoneminder

Post by henke »

Hi,

What is the best way to make zoneminder power outage safe? I know that the customer is going to have power outages and i will go crazy if i have to go there and run fsck or similar everytime.

I thought about two alternatives:

1.
using the live-cd and just recording to hd, this way the risk of corruption would be smaller. But I have had really lots of trouble getting it to work properly.

2.
Making a hd-read only, except events and mysql.


Anyone with similar struggles?
linuxsense
Posts: 374
Joined: Wed Nov 07, 2007 1:59 am
Location: Huntington Beach, California
Contact:

Post by linuxsense »

With a journaling filesystem like ext3 you should really not have any issues.

edit: If you are really worried about power failures just run a large UPS and have the server shutdown gracefully when it gets to the last few minutes of power. Then the only time any disk checks will need to be done will be once they hit the maximum mount count, which you can inflate to such a ridiculous number that it will never run, but I would not really advise that since it would be a rare occasion for fsck to require input from a check like that on a healthy system. Decent UPS, journaled FS, your good.
henke
Posts: 60
Joined: Thu Nov 10, 2005 8:16 am

Post by henke »

I use ext3 but even that needs to run e2fsck to fix things sometimes.

ups is out of budget. how do all these embedded things work?
agoodm
Posts: 52
Joined: Tue Oct 09, 2007 12:16 pm

Post by agoodm »

When the power here failed our Zoneminder box booted back up OK. But I noticed it complaining in message log that it had to recover the journal from a backup.

When the HDD failed and the machine crashed the FS no longer worked, along with the HDD :-P
linuxsense
Posts: 374
Joined: Wed Nov 07, 2007 1:59 am
Location: Huntington Beach, California
Contact:

Post by linuxsense »

henke wrote:I use ext3 but even that needs to run e2fsck to fix things sometimes.
Yes, but very rarely. I admin over 100 large Linux boxes and I almost never need to run fsck by hand.

henke wrote: ups is out of budget. how do all these embedded things work?
Hmm. Well, frankly, if they cant spend $100 for a UPS then they are just out of luck then ;-) Its foolish to run any important system without a UPS especially if you are worried about FS corruption from power failures.
User avatar
ammaross
Posts: 61
Joined: Mon Mar 12, 2007 8:34 pm
Location: Utah, USA

Post by ammaross »

And of course, you'd probably like your cameras to continue running for a time during a power outage as well. We have our ZM box on a nice 1500 VA UPS and our PoE cameras split over a couple 800s. Gives us some good running time even after the power goes out.
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp »

I have several boxes with random reboots. (Many more Ubuntu desktops) I have had very few fsck's on reboot. However, the events table gets corrupt all the time. A small UPS can be had for $40. If they can not afford that, how can they afford you?
henke
Posts: 60
Joined: Thu Nov 10, 2005 8:16 am

Post by henke »

Tnx, have to check up this UPS. My info seems to be from the dinosaur-age when they were at least some 1000 USD.

I thought about fixing the mysql-table thing with adding to nightly cron:
mysqcheck -r --all-databases

Then it would fix it within a day from power up again and it would reduce maintenance-visits.
linuxsense
Posts: 374
Joined: Wed Nov 07, 2007 1:59 am
Location: Huntington Beach, California
Contact:

Post by linuxsense »

henke wrote:Tnx, have to check up this UPS. My info seems to be from the dinosaur-age when they were at least some 1000 USD.
Nah...these days you can get surprisingly good UPS' for under $100. Even those little APC powerstrip/UPS combos that you can get for close to $50 work pretty well, just make sure you get one that can communicate with Linux so it can tell the system to shutdown. I always go with APC so I can use apcupsd, see here for supported UPS':

http://www.apcupsd.org/manual/Supported ... ables.html
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I second all the comments about UPSs. I currently use Belkin ones, such as this one, http://catalog.belkin.com/IWCatProductP ... _Id=153777. I tend to use Belkin as I know I can get it working with Linux even if the software is a little prehistoric looking to administer. I have never taken the plunge and tried the APC ones as I wasn't sure how well they integrated with Linux (better the devil you know kind of situation). I may try one next time though.

I would also stress that you run deep battery tests on your UPS regularly. I just replaced a set of batteries on one of the Belkin boxes (though they aren't supposed to be consumer replaceable) as the batteries had gone almost totally dead even though the monitor and LEDs etc all said they were good. I got about 2 seconds of uptime on them! They can go off quicker than you imagine especially if they stay topped up all the time and never get drained.
Phil
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

Phil
If your using NP type Yuasa batteries in your UPS (most do) then a deep discahrge cycle will damage them. NP series are designed for non cyclic standby use, ie they are ideal for ups lol. We use a lot of them in intruder alarm panels. Assuming you rarly use them, ie very very few power fails then you may get 3 yrs out of them. I doubt it and we usually replace batteries in UPS as part of the 12 month maint.

James
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Shows how much I know then :roll:

The point still stands that you need to check your UPS pretty often or the batteries may actually be shot and be of no use just when you might need them (trying to salvage some credibility :lol:).
Phil
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

lol agreed (on the middle bit not the end lol)
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Post by lazyleopard »

Yeah, I have one UPS which shows full battery until the power goes. It does seem to have just enough left in it to keep the system powered long enough for an immediate shutdown. Trouble is, I'd not have discovered that without a power-off test...

It'd be good to get a new battery... if they were still available... :/
Rick Hewett
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

you should be able to put any battery in. Stick with a good brand. Yuasa aint as good as they were but still one of the best imho. What size is the one you have? (capacity not physical?)
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Locked