Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Ubuntu running on a computer that is going to be part of a public exhibition. The problem is that the power is shut down each night and restarted in the morning.

My question is what I can do to limit the damage this will do to the system? Is it possible to write protect the system hard drive? Can I somehow restore the system from a secondary hard drive on every reboot? Any suggestions?

share|improve this question
Can't you use a (remastered) Live CD then? – Lekensteyn Jun 9 '11 at 7:27
Do you know approximately what time it will be shut down each night? Is there a regular schedule for which the power will be cut? – Christopher Kyle Horton Jun 9 '11 at 7:28
Would using a UPS be an option? Then it can automatically initiate a shutdown when power is cut. – Nathan Osman Jun 9 '11 at 7:41
Thank you, those are all really good suggestions! I think that I will look into using a Live CD and maybe run it without any hard drive at all. – David Karlsson Jun 9 '11 at 8:04

I would advice to shut down your system before they turn the power off. It is easily done automatically from within Ubuntu.

sudo crontab -e

add to the bottom:

0 22 * * * /sbin/shutdown -h now

And your system shuts down at 22:00 (of course change the 22 to an appropriate time for you).

Booting the system automatically depends on your current hardware: your system might support Wake On Lan (WOL). That way you can reboot it remotely.

share|improve this answer
The problem is that I don't know for sure when they are going to power it off. It might be later some days of the week etc. – David Karlsson Jun 9 '11 at 8:07
Sorry I misinterpreted your question (I assumed 'each' would suggest a specific time but I guess I was wrong ;) ) – Rinzwind Jun 9 '11 at 8:29
I would 2nd Georges' comment: try to get a UPS if you use a desktop. If you have a notebook my suggestion will still work: power management will let you shutdown autom. when on battery and it gets critical! – Rinzwind Jun 9 '11 at 8:30

Problem: Hard Drive

The main problem is, that on a sudden powerdown some changes might be made to the hard drive, that are not welcome (e.g. an important write operation is interrupted or the read head hits the disk). So the main problems with a poweroutage is the disk.

Software solution: "Frozen system"

Once I read about a "frozen system" that was loaded form hdd into ram. Then the hdd was unmounted. This way the hdd will not get damaged by a power outage. The downside is, that no changes that are made to the ram booted system will persist.

I tried to find the article about that, but was out of luck so far. If this sounds like a solution for you, let us know. Maybe we can do something similar from scratch.

Hardware solution

There are also hardware solutions to the problem. A battery based system, that stores just enough power for the computer to shut down properly. There are commercial solutions for this available that cost about 200$. If you are well versed in electronics this could be build quietly cheaply using a few old car batteries, a battery charger, a few relays, a micro controller chip and a few other couple-o'cent-components.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.