https://ext4.wiki.kernel.org/api.php?action=feedcontributions&user=Diegocg&feedformat=atomExt4 - User contributions [en]2024-03-29T12:39:38ZUser contributionsMediaWiki 1.19.24https://ext4.wiki.kernel.org/index.php/Ext4_HowtoExt4 Howto2009-03-24T19:40:58Z<p>Diegocg: </p>
<hr />
<div>= General Information =<br />
<br />
Ext4 was released as a functionally complete and stable filesystem in Linux 2.6.28, and it's getting included in all the modern distros (in some cases as the default fs), so if you are using a modern distro, it's possible that you already have Ext4 support and you don't need to modify your system to run Ext4.<br />
<br />
<br />
It's safe to use it in production environments, but as any piece of software, it has bugs (which are more likely to be hit in the first stable versions). Any known critical bug will be quickly fixed. If you find one, you can contact the Ext4 developers at the [http://vger.kernel.org/vger-lists.html#linux-ext4 ext4 mailing list]. They sometimes also can be found on [[IRC]].<br />
<br />
= Getting Ext4 code =<br />
<br />
== For people who build their own kernel ==<br />
<br />
1. Start with a 2.6.28 or later kernel. It is highly recommended that you apply the latest [http://www.kernel.org/pub/linux/kernel/people/tytso/ext4-patches/ patchset] (if available) to get the latest bug fixes. In your kernel's <tt>.config</tt> file, enable <tt>EXT4_FS</tt> (along with <tt>EXT4_FS_XATTR</tt> and <tt>EXT4_FS_POSIX_ACL</tt> if you like).<br />
<br />
2. Compile the latest version of e2fsprogs (as of this writing 1.41.4) from [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs kernel.org] or from [http://sourceforge.net/project/showfiles.php?group_id=2406 Sourceforge]. Note that it is highly important to install the mke2fs.conf file that comes with the e2fsprogs 1.41.x sources in /etc/mke2fs.conf. If you have edited the /etc/mke2fs.conf file, you will need to merge your changes with the version from e2fsprogs 1.41.x.<br />
<br />
== For people who are running Fedora ==<br />
<br />
Fedora 10 currently has a kernel based on 2.6.27 that has working ext4 support. It is missing some of the latest fixes and performance optimizations. A 2.6.28 kernel update should be available reasonably soon, with more up-to-date ext4 code.<br />
<br />
Fedora 10 has all of the basic infrastructure needed to be able to run ext4, including updated udev, blkid, and other bits needed for ext4 to be a transparently recognized filesystem.<br />
<br />
e2fsprogs-1.41.0 is currently in the [http://fedoraproject.org/wiki/Testing#Fedora_Proposed_Updates Fedora 9 updates-testing repository], and users wishing to utilize ext4 should use this version of e2fsprogs, or later.<br />
<br />
== For people running RHEL ==<br />
<br />
ext4 is currently included as a Technology Preview in RHEL 5.3. To use it, update to 5.3, boot into 2.6.18-128.el5 or higher, and yum install e4fsprogs.<br />
<br />
== For people who are running Ubuntu ==<br />
<br />
For people who are running Ubuntu, it is *highly* recommended that you download a set of modified util-linux packages and install them. Packages for Ubuntu Hardy are available [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/ubuntu-fixed-util-linux here]. These packages revert a [http://changelogs.ubuntu.com/changelogs/pool/main/u/util-linux/util-linux_2.12r-19ubuntu1/changelog change made by Ubuntu] to use the volid library instead of the blkid library. The volid library has a number of shortcomings, including that they don't work on freshly created filesystems or swap devices until after you reboot (since it is tied to udev probing) and the volid library doesn't understand ext4dev filesystems. The blkid library is much better, and Debian uses the blkid library for util-linux. Unfortunately, Ubuntu chose to make this reason for some unknown reason. For other versions of Ubuntu, the patch that was applied can be found [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/ubuntu-fixed-util-linux/util-linux-patch here].<br />
'''Update''': From 9 January [http://cdimage.ubuntu.com/daily/current/ daily builds] of Jaunty will include ext4 as a partitioning option. As far as I can tell, it installs and boots fine (including full ext4 /; you don't need a separate /boot). [http://ubuntuforums.org/showthread.php?p=6520952&posted=1#post6520952 Here] is the announcement, It will be included in 9.04 and maybe it will be by default option in 9.10 [http://brainstorm.ubuntu.com/idea/16854/]<br />
<br />
== For people who are running Debian ==<br />
<br />
In Debian Lenny (Testing), the following current packages provide ext4 support:<br />
* ext4dev module in the linux-image package (2.6.26-10)<br />
* e2fsprogs (1.41.3-1)<br />
<br />
It should be noted that the stock 2.6.26 ext4 has problems with delayed allocation and with filesystems with non-extent based files. So until Debian starts shipping a 2.6.27 based kernel or a 2.6.26 kernel with at least the 2.6.26-ext4-7 patchset, you should mount ext4dev filesystems using -o nodelalloc and only use freshly created filesystems using "mke2fs -t ext4dev". (Without these fixes, if you try to use an ext3 filesystem which was converted using '''tune2fs -E test_fs -o extents /dev/DEV''', you will probably hit a kernel '''BUG''' the moment you try to delete or truncate an old non-extent based file.)<br />
<br />
== For people who are running Ark Linux ==<br />
Ark Linux dockyard-devel has ext4 support, including ext4 support during installation. grub is also patched to boot from ext4 /boot partitions.<br />
To install an Ark Linux system with ext4 as main filesystem, get the dockyard-devel image (or, once released, any 2009.x release), and type "fs=ext4" at the CD boot prompt to override the default setting.<br />
Depending the outcome of (pending) performance tests, fs=ext4 may be made the default for 2009.1.<br />
<br />
If you're on the stable branch, install the kernel, kernel-filesystem-ext4 and e2fsprogs packages from dockyard-devel.<br />
<br />
= Creating ext4 filesystems =<br />
<br />
Creating a new ext4 filesystem is very easy once you have upgraded to e2fsprogs 1.41 or later. Simply type:<br />
<br />
{{cmdroot|mke2fs -t ext4 /dev/''DEV''}}<br />
<br />
or <br />
<br />
{{cmdroot|mkfs.ext4 /dev/''DEV''}}<br />
<br />
Once the filesystem is created, it can be mounted as follows:<br />
<br />
{{cmdroot|mount -t ext4 /dev/''DEV'' /wherever}}<br />
<br />
If you have a sufficiently new system, the "-t ext4" should not be needed.<br />
<br />
NOTE: Although very large fileystems are on ext4's feature list, current e2fsprogs currently still limits the filesystem size to 2^32 blocks (16T for a 4k block filesystem). Filesystems larger than 16T is one of the very next high-priority features to complete for ext4.<br />
<br />
= Booting from an ext4 filesystem =<br />
<br />
Right now there's not a stable version of grub that supports booting a kernel from a ext4 partition. It's recommended that you keep /boot in a ext3 partition.<br />
<br />
Preliminary ext4 support seems to have been [http://svn.savannah.gnu.org/viewvc?view=rev&root=grub&revision=1699 added] to the 1.97 version of the GRUB2 development branch.<br />
<br />
There's also a Google Summer of Code [http://code.google.com/soc/2008/suse/appinfo.html?csaid=91DC4C762E7EE6D7 project] (from opensuse) which seem to have [http://code.google.com/p/grub4ext4/ developed] ext4 grub support. Both projects -GRUB2 and the GSoC projects- seem (sadly) to be different efforts.<br />
<br />
= Converting an ext3 filesystem to ext4 =<br />
<br />
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.<br />
<br />
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.<br />
<br />
To change an ext2 filesystem (should you still have one) to ext3 (enabling the journal feature), use the command:<br />
<br />
{{cmdroot|tune2fs -j /dev/''DEV''}}<br />
<br />
To enable the ext4 features on an existing ext3 filesystem, use the command:<br />
<br />
{{cmdroot|tune2fs -O extents,uninit_bg,dir_index /dev/''DEV''}}<br />
<br />
WARNING: Once you run this command, the filesystem will no longer be mountable using the ext3 filesystem!<br />
<br />
After running this command, you MUST run fsck to fix up some on-disk structures that tune2fs has modified:<br />
<br />
{{cmdroot|e2fsck -fD /dev/''DEV''}}<br />
<br />
NOTE: 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.<br />
<br />
WARNING: It is NOT recommended to resize the inodes using <tt>resize2fs</tt> with e2fsprogs 1.41.0 or later, as this is known to corrupt some filesystems.</div>Diegocghttps://ext4.wiki.kernel.org/index.php/Ext4:News_ContentsExt4:News Contents2009-01-23T19:25:34Z<p>Diegocg: Remove news more than 6 months old, as requested</p>
<hr />
<div>2009-01-22: Fedora 11 [http://www.heise-online.co.uk/news/Ext4-to-be-standard-for-Fedora-11-Btrfs-also-included--/112467 will use] Ext4 as the default filesystem. Ext4 will also be available optionally [http://arstechnica.com/journals/linux.ars/2009/01/12/super-fast-ext4-filesystem-arrives-in-ubuntu-9-04 in Ubuntu 9.04], [http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Release_Notes/sect-Release_Notes-Technology_Previews.html Red Hat 5.3], [http://wiki.mandriva.com/en/2009.1_Alpha_2#ext4_file_system Mandriva 2009.1] and others.<br />
<br />
2008-12-24: [http://lkml.org/lkml/2008/12/24/105 Linux 2.6.28] was released, including the first stable version of Ext4.<br />
<br />
2008-10-13: [http://prdownloads.sourceforge.net/e2fsprogs/e2fsprogs-1.41.3.tar.gz e2fsprogs version 1.41.3] has been released.<br />
<br />
2008-09-01: [http://prdownloads.sourceforge.net/e2fsprogs/e2fsprogs-1.41.1.tar.gz e2fsprogs version 1.41.1] has been released.<br />
<br />
2008-08-20: The [http://www.kernel.org/pub/linux/kernel/people/tytso/ext4-patches/2.6.26-ext4-7 2.6.26-ext4-7] patchset has been released. People who are using ext4 wih 2.6.26 should really take this patch.</div>Diegocghttps://ext4.wiki.kernel.org/index.php/Ext4:Old_News_ContentsExt4:Old News Contents2009-01-23T19:25:16Z<p>Diegocg: Old news</p>
<hr />
<div>2008-07-15: Delayed allocation has been merged into Linus's ext4 git tree! We have started maintaining patches against the latest 2.6 mainline kernel for make it easier for people to try out ext4.<br />
<br />
2008-07-14: The [[Ext4 Howto]] page has been updated so it is fully up to date with how to get started using ext4.<br />
<br />
2008-07-10: [http://e2fsprogs.sf.net E2fsprogs] version 1.41.0 was released, with full ext4 support<br />
<br />
2008-04-13: Fedora Core 9 has been released with [http://fedoraproject.org/wiki/Features/Ext4 ext4 preview support].</div>Diegocghttps://ext4.wiki.kernel.org/index.php/Ext4:News_ContentsExt4:News Contents2009-01-23T19:08:26Z<p>Diegocg: Add some news...</p>
<hr />
<div>2009-01-22: Fedora 11 [http://www.heise-online.co.uk/news/Ext4-to-be-standard-for-Fedora-11-Btrfs-also-included--/112467 will use] Ext4 as the default filesystem. Ext4 will also be available optionally [http://arstechnica.com/journals/linux.ars/2009/01/12/super-fast-ext4-filesystem-arrives-in-ubuntu-9-04 in Ubuntu 9.04], [http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Release_Notes/sect-Release_Notes-Technology_Previews.html Red Hat 5.3], [http://wiki.mandriva.com/en/2009.1_Alpha_2#ext4_file_system Mandriva 2009.1] and others.<br />
<br />
2008-12-24: [http://lkml.org/lkml/2008/12/24/105 Linux 2.6.28] was released, including the first stable version of Ext4.<br />
<br />
2008-10-13: [http://prdownloads.sourceforge.net/e2fsprogs/e2fsprogs-1.41.3.tar.gz e2fsprogs version 1.41.3] has been released.<br />
<br />
2008-09-01: [http://prdownloads.sourceforge.net/e2fsprogs/e2fsprogs-1.41.1.tar.gz e2fsprogs version 1.41.1] has been released.<br />
<br />
2008-08-20: The [http://www.kernel.org/pub/linux/kernel/people/tytso/ext4-patches/2.6.26-ext4-7 2.6.26-ext4-7] patchset has been released. People who are using ext4 wih 2.6.26 should really take this patch.<br />
<br />
2008-07-15: Delayed allocation has been merged into Linus's ext4 git tree! We have started maintaining patches against the latest 2.6 mainline kernel for make it easier for people to try out ext4.<br />
<br />
2008-07-14: The [[Ext4 Howto]] page has been updated so it is fully up to date with how to get started using ext4.<br />
<br />
2008-07-10: [http://e2fsprogs.sf.net E2fsprogs] version 1.41.0 was released, with full ext4 support<br />
<br />
2008-04-13: Fedora Core 9 has been released with [http://fedoraproject.org/wiki/Features/Ext4 ext4 preview support].</div>Diegocghttps://ext4.wiki.kernel.org/index.php/New_ext4_featuresNew ext4 features2009-01-08T00:08:09Z<p>Diegocg: Warn that the page is oudated...</p>
<hr />
<div>{{WARN| This page is outdated. For details about the Ext4 features, you can [http://kernelnewbies.org/Ext4 read this article]}} <br />
<br />
<br />
=== Multiblock Allocation ===<br />
<br />
* Primary developer: Alex Tomas<br />
* Status: Patches available - ready to push to mainline<br />
* Changes on-disk format: No<br />
* Target Date: ?<br />
* e2fsprogs changes: No<br />
* outstanding issues: None<br />
<br />
=== Delayed Allocation ===<br />
<br />
* Primary developer: Alex Tomas<br />
* Status: Patches in unstable patch series<br />
* Changes on-disk format: No<br />
* Target Date: (in patch queue)<br />
* e2fsprogs changes: No<br />
* outstanding issues: handling 1k,2k block size and default data=order mode, ENOSPC handling<br />
<br />
=== Break 32000 subdirectory limit ===<br />
<br />
* Primary developer: Andreas<br />
* Status: Done<br />
* Changes on-disk format: Yes<br />
* Target Date: (in patch queue)<br />
* e2fsprogs changes: done<br />
* outstanding issues: None<br />
<br />
=== directory Inodes reservation ===<br />
<br />
* Primary developer: Coly<br />
* Status: Patch available<br />
* Changes on-disk format: No<br />
* Target Date: Nov, 2007<br />
* e2fsprogs changes: Needed<br />
* outstanding issues: <br />
<br />
=== nsec timestamps ===<br />
<br />
* Primary developer: Andreas<br />
* Status: Done<br />
* Change on-disk format: Yes<br />
* Target Date: (in patch queue)<br />
* e2fsprogs changes: Done<br />
* outstanding issues:<br />
<br />
=== inode version on disk ===<br />
<br />
* Primary developer: Jean-Noel Cordenner, Kalpak Shah<br />
* Status: Done<br />
* Change on-disk format: Yes<br />
* Target Date: (in patch queue)<br />
* e2fsprogs changes: None<br />
* outstanding issues: None<br />
<br />
=== uninitialized groups ===<br />
<br />
* Primary developer: Andreas Dilger<br />
* Status: Done<br />
* Change on-disk format: Yes<br />
* Target Date: (in patch queue)<br />
* e2fsprogs changes: Done<br />
* outstanding issues: lazy zeroing of unused inode table blocks after filesystem is first mounted<br />
<br />
=== journal checksumming ===<br />
<br />
* Primary developer: Andreas<br />
* Status: Prototype available<br />
* Change on-disk format: Yes<br />
* Target Date: (in patch queue)<br />
* e2fsprogs changes: Needed<br />
* outstanding issues:<br />
<br />
=== persistent preallocation ===<br />
<br />
* Primary developer: Amit Arora, Suparna<br />
* Status: Done<br />
* Change on-disk format: Yes<br />
* Target Date: (in patch queue)<br />
* e2fsprogs changes: complete<br />
* outstanding issues:<br />
<br />
=== Online Defragmentation ===<br />
<br />
* Primary developer: Takashi Sato<br />
* Status:<br />
latest patch: v0.2 posted on Jan 10th.<br />
Previous tries:<br />
http://marc.theaimsgroup.com/?l=linux-ext4&m=116678507906760&w=2<br />
http://marc.theaimsgroup.com/?l=linux-ext4&m=116307062907075&w=2<br />
* Related discussions<br />
ext3 online defrag:<br />
http://marc.theaimsgroup.com/?l=linux-fsdevel&m=116160640814410&w=2<br />
* Dependencies: Multiple block allocation from Alex Thomas<br />
* Change on-disk format: No<br />
* Target Date: <br />
* e2fsprogs changes: No<br />
* outstanding issues: <br />
<br />
=== Undelete Feature for Ext4 ===<br />
<br />
* Primary Developer: <br />
* status: Idea was proposed on the mailing list, still need more thought on the feature.<br />
* Change on-disk format:<br />
* Target Date:<br />
* e2fsprogs changes:<br />
* outstanding issues: Should the kernel be involved with undelete<br />
<br />
=== Large file support ===<br />
<br />
* Primary Developer: Takashi Sato<br />
* status: Done<br />
* Change on-disk format:<br />
* Target Date: (in patch queue)<br />
* e2fsprogs Changes: Done<br />
* outstanding issues:</div>Diegocghttps://ext4.wiki.kernel.org/index.php/Frequently_Asked_QuestionsFrequently Asked Questions2009-01-08T00:04:55Z<p>Diegocg: Delete old development assumptions...</p>
<hr />
<div>== Getting Started ==<br />
<br />
=== How do I get started using ext4? ===<br />
<br />
Please see the [[Ext4 Howto]] page for information on getting started using ext4.<br />
<br />
=== Where do I get the latest version of e2fsprogs? ===<br />
<br />
The latest version of e2fsprogs can be found at [http://sourceforge.net/project/showfiles.php?group_id=2406&package_id=2374 Soureforge] or at [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs kernel.org].<br />
<br />
=== How do I build e2fsprogs? ===<br />
<br />
The <tt>INSTALL</tt> file in the top of the source tree gives more detailed information, but e2fsprogs uses a standard configure script, so the standard "<tt>./configure; make</tt>" will build the e2fsprogs binaries. Note that if you wish to build the ELF shared libraries, you need to add the "<tt>--enable-elf-shlibs</tt>" option to the configure invocation.<br />
<br />
=== How do I create and mount a new ext4 filesystem? ===<br />
<br />
First, make sure that you have e2fsprogs 1.41.0 or later installed on your system. This is required for ext4 support. If the new partition where you would like to create the ext4 filesystem is /dev/sdb1, then all you have to type is:<br />
<br />
'''/sbin/mke2fs -t ext4 /dev/sdb1<br>'''<br />
<br />
Then to mount this new filesystem, all you need to do is:<br />
<br />
'''mkdir /mnt/test<br>'''<br />
'''mount -t ext4 /dev/sdb1 /mnt/test<br>'''<br />
<br />
For more information, please see the [[Ext4 Howto]] document.<br />
<br />
<br />
<!-- This question is no longer relevant, is it?<br />
<br />
=== Why do I get "EXT4-fs: sdb1: not marked OK to use with test code." in my dmesg? ===<br />
<br />
Ext4 is currently in development, and as a safety measure, it requires that filesystems that it mounts have a flag indicating that it's OK for in-development code be able to mount the filesystem. This requirement will be dropped relatively soon, once the ext4 developers are confident that ext4 is stable.<br />
<br />
The test_fs flag can be set by using the command "tune2fs -E test_fs /dev/sdb1". Filesystems which are created using the command "mke2fs -t ext4dev /dev/sdb1" will automatically have the test_fs flag set. When the ext4 filesystem has become stable, the command "mke2fs -t ext4 /dev/sdb1" will create a filesystem with all of the appropriate filesystem options suitable for the ext4 filesystem, but without the test_fs flag.<br />
<br />
--><br />
<br />
<br />
== History of ext2, ext3, and ext4 ==<br />
<br />
=== What is the difference between ext2, ext3, and ext4? ===<br />
<br />
The ext2, ext3, and ext4 file systems are a family of file systems that have a strong amount of backwards and forward compatibility. In fact, they can be considered a single filesytem format with a number of feature extensions, and ext2, ext3, and ext4 are merely the names of the implementations found in the Linux kernel. This way of looking at things is supported by the fact that they share the same userspace utilities (e2fsprogs), and that many filesystems can be mounted on different filesystems. For example, a filesystem which is created for use with ext3 can be mounted using either ext2 or ext4. However, a filesystem with ext4-specific extensions can not be mounted using ext2 or ext3, and the ext3 and ext4 file systems code in the kernel (at least of this writing) require the presence of a journal, which is generally not present in partitions formatted for use by the ext2 file system.<br />
<br />
=== Why was ext2 created? ===<br />
<br />
In April 1992, the ext filesystem was written by Remy Card to address two key limitations with the Minix filesystem, which had previously been the only filesystem available to Linux: filenames could be only 14 characters, and the maximum file system size supported by Minix was 64MB. The ext filesystem supported block devices up to 2GB, and file names up to 255 characters, but (like Minix) it only had a single timestamp for last modification time, last access time, and inode change time. It also used linked lists to store free blocks, which meant that files tended to get fragmented very easily. In January, 1993, the ext2 filesystem was released which further increased the maximum block size to 4TB, added POSIX timestamps, and supported variable block sizes. More importantly, it added support for extensibility so that new features could be added to the filesystem.<br />
<br />
== File System Features ==<br />
<br />
=== What features are supported by the ext2 filesystem? ===<br />
<br />
As of this writing, the ext2 filesystem supports the following features:<br />
<br />
* EXT2_FEATURE_COMPAT_EXT_ATTR<br />
* EXT2_FEATURE_INCOMPAT_FILETYPE<br />
* EXT2_FEATURE_INCOMPAT_META_BG<br />
* EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER<br />
* EXT2_FEATURE_RO_COMPAT_LARGE_FILE<br />
* EXT2_FEATURE_RO_COMPAT_BTREE_DIR (note: the ext2 filesystem only btree directories in that it knows how to clear the indexed directory flag when it modifies a btree directory)<br />
<br />
=== What features are supported by the ext3 file system? ===<br />
<br />
As of this writing, the ext3 file system supports the following features:<br />
<br />
* EXT3_FEATURE_COMPAT_EXT_ATTR<br />
* EXT3_FEATURE_COMPAT_RESIZE_INODE<br />
* EXT3_FEATURE_COMPAT_DIR_INDEX<br />
* EXT3_FEATURE_COMPAT_HAS_JOURNAL (note: this feature *must* be set)<br />
* EXT3_FEATURE_INCOMPAT_FILETYPE<br />
* EXT3_FEATURE_INCOMPAT_RECOVER<br />
* EXT3_FEATURE_INCOMPAT_META_BG<br />
* EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER<br />
* EXT3_FEATURE_RO_COMPAT_LARGE_FILE<br />
* EXT3_FEATURE_RO_COMPAT_BTREE_DIR<br />
<br />
=== What features are supported by the ext4 file system? ===<br />
<br />
As of this writing, the ext4 file system supports the following features:<br />
<br />
* EXT4_FEATURE_COMPAT_EXT_ATTR<br />
* EXT4_FEATURE_COMPAT_RESIZE_INODE<br />
* EXT4_FEATURE_COMPAT_DIR_INDEX<br />
* EXT4_FEATURE_COMPAT_HAS_JOURNAL (note: this feature *must* be set) <br />
* EXT4_FEATURE_INCOMPAT_FILETYPE<br />
* EXT4_FEATURE_INCOMPAT_RECOVER<br />
* EXT4_FEATURE_INCOMPAT_META_BG<br />
* EXT4_FEATURE_INCOMPAT_EXTENTS<br />
* EXT4_FEATURE_INCOMPAT_64BIT<br />
* EXT4_FEATURE_INCOMPAT_FLEX_BG<br />
* EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER<br />
* EXT4_FEATURE_RO_COMPAT_LARGE_FILE<br />
* EXT4_FEATURE_RO_COMPAT_GDT_CSUM<br />
* EXT4_FEATURE_RO_COMPAT_DIR_NLINK<br />
* EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE<br />
* EXT4_FEATURE_RO_COMPAT_BTREE_DIR<br />
* EXT4_FEATURE_RO_COMPAT_HUGE_FILE<br />
<br />
== Understanding how it works ==<br />
<br />
=== What are the new features in Ext4 (vs Ext2/3)? ===<br />
<br />
Check here: http://ext4.wiki.kernel.org/index.php/New_ext4_features.<br />
<br />
=== How do I test the features in Ext4? ===<br />
<br />
<br />
=== How do I benchmark the performance of Ext4 as against other FS? What are the tools available? ===<br />
<br />
There exists a wide variety of tools and comparison, for more information on the different performance testing tools available: [http://www.google.com/search?q=file+system+performance+testing&btnG=Google+Search]<br />
<br />
Another reference here: http://en.wikipedia.org/wiki/Comparison_of_file_systems.<br />
<br />
=== Can I undelete files in Ext4? ===<br />
<br />
No, in the same way that the ext3 journal requirements to be consistent after a crash prevent undelete of ext3 files, it isn't possible to undelete ext4 files.<br />
<br />
=== Can I mount existing Ext3 as Ext4? And vice versa? Similarly from Ext2 to Ext4 and its reverse? ===<br />
<br />
You can mount any ext3 filesystem as ext4 without any changes. If the filesystem is mounted as ext4 using the "extents" mount option (the default), this will enable the INCOMPAT_EXTENTS feature, and prevent the filesystem from being mounted as ext3 again. If you mount with the "-o noextents" option this will not happen.<br />
<br />
For ext2 the filesystem would first need to have a journal created using ''tune2fs'' before it can be mounted as ext3 or ext4. At that point the filesystem is an ext3 filesystem and the above comments apply.<br />
<br />
<pre><br />
# tune2fs -j /dev/XXX<br />
</pre><br />
<br />
=== What is the information provided by /proc/fs/jbd2/<partition>/history? ===<br />
<br />
Executing "cat /proc/fs/jbd2/<partition>/history" gives:<br />
<br />
<pre><br />
R/C tid wait run lock flush log hndls block inlog ctime write drop close<br />
R 2 0 107692 0 0 0 1 1 2 <br />
</pre><br />
<br />
The purpose of this history is to provide a capture of the statistical properties on the performance of the Ext4 filesystem. It can be observed that the entries are added after a file has been copied to the file system - not immediately, but delayed by a short while, due to the asynchronous mechanism of jbd2 logging(*FIXED ME*).<br />
<br />
=== What is the information provided by /proc/fs/jbd2/<partition>/info? ===<br />
<br />
Executing "cat /proc/fs/jbd2/<partition>/info" gives:<br />
<br />
56 transaction, each upto 2048 blocks<br />
average: <br />
0ms waiting for transaction<br />
57671ms running transaction<br />
0ms transaction was being locked<br />
28ms flushing data (in ordered mode)<br />
14ms logging transaction<br />
2383 handles per transaction<br />
6 blocks per transaction<br />
7 logged blocks per transaction<br />
<br />
=== How to online resize the Ext4 filesystem? ===<br />
<br />
Online resizing of ext4 works in a similar manner as ext3, using either resize2fs or ext2resize, but there is currently a limit (around 4TB or so) to the maximum filesystem size. Implementing online resize with the META_BG feature would allow this limit to be exceeded.<br />
<br />
=== What is the difference between extents mapping and traditional indirect block mapping? ===<br />
<br />
To quote from the paper: http://ext2.sourceforge.net/2005-ols/2005-ext3-paper.pdf:<br />
<br />
<pre><br />
Currently, the ext2/ext3 filesystem, like other traditional UNIX filesystems, uses a direct, indi-<br />
rect, double indirect, and triple indirect blocks to map file offsets to on-disk blocks. This<br />
scheme, sometimes simply called an indirect block mapping scheme, is not efficient for large<br />
files, especially large file deletion. In order to address this problem, many modern filesystems<br />
(including XFS and JFS on Linux) use some form of extent maps instead of the traditional<br />
indirect block mapping scheme.<br />
<br />
Since most filesystems try to allocate blocks in a contiguous fashion, extent maps are a more efficient <br />
way to represent the mapping between logical and physical blocks for large files. An extent is a single <br />
descriptor for a range of contiguous blocks, instead of using, say hundreds of entries to describe <br />
each block individually.<br />
</pre><br />
<br />
=== What is delayed allocation? What are its advantages in Ext4? ===<br />
<br />
Delayed allocation worked by deferring the allocation of new blocks in<br />
the filesystem to disk blocks until writeback time. This helps in three ways:<br />
<br />
1. Reduced fragmentation.<br><br />
2. Reduced CPU cycles spent in get_block() calls.<br><br />
3. It may avoid the need for disk updates for metadata creation, which in turn <br />
reduces impact on fragmentation.<br><br />
<br />
=== What is multiblock allocation (mballoc)? ===<br />
<br />
'''mballoc''' is a mechanism to allow many blocks to be allocated to a file in a single operation, in order to dramatically reduce the amount of CPU usage searching for many free blocks in the filesystem. Also, because many file blocks are allocated at the same time, a much better decision can be made to find a chunk of free space where all of the blocks will fit.<br />
<br />
The mballoc code is active when using the O_DIRECT flag for writes, or if the delayed allocation (delalloc) feature is being used. This allows the file to have many dirty blocks submitted for writes at the same time, unlike the existing kernel mechanism of submitting each block to the filesystem separately for allocation.<br />
<br />
=== What is this bitmap allocator? ===<br />
<br />
=== Can you say something about the history of Ext4? ===<br />
<br />
Check here: http://en.wikipedia.org/wiki/Ext4.<br />
<br />
=== When was Ext4 first annouced to the LKML? ===<br />
<br />
Check here: http://kerneltrap.org/node/6776<br />
<br />
=== What are the key differences between ext3 and ext4? ===<br />
<br />
The main new features in ext4 are below, and are described more fully in [[New_ext4_features]]:<br />
* extent-mapped files for more efficient storage of file metadata (EXTENTS)<br />
* multi-block and delayed allocation for faster/better file allocations<br />
* support for larger filesystems (up to 2^48 blocks, currently 2^60 bytes) (64_BIT)<br />
* optimized storage of filesystem metadata like bitmaps and inode table (FLEX_BG)<br />
* less overhead for e2fsck, on-disk checksum of group descriptors (GDT_CSUM)<br />
* removed 32000 subdirectory limit (DIR_NLINKS)<br />
* nanosecond inode timestamps (EXTRA_ISIZE)<br />
<br />
=== What are the key differences between jbd and jbd2? ===<br />
<br />
The code between jbd and jbd2 is nearly identical, but jbd2 adds a few new features in a compatible way:<br />
* support for 64-bit filesystems (64_BIT)<br />
* checksumming of journal transactions (CHECKSUM)<br />
* asynchronous transaction commit block write (ASYNC_COMMIT)</div>Diegocghttps://ext4.wiki.kernel.org/index.php/Ext4_HowtoExt4 Howto2009-01-07T23:56:19Z<p>Diegocg: Update some parts of the document, 2.6.28 has been released. It needs more work...</p>
<hr />
<div>= General Information =<br />
<br />
Ext4 was released as a functionally complete and stable filesystem in Linux 2.6.28, hence it's safe to use it in production environments, but as any piece of software, it has bugs (which are more likely to be hit in the first stable versions). Any know critical bug will be quickly fixed. If you find one, you can contact with the Ext4 developers at the [http://vger.kernel.org/vger-lists.html#linux-ext4 ext4 mailing list]. They are sometimes also can be found on [[IRC]].<br />
<br />
= Getting Ext4 code =<br />
<br />
== For people who build their own kernel ==<br />
<br />
1. Start with a 2.6.28 kernel. It is highly recommended that you apply the latest [http://www.kernel.org/pub/linux/kernel/people/tytso/ext4-patches/ patchset] (if available) to get the latest bug fixes. In your kernel's <tt>.config</tt> file, enable <tt>EXT4_FS</tt> (along with <tt>EXT4_FS_XATTR</tt> and <tt>EXT4_FS_POSIX_ACL</tt> if you like).<br />
<br />
2. Compile the latest version of e2fsprogs (as of this writing 1.41.3) from [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs kernel.org] or from [http://sourceforge.net/project/showfiles.php?group_id=2406 Sourceforge]. Note that it is highly important to install the mke2fs.conf file that comes with the e2fsprogs 1.41.x sources in /etc/mke2fs.conf. If you have edited the /etc/mke2fs.conf file, you will need to merge your changes with the version from e2fsprogs 1.41.x.<br />
<br />
== For people who are running Fedora ==<br />
<br />
Fedora 9 currently has a kernel based on 2.6.25 that has basic ext4 support. (It is missing some of the latest fixes and performance optimizations, such as delayed allocation.) A 2.6.26 kernel update should be available reasonably soon, with more up-to-date ext4 code, though still missing delayed allocation, which should arrive in 2.6.27.<br />
<br />
Fedora 9 has all of the basic infrastructure needed to be able to run ext4, including updated udev, blkid, and other bits needed for ext4 to be a transparently recognized filesystem.<br />
<br />
e2fsprogs-1.41.0 is currently in the [http://fedoraproject.org/wiki/Testing#Fedora_Proposed_Updates Fedora 9 updates-testing repository], and users wishing to utilize ext4 should use this version of e2fsprogs.<br />
<br />
== For people who are running Ubuntu ==<br />
<br />
For people who are running Ubuntu, it is *highly* recommended that you download a set of modified util-linux packages and install them. Packages for Ubuntu Hardy are available [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/ubuntu-fixed-util-linux here]. These packages revert a [http://changelogs.ubuntu.com/changelogs/pool/main/u/util-linux/util-linux_2.12r-19ubuntu1/changelog change made by Ubuntu] to use the volid library instead of the blkid library. The volid library has a number of shortcomings, including that they don't work on freshly created filesystems or swap devices until after you reboot (since it is tied to udev probing) and the volid library doesn't understand ext4dev filesystems. The blkid library is much better, and Debian uses the blkid library for util-linux. Unfortunately, Ubuntu chose to make this reason for some unknown reason. For other versions of Ubuntu, the patch that was applied can be found [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/ubuntu-fixed-util-linux/util-linux-patch here].<br />
<br />
== For people who are running Debian ==<br />
<br />
In Debian Lenny (Testing), the following current packages provide ext4 support:<br />
* ext4dev module in the linux-image package (2.6.26-10)<br />
* e2fsprogs (1.41.3-1)<br />
<br />
It should be noted that the stock 2.6.26 ext4 has problems with delayed allocation and with filesystems with non-extent based files. So until Debian starts shipping a 2.6.27 based kernel or a 2.6.26 kernel with at least the 2.6.26-ext4-7 patchset, you should mount ext4dev filesystems using -o nodelalloc and only use freshly created filesystems using "mke2fs -t ext4dev". (Without these fixes, if you try to use an ext3 filesystem which was converted using '''tune2fs -E test_fs -o extents /dev/DEV''', you will probably hit a kernel '''BUG''' the moment you try to delete or truncate an old non-extent based file.)<br />
<br />
= Creating ext4 filesystems =<br />
<br />
Creating a new ext4 filesystem is very easy once you have upgraded to e2fsprogs 1.41 or later. Simply type:<br />
<br />
$ mke2fs -T ext4 /dev/DEV<br />
<br />
Once the filesystem is created, it can be mounted as follows:<br />
<br />
$ mount -t ext4 /dev/DEV /wherever<br />
<br />
NOTE: Although very large fileystems are on ext4's feature list, current e2fsprogs currently still limits the filesystem size to 2^32 blocks (16T for a 4k block filesystem). Filesystems larger than 16T is one of the very next high-priority features to complete for ext4.<br />
<br />
= Booting from an ext4 filesystem =<br />
<br />
Right now there's not a stable version of grub that supports booting a kernel from a ext4 partition. It's recommended that you keep /boot in a ext3 partition.<br />
<br />
Preliminary ext4 support seems to have been [http://svn.savannah.gnu.org/viewvc?view=rev&root=grub&revision=1699 added] to the 1.97 version of the GRUB2 development branch.<br />
<br />
There's also a Google Summer of Code [http://code.google.com/soc/2008/suse/appinfo.html?csaid=91DC4C762E7EE6D7 project] (from opensuse) which seem to have [http://code.google.com/p/grub4ext4/ developed] ext4 grub support. Both projects -GRUB2 and the GSoC projects- seem (sadly) to be different efforts.<br />
<br />
= Converting an ext3 filesystem to ext4 =<br />
<br />
To convert an existing ext3 filesystem to use ext4, use the command<br />
<br />
$ tune2fs -O extents,uninit_bg,dir_index /dev/DEV<br />
<br />
<br />
WARNING: Once you run this command, the filesystem will no longer be mountable using the ext3 filesystem!<br />
<br />
After running this command, you MUST run fsck:<br />
<br />
$ fsck -pf /dev/DEV<br />
<br />
NOTE: by doing so, new files will be created in extents format, but this will not convert existing files. However, they can be transparently read by Ext4.<br />
<br />
WARNING: It is NOT recommended to resize the inodes using <tt>resize2fs</tt>, as this is known to corrupt some filesystems.</div>Diegocghttps://ext4.wiki.kernel.org/index.php/Main_PageMain Page2009-01-07T23:42:43Z<p>Diegocg: Add a link to my kernelnewbies.org article, since it's more descriptive and updated than the wiki...</p>
<hr />
<div>{|<br />
|-<br />
| nowrap style="vertical-align: top; font: bold xx-large sans-serif; " |<br />
Ext4 (and Ext2/Ext3) Wiki<br />
|}<br />
<br />
<!-- Welcome Block --><br />
<div style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#fff0e0; align:right;"><br />
Welcome to the '''[[Ext4:About|Ext4 Wiki]]''', the Wiki for users and developers of the ext2, ext3, and ext4 filesystems. If you are trying to find out how to get started with ext4, please see the [[Ext4 Howto]].<br />
<br />
Please [[Ext4:Support|support us]] and [[:Category:NeedsEditing|help to extend]] this wiki. Thank you!<br />
<br />
<div align="right"><small>'''[[Ext4:About|More about the Ext4 Wiki]]'''</small></div><br />
</div><br />
<br />
{| width="100%"<br />
|-<br />
|style="vertical-align:top" |<br />
<br />
<!-- Documentation Block --><br />
<div style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#dcf5ff; align:right;"><br />
'''Documentation'''<br />
* [[Ext4_Howto | Getting started with Ext4]]<br />
* [[Considerations when creating ext3 filesystems]]<br />
* [[Frequently Asked Questions]]<br />
* [http://kernelnewbies.org/Ext4 Kernelnewbie.org's Ext4 article (description of Ext4 features and instructions on how to use it)]<br />
</div><br />
<br />
<!-- Utilities Block : DO NOT EDIT HERE --><br />
<div style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#F8F8FF; align:right;"><br />
'''Utilities'''<br />
* [http://e2fsprogs.sourceforge.net E2fsprogs]<br />
* [[Filesystem Testing Tools]]<br />
</div><br />
<br />
<!-- Development Block --><br />
<div style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#fffff0; align:right; "><br />
'''Development'''<br />
* [[Ext4 patchsets]] <br />
* [[New ext4 features]]<br />
* [[e2fsprogs features and patches]]<br />
* [[Ext4 Developer's Conference Call]]<br />
* [[Testing Results]]<br />
* [[Bugs]]<br />
</div><br />
<br />
| width="50%" style="vertical-align:top" |<br />
<br />
<!-- Wiki News Block : DO NOT EDIT HERE --><br />
<div style="margin:0; margin-top:10px; border:1px solid #dfdfdf; padding: 0em 1em 1em 3em; background-color:#f0e0d0; align:left; text-indent:-2em;"><br />
'''News'''<br />
<div style="font-size:small">{{Ext4:News_Contents}}<br />
</div><br />
<div align="right"><small>'''More [[Ext4:News|News]]'''</small></div><br />
</div><br />
<br />
<!-- Further Information Block --><br />
<div style="margin:0; margin-top:10px; border:1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#dfefdf; align:left; margin-top:10px"><br />
'''Further Information'''<br />
* [[publications|Articles and Publications ]]<br />
* [[:Category:Glossary|Glossary]]<br />
* [[mailinglists|Mailing Lists ]]<br />
*[[links|Links to other ext2/3/4 resources on the web]]<br />
* [[IRC|IRC Channels ]]<br />
</div><br />
<br />
|}<br />
----<br />
Information about editing this wiki: [[Help:Editing]]</div>Diegocghttps://ext4.wiki.kernel.org/index.php/Ext4_HowtoExt4 Howto2008-10-18T16:32:49Z<p>Diegocg: "an" typo</p>
<hr />
<div>= General Information =<br />
<br />
As of this writing (mid-July, 2008, just after the release of 2.6.26), the ext4 code is functionally complete and functional enough that a few people are using it in production. However, it is still being tested and although the developers haven't lost any data yet, please be cautious and keep plenty of backups!<br />
<br />
The ext4 developers can be contacted at the [http://vger.kernel.org/vger-lists.html#linux-ext4 ext4 mailing list]. They are sometimes also can be found on [[IRC]].<br />
<br />
= Getting Ext4 code =<br />
<br />
== For people who build their own kernel ==<br />
<br />
1. Start with a 2.6.26 kernel. It is highly recommended that you apply the [http://www.kernel.org/pub/linux/kernel/people/tytso/ext4-patches/2.6.26-ext4-7/ 2.6.26-ext4-7 patchset] to get improved performance through delayed allocation as well as the latest bug fixes. In your kernel's <tt>.config</tt> file, enable <tt>EXT4DEV_FS</tt> (along with <tt>EXT4DEV_FS_XATTR</tt> and <tt>EXT4DEV_FS_POSIX_ACL</tt> if you like).<br />
<br />
2. Compile the latest version of e2fsprogs (as of this writing 1.41.1) from [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs kernel.org] or from [http://sourceforge.net/project/showfiles.php?group_id=2406 Sourceforge]. Note that it is highly important to install the mke2fs.conf file that comes with the e2fsprogs 1.41.x sources in /etc/mke2fs.conf. If you have edited the /etc/mke2fs.conf file, you will need to merge your changes with the version from e2fsprogs 1.41.x.<br />
<br />
== For people who are running Fedora ==<br />
<br />
Fedora 9 currently has a kernel based on 2.6.25 that has basic ext4 support. (It is missing some of the latest fixes and performance optimizations, such as delayed allocation.) A 2.6.26 kernel update should be available reasonably soon, with more up-to-date ext4 code, though still missing delayed allocation, which should arrive in 2.6.27.<br />
<br />
Fedora 9 has all of the basic infrastructure needed to be able to run ext4, including updated udev, blkid, and other bits needed for ext4 to be a transparently recognized filesystem.<br />
<br />
e2fsprogs-1.41.0 is currently in the [http://fedoraproject.org/wiki/Testing#Fedora_Proposed_Updates Fedora 9 updates-testing repository], and users wishing to utilize ext4 should use this version of e2fsprogs.<br />
<br />
== For people who are running Ubuntu ==<br />
<br />
For people who are running Ubuntu, it is *highly* recommended that you download a set of modified util-linux packages and install them. Packages for Ubuntu Hardy are available [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/ubuntu-fixed-util-linux here]. These packages revert a [http://changelogs.ubuntu.com/changelogs/pool/main/u/util-linux/util-linux_2.12r-19ubuntu1/changelog change made by Ubuntu] to use the volid library instead of the blkid library. The volid library has a number of shortcomings, including that they don't work on freshly created filesystems or swap devices until after you reboot (since it is tied to udev probing) and the volid library doesn't understand ext4dev filesystems. The blkid library is much better, and Debian uses the blkid library for util-linux. Unfortunately, Ubuntu chose to make this reason for some unknown reason. For other versions of Ubuntu, the patch that was applied can be found [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/ubuntu-fixed-util-linux/util-linux-patch here].<br />
<br />
== For people who are running Debian ==<br />
<br />
In Debian Sid (Unstable), the following packages provide ext4 support:<br />
* ext4dev module in the linux-image package (at least 2.6.26)<br />
* e2fsprogs (at least 1.41.0)<br />
<br />
It should be noted that the stock 2.6.26 ext4 has problems with delayed allocation and with filesystems with non-extent based files. So until Debian starts shipping a 2.6.27 based kernel or a 2.6.26 kernel with at least the 2.6.26-ext4-7 patchset, you should mount ext4dev filesystems using -o nodelalloc and only use freshly created filesystems using "mke2fs -t ext4dev". (Without these fixes, if you try to use an ext3 filesystem which was converted using '''tune2fs -E test_fs -o extents /dev/DEV''', you will probably hit a kernel '''BUG''' the moment you try to delete or truncate an old non-extent based file.)<br />
<br />
= Creating ext4 filesystems =<br />
<br />
Creating a new ext4 filesystem is very easy once you have upgraded to e2fsprogs 1.41 or later. Simply type:<br />
<br />
$ mke2fs -T ext4dev /dev/DEV<br />
<br />
Once the filesystem is created, it can be mounted as follows:<br />
<br />
$ mount -t ext4dev /dev/DEV /wherever<br />
<br />
NOTE: Although very large fileystems are on ext4's feature list, current e2fsprogs currently still limits the filesystem size to 2^32 blocks (16T for a 4k block filesystem). > 16T support is one of the very next high-priority features to complete for ext4.<br />
<br />
= Booting from an ext4 filesystem =<br />
<br />
Right now there's not a stable version of grub that supports booting a kernel from a ext4 partition. It's recommended that you keep /boot in a ext3 partition.<br />
<br />
Preliminary ext4 support seems to have been [http://svn.savannah.gnu.org/viewvc?view=rev&root=grub&revision=1699 added] to the 1.97 version of the GRUB2 development branch.<br />
<br />
There's also a Google Summer of Code [http://code.google.com/soc/2008/suse/appinfo.html?csaid=91DC4C762E7EE6D7 project] (from opensuse) which seem to have [http://code.google.com/p/grub4ext4/ developed] ext4 grub support. Both projects -GRUB2 and the GSoC projects- seem (sadly) to be different efforts.<br />
<br />
= Converting an ext3 filesystem to ext4 =<br />
<br />
To convert an existing ext3 filesystem to use ext4, use the command<br />
<br />
$ tune2fs -O extents -E test_fs /dev/DEV<br />
<br />
NOTE: by doing so, new files will be created in extents format, but this will not convert existing files. However, they can be transparently read from and written to in the old ext3 format.<br />
<br />
WARNING: Once the <tt>extent</tt> feature has been turned on, the filesystem will no longer be mountable using the ext3 filesystem!<br />
<br />
If the filesystem was created with 128 byte inodes, it can be<br />
converted to use 256 byte for greater efficiency via:<br />
<br />
$ tune2fs -I 256 /dev/DEV<br />
<br />
NOTE: Recent mkfs.ext3 now defaults to 256-byte inodes, so newer distributions (Fedora 9 included) will have already created 256-byte inode filesystems.</div>Diegocghttps://ext4.wiki.kernel.org/index.php/Ext4_HowtoExt4 Howto2008-10-18T16:30:54Z<p>Diegocg: document grub support</p>
<hr />
<div>= General Information =<br />
<br />
As of this writing (mid-July, 2008, just after the release of 2.6.26), the ext4 code is functionally complete and functional enough that a few people are using it in production. However, it is still being tested and although the developers haven't lost any data yet, please be cautious and keep plenty of backups!<br />
<br />
The ext4 developers can be contacted at the [http://vger.kernel.org/vger-lists.html#linux-ext4 ext4 mailing list]. They are sometimes also can be found on [[IRC]].<br />
<br />
= Getting Ext4 code =<br />
<br />
== For people who build their own kernel ==<br />
<br />
1. Start with a 2.6.26 kernel. It is highly recommended that you apply the [http://www.kernel.org/pub/linux/kernel/people/tytso/ext4-patches/2.6.26-ext4-7/ 2.6.26-ext4-7 patchset] to get improved performance through delayed allocation as well as the latest bug fixes. In your kernel's <tt>.config</tt> file, enable <tt>EXT4DEV_FS</tt> (along with <tt>EXT4DEV_FS_XATTR</tt> and <tt>EXT4DEV_FS_POSIX_ACL</tt> if you like).<br />
<br />
2. Compile the latest version of e2fsprogs (as of this writing 1.41.1) from [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs kernel.org] or from [http://sourceforge.net/project/showfiles.php?group_id=2406 Sourceforge]. Note that it is highly important to install the mke2fs.conf file that comes with the e2fsprogs 1.41.x sources in /etc/mke2fs.conf. If you have edited the /etc/mke2fs.conf file, you will need to merge your changes with the version from e2fsprogs 1.41.x.<br />
<br />
== For people who are running Fedora ==<br />
<br />
Fedora 9 currently has a kernel based on 2.6.25 that has basic ext4 support. (It is missing some of the latest fixes and performance optimizations, such as delayed allocation.) A 2.6.26 kernel update should be available reasonably soon, with more up-to-date ext4 code, though still missing delayed allocation, which should arrive in 2.6.27.<br />
<br />
Fedora 9 has all of the basic infrastructure needed to be able to run ext4, including updated udev, blkid, and other bits needed for ext4 to be a transparently recognized filesystem.<br />
<br />
e2fsprogs-1.41.0 is currently in the [http://fedoraproject.org/wiki/Testing#Fedora_Proposed_Updates Fedora 9 updates-testing repository], and users wishing to utilize ext4 should use this version of e2fsprogs.<br />
<br />
== For people who are running Ubuntu ==<br />
<br />
For people who are running Ubuntu, it is *highly* recommended that you download a set of modified util-linux packages and install them. Packages for Ubuntu Hardy are available [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/ubuntu-fixed-util-linux here]. These packages revert a [http://changelogs.ubuntu.com/changelogs/pool/main/u/util-linux/util-linux_2.12r-19ubuntu1/changelog change made by Ubuntu] to use the volid library instead of the blkid library. The volid library has a number of shortcomings, including that they don't work on freshly created filesystems or swap devices until after you reboot (since it is tied to udev probing) and the volid library doesn't understand ext4dev filesystems. The blkid library is much better, and Debian uses the blkid library for util-linux. Unfortunately, Ubuntu chose to make this reason for some unknown reason. For other versions of Ubuntu, the patch that was applied can be found [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/ubuntu-fixed-util-linux/util-linux-patch here].<br />
<br />
== For people who are running Debian ==<br />
<br />
In Debian Sid (Unstable), the following packages provide ext4 support:<br />
* ext4dev module in the linux-image package (at least 2.6.26)<br />
* e2fsprogs (at least 1.41.0)<br />
<br />
It should be noted that the stock 2.6.26 ext4 has problems with delayed allocation and with filesystems with non-extent based files. So until Debian starts shipping a 2.6.27 based kernel or a 2.6.26 kernel with at least the 2.6.26-ext4-7 patchset, you should mount ext4dev filesystems using -o nodelalloc and only use freshly created filesystems using "mke2fs -t ext4dev". (Without these fixes, if you try to use an ext3 filesystem which was converted using '''tune2fs -E test_fs -o extents /dev/DEV''', you will probably hit a kernel '''BUG''' the moment you try to delete or truncate an old non-extent based file.)<br />
<br />
= Creating ext4 filesystems =<br />
<br />
Creating a new ext4 filesystem is very easy once you have upgraded to e2fsprogs 1.41 or later. Simply type:<br />
<br />
$ mke2fs -T ext4dev /dev/DEV<br />
<br />
Once the filesystem is created, it can be mounted as follows:<br />
<br />
$ mount -t ext4dev /dev/DEV /wherever<br />
<br />
NOTE: Although very large fileystems are on ext4's feature list, current e2fsprogs currently still limits the filesystem size to 2^32 blocks (16T for a 4k block filesystem). > 16T support is one of the very next high-priority features to complete for ext4.<br />
<br />
= Booting from a ext4 filesystem =<br />
<br />
Right now there's not a stable version of grub that supports loading from a ext4 partition. Preliminary ext4 support seems to have been [http://svn.savannah.gnu.org/viewvc?view=rev&root=grub&revision=1699] added to the 1.97 version of the GRUB2 development branch.<br />
<br />
There's also a Google Summer of Code [http://code.google.com/soc/2008/suse/appinfo.html?csaid=91DC4C762E7EE6D7 project] (from opensuse) which seem to have [http://code.google.com/p/grub4ext4/ developed] ext4 grub support. Both projects -GRUB2 and the GSoC projects- seem (sadly) to be different efforts.<br />
<br />
<br />
= Converting an ext3 filesystem to ext4 =<br />
<br />
To convert an existing ext3 filesystem to use ext4, use the command<br />
<br />
$ tune2fs -O extents -E test_fs /dev/DEV<br />
<br />
NOTE: by doing so, new files will be created in extents format, but this will not convert existing files. However, they can be transparently read from and written to in the old ext3 format.<br />
<br />
WARNING: Once the <tt>extent</tt> feature has been turned on, the filesystem will no longer be mountable using the ext3 filesystem!<br />
<br />
If the filesystem was created with 128 byte inodes, it can be<br />
converted to use 256 byte for greater efficiency via:<br />
<br />
$ tune2fs -I 256 /dev/DEV<br />
<br />
NOTE: Recent mkfs.ext3 now defaults to 256-byte inodes, so newer distributions (Fedora 9 included) will have already created 256-byte inode filesystems.</div>Diegocg