Skip to contentSkip to conversation

Question on Reiser4 regarding power failures

DISCUSSION Bernhard Prell 3 participants 3 messages Nov 25, 2004

lore
Share & tools
lore
#0 lore raw

Hello everybody,

I have a simple question about Reiser4. I already tried to find the answer in
http://www.namesys.com/v4/v4.html but I'm not completly sure if I understood everything :-)

*Background:
I 'm administrating about 20 computers. The installed Linux/Reiser is quite
old: SuSE Linux with kernel 2.4.7(SMP) (dmesg tells me reiser 3.5.x disk format, ReiserFS version 3.6.25).

Obviously people often pull the plug without cleanly shutting down the systems, because maybe twice per month I have to setup a system again because it doesn't want to boot anymore. The reason is always a somehow corrupted root-filesystem. Sometimes reiserfsck can repair it, sometimes not because of I/O-read-errors. If that's the case I also have a look at the disk with "smartctl -t short /dev/hda" and it also reports read-errors. Then I usually do a "dd if=/dev/zero of=/dev/hda", repartition, reformat, setup the system from a tar file and everything is fine again (smartctl doesn't report read-errors anymore).

*Now my question, you may have guessed it:
Will the corruption caused by partially written sectors or other problems caused by _power failures_ be still a problem under reiser4 or are they gone forever because of the "atomic transactions" (at least in theory)? (That would mean that reiserfsck is only existing to repair problems caused by bugs in reiser4...)

Sorry if this has been asked before, I tried to find an answer in the list-archive.

Thanks in advance

Bernhard

#1 lore raw

On Thu, 2004-11-25 at 16:37 +0100, Bernhard Prell wrote:

[snip]

Quoted 5 lines

*Background:
I 'm administrating about 20 computers. The installed Linux/Reiser is quite
old: SuSE Linux with kernel 2.4.7(SMP) (dmesg tells me reiser 3.5.x disk format, ReiserFS version 3.6.25).

Quoted 9 lines

Obviously people often pull the plug without cleanly shutting down the systems, because maybe twice per month I have to setup a system again because it doesn't want to boot anymore. The reason is always a somehow corrupted root-filesystem. Sometimes reiserfsck can repair it, sometimes not because of I/O-read-errors. If that's the case I also have a look at the disk with "smartctl -t short /dev/hda" and it also reports read-errors. Then I usually do a "dd if=/dev/zero of=/dev/hda", repartition, reformat, setup the system from a tar file and everything is fine again (smartctl doesn't report read-errors anymore).

[snip]

I can't comment on reiser4's characteristics but thought you might be interested in my experiences. I ran a busy server using reiserfs for over two years, from around the days of kernel 2.4.18. During that time, there were several occasions on which power was lost (I had no UPS at that time) and on no occasion did I experience filesystem corruption of that kind, nor did I have to go through any special recovery procedures to get things up and running again.

For this reason, and because I believe that the stability of reiserfs was improved drastically in later revisions of the 2.4 kernel, I would urge that you consider using a modern 2.4 kernel and the latest reiserfs tools if possible!

Another factor is the type of journalling mode that is used. Later in 2.6, options were made available to select the journalling mode (see
http://www.namesys.com/mount-options.html) which reflect the hitherto more flexible ext3 options. By mounting with data=journal, one can ensure to a reasonable extent the integrity of both data and metadata, probably at some expense in performance. Personally I never had any problems with data=ordered which is the default.

I don't know what the situation is in 2.4 these days, but I am assuming that this work was never backported i.e. only metadata is journalled. However, even if that is the case I would still suggest that it is much more robust in later kernels (both 2.4 and 2.6).

Regards,

--Kerin Francis Millar

#2 lore raw
In reply to Bernhard Prell
Quoted 3 lines · Bernhard Prell

Hello everybody,

I have a simple question about Reiser4. I already tried to find the answer

in

Quoted 10 lines

http://www.namesys.com/v4/v4.html but I'm not completly sure if I understood everything :-)

*Background:
I 'm administrating about 20 computers. The installed Linux/Reiser is quite
old: SuSE Linux with kernel 2.4.7(SMP) (dmesg tells me reiser 3.5.x disk format, ReiserFS version 3.6.25).

Obviously people often pull the plug without cleanly shutting down the systems, because maybe twice per month I have to setup a system again

because

Quoted 2 lines

it doesn't want to boot anymore. The reason is always a somehow corrupted root-filesystem. Sometimes reiserfsck can repair it, sometimes not because

of

Quoted 11 lines

I/O-read-errors. If that's the case I also have a look at the disk with "smartctl -t short /dev/hda" and it also reports read-errors. Then I usually do a "dd if=/dev/zero of=/dev/hda", repartition, reformat, setup the system from a tar file and everything is fine again (smartctl doesn't report read-errors anymore).

*Now my question, you may have guessed it:
Will the corruption caused by partially written sectors or other problems caused by _power failures_ be still a problem under reiser4 or are they gone forever because of the "atomic transactions" (at least in theory)? (That would mean that reiserfsck is only existing to repair problems caused

by

Quoted 4 lines

bugs in reiser4...)

Sorry if this has been asked before, I tried to find an answer in the list-archive.

I'd suggest to do the following for pull the plug scenarios on productive systems with reiserfs:

1) Disable write caching for ide drives with "hdparm -W 0 /dev/hdX" This is the most important thing to do.
2) Always try to use the newest version of reiserfsck. The older, the more bugs.
3) Convert your filesystem to the newer 3.6 disk format using the "conv" mount option once. The 3.5 disk format is very old and has some limitations.
4) If you want to prevent data corruption and not just filesystem corruption, use a recent 2.6.x kernel which incoporates Chris Mason's data logging patches.
Alternatively you could use a newer SuSE which has the data logging patches in the 2.4 kernel series, too. Maybe the installation of a a newer 2.4.x kernel rpm from ftp.suse.com will work for you.

As reiser4 is atomic in it's operations it should protect your data even more than ext3/reiserfs with the data=journal mount option, unless you don't have write cache for ide drives enabled. Reiser4 is still beta.

Since 2.6.9 the write barrier patches are in the kernel. These should protect better from data loss with disks that have write caching enabled. The only two filesystems supporting write barrier are ext3 with the mount option "barrier=1" and reiserfs with the mount option "barrier=flush".

Signature · 1 line
lg, Chris