Ext4 Howto

From Ext4
Revision as of 22:40, 13 July 2008 by Ckujau (Talk | contribs)

Jump to: navigation, search

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