Version: 2004-10-14 (see history)
cd /usr/src wget ftp://ftp.*.kernel.org/pub/linux/kernel/v2.2/linux-2.2.20.tar.bz2 wget ftp://ftp.*.kernel.org/pub/linux/kernel/people/sct/ext3/ext3-0.0.7a.tar.bz2 rm -rf linux tar -xjvf linux-2.2.20.tar.bz2 tar -xjvf ext3-0.0.7a.tar.bz2 cd linux cat ../ext3-0.0.7a/linux-2.2.19.kdb.diff | patch -sp1 cat ../ext3-0.0.7a/linux-2.2.19.ext3.diff | patch -sp1
You will get a failed hunk in the main Makefile because of a mismatch in the kernel sublevel version. You can ignore it safely.
After this you must configure your kernel with make [menu]config and set CONFIG_EXPERIMENTAL=y. Then you can set CONFIG_EXT3_FS=y and build a new kernel.
You also need a recent (at least version 1.25) e2fsprogs package with ext3 support, which you can download from ftp://download.sourceforge.net/pub/sourceforge/e2fsprogs/.
tune2fs -j /dev/hdaXThis can be done on an unmounted or on a mounted filesystem. If you create the journal on a mounted filesystem you will see a .journal file. Don't try to delete this and don't back this up or restore it from backup! If you run tune2fs -j on an unmounted partition an unvisible journal file will be created.
mount -t ext3 /dev/hdaX /mnt/somewhere
In order to ensure that ext3 can safely resume an unlink after a
crash, it actually zeros out the block pointers in the inode, whereas
ext2 just marks these blocks as unused in the block bitmaps and marks
the inode as "deleted" and leaves the block pointers alone.
Your only hope is to "grep" for parts of your files that have been deleted
and hope for the best.
Q: 'df' command says partition is full, while 'du' reports free space
Theodore Ts'o, the ext2 developer, said:
The standard cause for this is some user process keeping a deleted file open. When this happens, the space is not visible via 'du', since the file is no longer visible in the directory tree. However, the space is still used by the file until it is deallocated, and that can only happen once the last process which has the file open either closes its file descriptor to the file, or the process exits. You can use the lsof program to try to find which process is keeping an open file. Usually it's some log file, or some large data base file which gets rotated out, but some older process are still keeping the log file open.
(This part was initally suggested by Boris Wesslowski; major overhaul by Theodore Ts'o)
If you have ext2 compiled into the kernel and ext3 as a module and your root filesystem is ext2/3, then the kernel will always mount the root fs as ext2 and not as ext3 since at the time when the root filesystem is mounted, the kernel does not have access to the modules, since they are located on the root filesystem. (This is a chicken and egg problem!)tune2fs -O ^has_journal /dev/hdaXTo be on the safe side you should force a fsck run on this partition afterwards:
fsck.ext2 -f /dev/hdaXAfter this procedure you can safely delete the .journal file if there was any.
Theodore Ts'o said:
It's best to just always run e2fsck. [...]
E2fsck will run the journal automatically,
and if the filesystem is otherwise clean, it skip doing a full filesystem
check.
If the filesystem is not clean (because during the previous run the
kernel noticed some filesystem inconsistencies), e2fsck will
automatically do a full check if it is necessary.
If you have multiple disks,
fsck will run multiple e2fsck processes in parallel, thus speeding up your boot
sequence than if you let the kernel replay the journal for each filesystem when
it tries to mount it, since then the journal replays will be done sequentially,
instead of in parallel.
inspired by Andreas Dilger, suggested by Christian Kujau:
Ext3 can support files up to 1TB. With a 2.4 kernel the filesystem size is limited by the maximal block device size, which is 2TB. In 2.6 the maximum (32-bit CPU) limit is of block devices is 16TB, but ext3 supports only up to 4TB.
mount /dev/hdaX /mnt -o journal=updateto convert your old (ext3 v0.0.3* and earlier) filesystem to the new journal format.
That's fine. The EXT3-fs message is just telling you it mounted the fs OK. It's also telling you what form of journaling you are using.
ext3 has 2 formats of journal:
The CHANGES file in the distribution says this:
New mount options: "mount -o journal=update" Mounts a filesystem with a Version 1 journal, upgrading the journal dynamically to Version 2. "mount -o data=journal" Journals all data and metadata, so data is written twice. This is the mode which all prior versions of ext3 used. "mount -o data=ordered" Only journals metadata changes, but data updates are flushed to disk before any transactions commit. Data writes are not atomic but this mode still guarantees that after a crash, files will never contain stale data blocks from old files. "mount -o data=writeback" Only journals metadata changes, and data updates are entirely left to the normal "sync" process. After a crash, files will may contain stale data blocks from old files: this mode is exactly equivalent to running ext2 with a very fast fsck on reboot. Ordered and Writeback data modes require a Version 2 journal: if you do not update the journal format then only the Journaled data will be allowed. The default data mode is Journaled for a V1 journal, and Ordered for V2.For more information also see RedHat's release notes from their 7.2 release.
2004-10-14 - added new point about max file(system) size - added new point about running fsck both suggested by Christian Kujau 2003-04-09 - added new point about df/du; suggested by Theodore Ts'o 2003-01-24 - added new item about undeletion 2002-07-23 - enhanced 'using ext3 as a module' [thanks for the contributions!] 2002-04-02 - added new point about using ext3 as a module 2002-03-04 - added history ;) - minor corrections - added a link to the RedHat 7.2 release notes