Creating an Ext3 File System
- Enable ext3 support in kernel configuration (Option is in filesystems). The module must be part of the kernel if the / file system is to be converted
to ext3. Patch your kernel if you don't have the latest kernel (2.4.18 as of this writing) (The ext3 option has been
available in the stable kernel source since version 2.4.15, but always use the latest kernel sources).
- You will then have to compile your kernel if you made changes.
- Get latest version of e2fsprogs from http://e2fsprogs.sourceforge.net/. Opens in
a new window; you will need version 1.25 or later. These are updated tools that are most likely already installed on your system and will be
used to make the journaling filesystem, so they are necessary.
Next are the steps to install the e2fsprogs tools.
- Make a build directory and enter it
# mkdir build; cd build
- Run the configure script
- Compile the programs
- Test that the programs built correctly
# make check
- Install the binaries
# make install
- Install the include files and libraries (Optional, they are only needed if you expect to develop other programs using the libraries
or if you want to compile other program using these libraries.)
# make install-libs
- You can convert an existing ext2fs to ext3 by using the following command to create a journal on it. (The disk may be mounted)
[XX will be the device and partition (e.g. a8 == disk 0 partition 8)]
# mke2fs -j /dev/hdXX
- Add an entry to the /etc/fstab file like the following:
/dev/hda8 /d2 ext3 defaults 1 1
- Unmount the filesystem and remount it as an ext3 file system
# umount /d2
# mount /d2
- To make new ext3 filesystems use the following command:
[Again, XX will be the device and partition (e.g. a8 == disk 0 partition 8)]
# mke2fs -j /dev/hdXX
- To mount an ext3 filesystem as ext2 use the following command on a damaged ext3 filesystem to repair it and allow it to be mounted as ext2.
# e2fsck -fy /dev/hdXX
- The filesystem will still run fsck on the 180th day or 20th mount (whichever occurs first). To change this default behavior use:
# tune2fs -i 0 -c 0 /dev/hdxx
to disable this behavior. To check your filesystems with fsck manually, create a file called /forcefsck and reboot the system.
# touch /forcefsck
After the system has rebooted and run fsck on the file systems, you should delete this file to avoid running fsck everytime.
# rm /forcefsck
*This page contains notes I took while creating an ext3 file system; if you need more information, just do a
search on google for ext3.