The tune2fs program can add a journal to an existing ext2 file system without altering the data already on the partition.

If the file system is already mounted while it is being transitioned, the journal will be visible as the file .journal in the root directory of the file system. If the file system is not mounted, the journal will be hidden and will not appear in the file system at all. To convert an ext2 file system on the first partition of the disk /dev/sdb to ext3, log in as root and type:

[[email protected]] /sbin/tune2fs -j /dev/sdb1
[[email protected]] mount -o remount /dev/sdb1

Obviously, you will need to change this to match the filesystem you want to change. You can find out the device name for a partition, and check whether its using ext2 or ext3 by looking in /etc/mtab.

After you have converted the filesystem, be certain to change the partition type from ext2 to ext3 in /etc/fstab. If you forget to do this, the filesystem should still mount, but will still be in the backward compatible Ext2 mode.

If you are transitioning your root file system, you will probably also have to update your initrd image in order to boot with your new ext3 filesystem. To create this, you can use the mkinitrd program.

[[email protected]] mkinitrd -f /boot/initrd-($uname -r).img $(uname -r)

mkinitrd should automatically sense (using lsmod) that you are now using ext3, and insert the relevant modules into the initrd ram disk image for you. Again, if you fail to update the initrd ram disk image, the system should still boot, but the root file system will be mounted as ext2 instead of ext3. As before, you can check the status by viewing /etc/mtab.