LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 03: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, 06:27 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,623

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
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, 12:19 PM   #3
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
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
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Rep: Reputation: 265Reputation: 265Reputation: 265
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
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:31 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
Open Source Consulting | Domain Registration