Ext4 Howto

From Ext4
(Difference between revisions)
Jump to: navigation, search
(mk2fs requires -E test_fs now)
(Rewrite to bring it up to date.)
Line 1: Line 1:
1. Enable <tt>EXT4DEV_FS</tt> (along with <tt>EXT4DEV_FS_XATTR</tt> and <tt>EXT4DEV_FS_POSIX_ACL</tt> if you like) in your kernel <tt>.config</tt>
+
= General Information =
  
2. Get & compile a patched version of e2fsprogs
+
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 productionHowever, it is still being tested and although the developers haven't lost any data yet, please be cautious and keep plenty of backups!
* Either get it from [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs-interim/ kernel.org] or
+
* use the <tt>"pu"</tt> branch from the [http://git.kernel.org/?p=fs/ext2/e2fsprogs.git;a=summary git repository]:
+
        $ git clone git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
+
        $ cd e2fsprogs
+
        $ git checkout -b <font color="red">pu</font>
+
        Switched to a new branch "pu"
+
        $ git branch
+
        master
+
        * pu
+
        $ git pull git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git <font color="red">pu</font>
+
  
3. Although there's an <tt>mkfs.ext4</tt>, it really is just <tt>mke2fs</tt>. However, we have to set extended options for ext4:
+
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]].
        $ mke2fs -E test_fs /dev/DEV
+
  
* We can set this on an already created filesystem with:
+
= Getting Ext4 code =
         $ tune2fs -E test_fs /dev/DEV
+
 
 +
== For people who build their own kernel ==
 +
 
 +
1. Start with a 2.6.26 kernel.  Optionally apply the [http://www.kernel.org/pub/linux/kernel/people/tytso/ext4-patches/2.6.26-ext4-1 2.6.26-ext4-1 patchset] to get improved performance through delayed allocation.  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).
 +
 
 +
2.  Compile the latest version of e2fsprogs (as of this writing 1.41.0) 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].
 +
 
 +
== For people who are running Fedora ==
 +
 
 +
Fedora Core 9 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.)
 +
 
 +
There is a Yum repository with an updated e2fsprogs (and updated kernel?) available.  XXX need location and more detail
 +
 
 +
= Creating ext4 filesystems =
 +
 
 +
Creating a new ext4 filesystem is very easy once you have upgraded to e2fsprogs 1.41 or later.  Simply type:
 +
 
 +
         $ mke2fs -t ext4dev /dev/DEV
 +
 
 +
Once the filesystem is created, it can be mounted as follows:
  
4. To mount the partition as Ext4:
 
 
         $ mount -t ext4dev /dev/DEV /wherever
 
         $ mount -t ext4dev /dev/DEV /wherever
  
* To enable [http://lwn.net/Articles/194869/ extents], use:
+
= Converting an ext3 filesystem to ext4 =
        $ mount -t ext4dev -o extents /dev/DEVICE /mnt/test
+
 
 +
To convert an existing ext3 filesystem to use ext4, use the command
 +
 
 +
$ tune2fs -O extents -E test_fs /dev/DEV
 +
 
 +
If the filesystem was created with 128 byte inodes, it can be
 +
converted to use 256 byte for greater efficiency via:
  
NOTE:
+
         $ tune2fs -I 256 /dev/DEV
* By default ''mount(8)'' will enable the <tt>mballoc</tt> feature. To turn it off:
+
         $ mount -t ext4dev -o data=writeback,delalloc,extents,nomballoc /dev/DEV /mnt/test
+
  
* By default ''mount(8)'' will enable the <tt>extent</tt> feature. To turn it off:
+
WARNING: Once the <tt>extent</tt> feature has been turned on, the filesystem will no longer be mountable using the ext3 filesystem!
        $ mount -t ext4dev -o data=writeback,delalloc,noextents,mballoc /dev/DEV /mnt/test
+
CAUTION: Once the <tt>extent</tt> feature has been turned on, it is not possible to mount it as ext3 anymore!
+
* The version of e2fsprogs mentioned above is '''NOT''' meant to be used for production systems. Development of these tools wrt ext4 support is still in high flux and [http://www.mail-archive.com/linux-ext4@vger.kernel.org/msg04136.html the tools don't get much testing] atm.
+

Revision as of 18:55, 14 July 2008

Contents

General Information

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!

The ext4 developers can be contacted at the ext4 mailing list. They are sometimes also can be found on IRC.

Getting Ext4 code

For people who build their own kernel

1. Start with a 2.6.26 kernel. Optionally apply the 2.6.26-ext4-1 patchset to get improved performance through delayed allocation. In your kernel's .config file, enable EXT4DEV_FS (along with EXT4DEV_FS_XATTR and EXT4DEV_FS_POSIX_ACL if you like).

2. Compile the latest version of e2fsprogs (as of this writing 1.41.0) from kernel.org or from Sourceforge.

For people who are running Fedora

Fedora Core 9 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.)

There is a Yum repository with an updated e2fsprogs (and updated kernel?) available. XXX need location and more detail

Creating ext4 filesystems

Creating a new ext4 filesystem is very easy once you have upgraded to e2fsprogs 1.41 or later. Simply type:

       $ mke2fs -t ext4dev /dev/DEV

Once the filesystem is created, it can be mounted as follows:

       $ mount -t ext4dev /dev/DEV /wherever

Converting an ext3 filesystem to ext4

To convert an existing ext3 filesystem to use ext4, use the command

$ tune2fs -O extents -E test_fs /dev/DEV

If the filesystem was created with 128 byte inodes, it can be converted to use 256 byte for greater efficiency via:

       $ tune2fs -I 256 /dev/DEV

WARNING: Once the extent feature has been turned on, the filesystem will no longer be mountable using the ext3 filesystem!

Personal tools