LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-18-2014, 04:35 AM   #1
jwiggins
LQ Newbie
 
Registered: Jul 2014
Posts: 3

Rep: Reputation: Disabled
How to avoid corrupt drives if power outage is a huge issue?


I'm trying to setup a linux router system in Africa where power loss is not just a problem but a way of life. I have access to an old pentium 3 box with a 80GB hard drive but do to the location (middle of the Seringetti) access is VERY limited and we have no room nor permission to use a UPS due to potential chemical leakage from batteries. Because the power can go at any moment without any warning, I was wanting to possibly mount the file systems ro. I've looked into squashfs but that doesn't seem to like non-flash/SDD drives (if I'm wrong please correct me) so my question is, what file systems can i safely mount ro or can I get away with maybe using a ramdrive? Any help would be greatly appreciated.
 
Old 07-18-2014, 07:27 AM   #2
wpeckham
Senior Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,648

Rep: Reputation: 568Reputation: 568Reputation: 568Reputation: 568Reputation: 568Reputation: 568
router

1. I have seen devices using the microcore image (cd image) mounted RO or on RO media used. Something like TinyCore (based upon MICROCORE but with a gui desktop, help, and a few desktop application pieces) might be an option.
2. If you go with writable media, there is always a window for corruption. Use a journalized file system (ext3 or ext4 should help).
3. ANY (as far as I know) file system Linux recognizes can be mounted RO. Problem, linux uses tables and semiphore files to track state. A distribution specifically designed to do that entirely in memory and to assume RO media would be optimal.

Thus: I would look for a live-cd router image that you can customize for your environment, but that is already suitable in its basic operation and designed for running in memory. You might try Devil linux, Alpine, or Fli4l.

Best would be something that loads from media, but does not mount media and runs entirely in memory to help prevent opportunities for corruption. How easy that will be to find for your device depends upon what memory you have to work with. Second best would be a slightly custom version of TinyCore, or perhaps puppy.

Bottom line, this is doable. I have seen it done on machines entirely lacking a hard drive, running from CD or floppy.
 
1 members found this post helpful.
Old 07-18-2014, 01:19 PM   #3
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 937

Rep: Reputation: 174Reputation: 174
In the daytime you could use solar power as a power source on a micro sized device...
 
Old 07-18-2014, 01:33 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Or you could run your drive off of a RAID card with a BBU. When power to the system drops, the BBU keeps the RAID card running long enough to flush the cache to the drive.
 
Old 07-18-2014, 03:02 PM   #5
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 810

Rep: Reputation: 264Reputation: 264Reputation: 264
This is all just speculation, and I don't even know if it's possible, but here goes...

If you need to be able to write to the disk to save some stuff, maybe have 2 identical partitions. Have one mounted as RW. Every now and then, remount it RO. Then mount the second partition RW. Copy over the changed files (rsync, maybe?), then unmount the second partition. Finally, remount the first partition RO.
That way, while the first partition is vulnerable, the second one isn't even mounted, so it's safe. When you remount the first partition RO and mount the second partition RW, the first one is protected from corruption.

Like I said, I don't even know if it is possible to set up something like this, but it's an idea I had and I thought it had the potential to be useful.

I would also agree that you should use a journaled file system.

Hope this helps!
 
Old 07-18-2014, 10:35 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
Depends on what you need this system for to begin with.

A squashfs (or other compressed read only format) will work fine on any media. Ramdrive is a good way to run on older systems. Puppy and other can either by default load to ram or with boot option. You would need a lot of ram and I doubt this has it.

A normal system can protect it's filesystem by means of a journal usually. You are still limited on this system for too many odd choices.
 
  


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
Power off USB storage device/port to avoid power consumption johndir Linux - Hardware 4 11-15-2011 06:04 PM
[solved] Hardware issue (?) after power outage, "Kernel panic [...]" help_please Linux - Hardware 1 07-30-2011 03:20 AM
power outage blackmamba11 Linux - Server 1 12-03-2007 12:51 PM
power outage jbzy3000 Linux - General 2 02-24-2005 10:11 PM
Power Outage notslim General 30 08-28-2003 04:47 AM


All times are GMT -5. The time now is 02:56 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration