LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-06-2007, 05:43 AM   #1
knobby67
Member
 
Registered: Mar 2006
Posts: 530

Rep: Reputation: 42
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.
 
Old 02-06-2007, 07:32 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,988
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
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.
 
Old 02-06-2007, 07:38 AM   #3
knobby67
Member
 
Registered: Mar 2006
Posts: 530

Original Poster
Rep: Reputation: 42
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?
 
Old 02-06-2007, 02:23 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,988
Blog Entries: 54

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems after power fail SUSE 10.1 Ragodin Suse/Novell 2 11-09-2006 02:49 AM
fail-safe update prog, how much is the file system a problem? Thinking Programming 4 02-24-2006 05:18 AM
System is not detecting the two NIC's simultaneously b0nd Linux - Networking 4 10-12-2005 02:40 AM
system is not detecting modem b0nd Linux - Newbie 3 09-26-2005 11:38 AM
Enabling power save/power management/cpu freq scaling features for a Debian system zero79 Debian 0 12-19-2004 01:17 PM


All times are GMT -5. The time now is 12:13 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration