Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 07-18-2014, 03:35 AM   #1
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, 06:27 AM   #2
Senior Member
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 2,290

Rep: Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919

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, 12:19 PM   #3
Senior Member
Registered: Nov 2011
Distribution: Debian
Posts: 1,158

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

Rep: Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104Reputation: 2104
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, 02:02 PM   #5
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 813

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, 09:35 PM   #6
Registered: Mar 2008
Posts: 16,863

Rep: Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487
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.


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 05:04 PM
[solved] Hardware issue (?) after power outage, "Kernel panic [...]" help_please Linux - Hardware 1 07-30-2011 02:20 AM
power outage blackmamba11 Linux - Server 1 12-03-2007 11:51 AM
power outage jbzy3000 Linux - General 2 02-24-2005 09:11 PM
Power Outage notslim General 30 08-28-2003 03:47 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:21 AM.

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