= Converting an ext3 filesystem to ext4 =
It is possible to mount both ext3 (and ext2, in kernels 2.6.28 and later) filesystems directly using the ext4 filesystem driver. This will allow you to use many of the in-core performance enhancements such as delayed allocation (delalloc) and multi-block allocation (mballoc), and large inodes if your ext3 filesystem have been formatted with large inodes as is the default with newer versions of e2fsprogs. Simply mounting an ext3 (or ext2) filesystem with a modern (2.6.27+) version of ext4 will not change the on-disk structures, and it is possible to revert to the ext3 (or ext2) driver should there be any problem with ext4. If you plan to use the ext4 driver to boot from an ext2/3 partition, and you compile your kernel without the ext2/3 drivers, you may need to add rootfstype=ext4 to the
kernel command line.
In addition to the in-core performance enhancements, there are additional features which modify the on-disk format from what ext3 understands, such as extents, which can significantly improve the ext4 filesystem performance, but mean the filesystem cannot be mounted by kernels that do not support ext4. There are additional ext4 features, such as flex_bg and > 16TB filesystem support that can only be enabled at format time via mke2fs.
To change an ext2 filesystem (should you still have one) to ext3 (enabling the journal feature), use the command:
# tune2fs -j /dev/DEV
To enable the ext4 features on an existing ext3 filesystem, use the command:
# tune2fs -O extents,uninit_bg,dir_index /dev/DEV
WARNING: Once you run this command, the filesystem will no longer be mountable using the ext3 filesystem!
After running this command (specifically, after setting the uninit_bg parameter), you MUST run fsck to fix up some on-disk structures that tune2fs has modified:
# e2fsck -fDC0 /dev/DEV
Notes:
* Running fsck will complain about "One or more block group descriptor checksums are invalid" - this is [http://marc.info/?l=linux-ext4&m=125834107118172&w=2 expected] and one of the reasons why tune2fs requests to fsck.
* by enabling the '''extents''' feature new files will be created in extents format, but this will not convert existing files to use extents. Non-extent files can be transparently read and written by Ext4.
* If you convert your root filesystem ("/") to ext4, and you use the GRUB boot loader, you will need to install a version of GRUB which understands ext4. Your system may boot OK the first time, but when your kernel is upgraded, it will become unbootable.
* If you do the conversion for the root fs on a live system you'll have to reboot for fsck to run safely. You might also need to add ''rootfstype=ext4'' to the kernel's command line so the partition is not mounted as ext3.
* '''WARNING''': It is NOT recommended to resize the inodes using resize2fs with e2fsprogs 1.41.0 or later, as this is known to corrupt some filesystems.
* If you omit "uninit_bg" on the tunefs command, you can skip the fsck step.
| Attribute(s): | Public | |||
| Created: | 02.02.2012 11:50 | Total Views: | 335 | |
| Last Changed: | 05.04.2013 12:52 | Total Changes: | 1 |
Δt = 0.036377906799316s