LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   detecting a power fail and best file system for this. (http://www.linuxquestions.org/questions/programming-9/detecting-a-power-fail-and-best-file-system-for-this-526019/)

knobby67 02-06-2007 05:43 AM

detecting a power fail and best file system for this.
 
Hi all,
I'm wondering if anyone knows if there is a method (in Linux C) to detect a power turn off. Basically I'm running an embedded system and would like on power fail to stop hard-drive / Compact Flash writes and start shutdown. But have no idea how to do this without custom Hardware.

While I'm on the subject can anyone recommend what file system to use, as some people seem to recommend EXT3 others ReiserFS.
However some one has just recommended a Transactional rather than the above Journaling systems. But I'm unsure if Debian has one of these to select? Can anyone advise.

Thanks in advance.

unSpawn 02-06-2007 07:32 AM

There's a huge difference between turning off power and a power failure. ACPI, power button, could be one way to detect powering off. If your product has a battery you can detect a drain. If you haven't then only "early warning" capabilities of an external UPS/RPS can help to signal a power failure, I think.
I mean, it kinda sounds like common sense non-Vulcan logic to me.

knobby67 02-06-2007 07:38 AM

Quote:

Originally Posted by unSpawn
There's a huge difference between turning off power and a power failure. ACPI, power button, could be one way to detect powering off. If your product has a battery you can detect a drain. If you haven't then only "early warning" capabilities of an external UPS/RPS can help to signal a power failure, I think.
I mean, it kinda sounds like common sense non-Vulcan logic to me.

Hi thanks for that, yes it would be a power fail, the system has no power on off button, people would just pull the mains out. I did consider a UPS. But hoped a PC board might have a power fail circuit, many micro controller boards in the past did.

Could anyone advise on the EXT3, ReiserFS or Transactional file system?

unSpawn 02-06-2007 02:23 PM

Could anyone advise on the EXT3, ReiserFS or Transactional file system?
Since you didn't already I'd say post your requirements first.


All times are GMT -5. The time now is 10:22 PM.