Ext4 Howto

From Ext4
(Difference between revisions)
Jump to: navigation, search
(forgot the "pu" on the 2nd pull; formatting fixes)
(mk2fs requires -E test_fs now)
Line 1: Line 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>
+
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>
# Get & compile a patched version of e2fsprogs
+
 
## Either get it from [ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs-interim/  kernel.org] or
+
2. Get & compile a patched version of e2fsprogs
## use the <tt>"pu"</tt> branch from the [http://git.kernel.org/?p=fs/ext2/e2fsprogs.git;a=summary git repository]:
+
* 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
 
         $ git clone git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
 
         $ cd e2fsprogs
 
         $ cd e2fsprogs
Line 11: Line 12:
 
         * pu
 
         * pu
 
         $ git pull git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git <font color="red">pu</font>
 
         $ git pull git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git <font color="red">pu</font>
3. We're still using '<tt>mkfs.ext<font color="red">3</font> /dev/DEVICE</tt>' to create the filesystem<br>
+
 
 +
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:
 +
        $ mke2fs -E test_fs /dev/DEV
 +
 
 +
* We can set this on an already created filesystem with:
 +
        $ tune2fs -E test_fs /dev/DEV
 +
 
 
4. To mount the partition as Ext4:
 
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:
+
  mount -t ext4dev -o extents /dev/DEVICE /wherever
+
Some (most? all?) of the ext3 mountoptions are still supported: <tt>nobh, user_xattr, acl</tt>.
+
  
 +
* To enable [http://lwn.net/Articles/194869/ extents], use:
 +
        $ mount -t ext4dev -o extents /dev/DEVICE /mnt/test
  
 
NOTE:
 
NOTE:
* Once mounted with <tt>-o extents</tt>, the partition '''cannot''' be mounted with <tt>-t ext3</tt> any more!
+
* By default ''mount(8)'' will enable the <tt>mballoc</tt> feature. To turn it off:
* The version of e2fsprogs mentioned above is '''NOT''' meant to be used for production system. 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.
+
        $ 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:
 +
        $ 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 22:40, 13 July 2008

1. Enable EXT4DEV_FS (along with EXT4DEV_FS_XATTR and EXT4DEV_FS_POSIX_ACL if you like) in your kernel .config

2. Get & compile a patched version of e2fsprogs

       $ git clone git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
       $ cd e2fsprogs
       $ git checkout -b pu
       Switched to a new branch "pu"
       $ git branch 
       master
       * pu
       $ git pull git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git pu

3. Although there's an mkfs.ext4, it really is just mke2fs. However, we have to set extended options for ext4:

       $ mke2fs -E test_fs /dev/DEV
  • We can set this on an already created filesystem with:
       $ tune2fs -E test_fs /dev/DEV

4. To mount the partition as Ext4:

       $ mount -t ext4dev /dev/DEV /wherever
       $ mount -t ext4dev -o extents /dev/DEVICE /mnt/test

NOTE:

  • By default mount(8) will enable the mballoc 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 extent feature. To turn it off:
       $ mount -t ext4dev -o data=writeback,delalloc,noextents,mballoc /dev/DEV /mnt/test

CAUTION: Once the extent 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 the tools don't get much testing atm.
Personal tools