Page 1 of 2
power outage safe zoneminder
Posted: Thu Nov 15, 2007 1:43 am
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?
Posted: Thu Nov 15, 2007 3:47 am
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.
Posted: Thu Nov 15, 2007 9:41 am
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?
Posted: Thu Nov 15, 2007 3:18 pm
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
Posted: Thu Nov 15, 2007 7:28 pm
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.
Posted: Thu Nov 15, 2007 8:02 pm
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.
Posted: Fri Nov 16, 2007 4:52 am
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?
Posted: Fri Nov 16, 2007 9:11 am
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.
Posted: Sat Nov 17, 2007 1:37 am
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
Posted: Sun Nov 18, 2007 12:48 pm
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.
Posted: Sun Nov 18, 2007 2:54 pm
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
Posted: Mon Nov 19, 2007 12:17 pm
by zoneminder
Shows how much I know then
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
).
Posted: Mon Nov 19, 2007 8:06 pm
by jameswilson
lol agreed (on the middle bit not the end lol)
Posted: Tue Nov 20, 2007 5:57 pm
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... :/
Posted: Tue Nov 20, 2007 6:05 pm
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?)