[Bglug] Data safety on a server

2006-12-07 15:00

Hash: SHA1

I recently read up on the journalled filesystems for Linux and
discovered that ext3 has a journalling mode that is extremely
protective. It's called journalled data mode. The default journal
mode for ext3 is ordered data mode, which means that metadata is
written to the journal before being committed to the filesystem, and
then only after the data has successfully been written.

JFS and XFS use a less conservative mode in which the metadata is
written to the journal and then the filesystem, but before the data is
written (so the metadata is always in a consistent state, but may be
wrong (e.g. you may think you own inodes that never got written with
real data)). ReiserFS, IIRC uses ordered data mode.

Journalled data mode, on the other hand, writes both metadata and data
to the journal before committing either to the filesystem, so you not
only always have consistent metadata, but you don't lose any data
that's made it to the journal, even in the event of power outage before
either one or both of the data and metadata are committed. The
downside is that data gets written twice, once to the journal, and once
to the filesystem.

So, on my server I am now using journalled data mode (data=journal as
an option in the fstab). Getting the root filesystem to use journalled
data mode is a bit tricky, because you can remount with different
settings, you have to get your system to mount with the data=journal
option at boot time. In debian sarge that means passing a
rootflags=data=journal kernel commandline parameter in the grub config
file (/boot/grub/menu.lst)


- --
GnuPG Key Fingerprint 86 F5 81 A5 D4 2E 1F 1C http://gnupg.org
And that's my crabbing done for the day. Got it out of the way early,
now I have the rest of the afternoon to sniff fragrant tea-roses or
strangle cute bunnies or something. -- Michael Devore
Version: GnuPG v1.4.5 (GNU/Linux)