You have reached the blog of Keith Elder. Thank you for visiting! Feel free to click the twitter icon to the right and follow me on twitter.

Setting up Ext3 Journaling File System on Linux

Posted by Keith Elder | Posted in Linux, Open Source, PC Software, Programming | Posted on 30-11-2001

Ok all of you Linux geeks. Get out your pencils because I am about to tell you how to get rid of those 30 minute fscks when Linux crashes, the power goes out, or someone presses your reset button just for laughs. The following outlines how to setup the Ext3 journaling file system on your already installed Linux. It is short and really isn’t all that hard to follow.

The Kernel

First thing is first. Unless you are lucky enough have installed a recent distribution (like RH 7.2) you are more than likely going to have to recompile your kernel. There are plently of docs how to recompile so I am not going to waste my breath. First off, go and grab the latest kernel from ftp.eecs.umich.edu. As of this writing the latest kernel is 2.4.16 which has reiserfs and Ext3 support built in. When you do compile the kernel, in the “File System” section be sure to include Ext3 support (I know it is obvious but you know, some people….).

After the compile

After you have installed the new kernel and everything seems to checkout ok you will want to create a journal on each of the file systems you wish to run Ext3 on. This is accomplished by the following:

tune2fs -j /dev/hd?? (where ?? equals your hard drive letter and partition number, ie /dev/hda3)

After you have created the journal, you need to edit your /etc/fstab so it knows to use the Ext3 file system on these partitions. I recommend changing the file system on each of the ext2 partitions from “ext2” to “auto”. Setting it to auto will allow Linux to detect which support you have and default to it. It is somewhat a safe feature if you ever need to boot an older kernel or something like that (although I was still able to boot in my testing with it set to Ext3 and no Ext3 support in the kernel).

Once you make your changes to /etc/fstab, you have created your journal, and you are running an Ext3 friendly kernel, reboot. Upon reboot, type the “mount” command and make sure it mounted your partitions as Ext3. If so, hit the reset button and watch fsck take about 2 seconds to scan your drive. Anyone using a laptop should stop what you are doing and get to compiling!

Write a comment