Enabling linux ext3 full data journal mode
Results 1 to 9 of 9

Thread: Enabling linux ext3 full data journal mode

  1. #1
    Member
    Join Date
    Feb 2002
    Posts
    84

    Question Enabling linux ext3 full data journal mode

    I was wondering if anyone could help me with the following problem.

    For a project I'm building some kind of failsafe linux system which users can
    switch off with the power button (no monitor attached). Because the system
    must be failsafe I'm using a journaling file system (ext3) (in case of a power failure
    or someone who accidentally disconnects the power plug).

    As far as I know ext3 is using ordered mode by default so it only journals
    metadata. Because I want a failsafe system it's better to use full data journaling
    (data=journal).

    I've searched almost a whole day on google and tried several options but it
    still doesn't work.

    On several sites I see that I have to add the following flag to my bootloader

    Code:
    rootflags=data=journal
    and add this to my fstab:

    Code:
    data=journal
    - If I don't add the rootflags then the system is getting read/write errors because the filesystem is read only.
    - If I don't add the line to my fstab but only the line in my bootloader then the system gets a kernel panic.
    - If I add both lines the system also gets a kernel panic.

    System info: linux box (mandrake 10.1) kernel 2.6.8.1 with lilo as boot loader, kernel support
    for ext3 filesystems (compiled in kernel itself and not as a module).

    Who can help me to enable full data journaling?
    [shadow]OpenGL rules the game[/shadow]http://www.AntiOnline.com/sig.php?imageid=499

  2. #2
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    If I don't add the rootflags then the system is getting read/write errors because the filesystem is read only.
    If the filesystem is read-only, why enable journaling?
    If the filesystem is read-only it cannot get corrupted? (except during a harddisk failure)

    Not sure if linux uses the same scheme but on BSD I would..

    mount / and /usr read-only, mount /tmp on a memory disk and /usr/home and /var on a journaling system. /home (/usr/home) and /var should be the only filesystems that change (during normal operations) and are important enough to save. It shouldn't matter if /tmp gets nuked..
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  3. #3
    Member
    Join Date
    Feb 2002
    Posts
    84
    @SirDice

    Sorry I forgot to mention that readonly is the error message I get. I want the
    root filesystem to be read/write but when I set one of these options then the
    system complains that it can't write to the disk because it's mounted ro.

  4. #4
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    odd... What does a mount tell you when you get that message? Is it really mounted read-only?
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  5. #5
    Member
    Join Date
    Feb 2002
    Posts
    84
    Tomorrow I will look what the error messages are and I shall post the boot.log
    and the exact settings I made.

    By the way I'm still looking on the internet but there's not very much I can find
    about this problem.
    [shadow]OpenGL rules the game[/shadow]http://www.AntiOnline.com/sig.php?imageid=499

  6. #6
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    I'm not a linux user, so I'm not sure about certain options, but I found these in a couple of minutes:
    http://www-128.ibm.com/developerwork...one=opensource
    http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  7. #7
    Senior Member
    Join Date
    Sep 2005
    Posts
    221
    reiser4 performs 'atomic' operations; in other words, data cannot get corrupted through a power-off during transfer.
    On the other hand, I don't know how much sits in swap before the transfer is done. It is not in the kernel yet though it's easy enough to patch it; and I've never had a problem with reiser4 getting corrupted (and I have had some unclean shutdowns).
    Definitions: Hacker vs. Cracker
    Gentoo Linux user, which probably says a lot about me..
    AGA member 14460 || KGS : Trevoke and games archived

  8. #8
    Member
    Join Date
    Feb 2002
    Posts
    84
    Small update:

    @SirDice thanks but I've already read those two links ;-)

    A few days ago I posted that I should upload the logfiles. Because the filesystem is in read
    only mode (god knows why) the logfiles cannot be updated.

    I know that the system first mounts the filesystem in ro mode but the it should switch to
    rw mode which is not happening at my system when I turn full journaling on. Anyway
    I'm still searching for a solution, when I find it I'll post it here.
    [shadow]OpenGL rules the game[/shadow]http://www.AntiOnline.com/sig.php?imageid=499

  9. #9
    Member
    Join Date
    Feb 2002
    Posts
    84
    I solved the problem,

    First use tune2fs to turn full journaling on on the desired partition:

    Code:
    tune2fs -o +journal_data /dev/hdaX
    then change the /etc/fstab file, add the following line in the option field of the desired partition:

    Code:
    data=journal
    Reboot and check the journaling mode with:

    Code:
    tune2fs -l /dev/hdaX
    it should display the journaling mode with a lot of other info.
    [shadow]OpenGL rules the game[/shadow]http://www.AntiOnline.com/sig.php?imageid=499

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •