[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Advice about ext3, please (An experiment & results)



On 2009-03-09_11:19:38, Stefan Monnier wrote:
> > Does anyone here power off their computer without first shutting it down?
> > Maybe, but after having to spend time repairing the system and/or rebuilding
> > it or losing data they most likely don't anymore.
> 
> Even if you're careful, you'll still occasionally lose power, and your
> machine will still occasionally crash.  That's why people have developed
> file systems that can withstand even such situations (using journalling
> or a log structure).
> 
> > Neither ext2 nor ext3 were designed to be used in this manor.
> 
> ext3 was specifically designed for these situations.
> 

I did an experiment. I was worried particularly about an accidental
unplugging of USB before umount. What happens when you pull the plug
is that the kernel issues an alert on all functioning consoles and
terminal emulators to the effect journaling has failed. It is hard,
very hard to be unaware that you, the operator, have made a mistake.

The message doesn't -tell- you what to do, but what I think one should
do is plug in the USB drive again and do fsck on the device. When fsck
runs, in immediately reruns the journal and fixes metadata
inconsistencies. What it may not do is actually write data that was
waiting in some buffer. (fsck has a option to force a full check even
if the fast, incomplete check using the journal indicates that things
are fixed. I did this, and fsck found no detailed errors either.)

In an archiving application, which is what I am interested in, the
data is a stable record that has been prepared for archiving, so
rerunning the archiving software fixes any incomplete writes. With less
robust file systems, the file system can become corrupted to the point
that it must be reformatted. That would be really not good.

The computer did have to be re-booted before the fsck. the kernel behaved
as it a journal error was equivalent to a kerneloops. So pulling the plug
accidentally is a fairly big deal in a situation where 100% up-time is
required, But, again there are ways to design around this, like having
the USB drive connected to a computer that is dedicated to archiving, and
is expected to go down from time to time due to operator error.

I haven't looked into power failure during archiving, but I reason that
this is not a problem -for- -archiving-. The record that has been prepared
for archive is not being modified when the power fails, so there is little
chance that it will be damaged. The file system on the USB maybe damaged,
but, with the journal, can be fixed before it is remounted to resume the
archiving process. So I conclude ext3 is good for archiving.

-- 
Paul E Condon           
pecondon@mesanetworks.net


Reply to: