Frequently Asked Questions

From Ext4
(Difference between revisions)
Jump to: navigation, search
m (http://www.w3.org/QA/Tips/noClickHere)
Line 9: Line 9:
  
 
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.
 
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.
 +
 +
=== How do I mount a fresh new storage device as ext4? ===
 +
 +
For example, if the new device has been detected as /dev/sdb1 (check "dmesg" output):
 +
 +
Using the newly installed e2fsprogs:
 +
 +
cd misc/
 +
mke2fs -E test_fs /dev/sdb1
 +
cd debugfs/
 +
./debugfs -w /dev/sdb1
 +
debugfs 1.40.5 (27-Jan-2008)
 +
debugfs: set_super_value s_flags 4
 +
debugfs: quit
 +
 +
blkid /dev/sdb1
 +
/dev/sdb1: UUID="3aa983ef-0dcd-474d-a9d3-2660ff6ef3e7" TYPE="ext4dev"
 +
mkdir /mnt/test
 +
tune2fs -j /dev/sdb1
 +
mount -t ext4dev /dev/sdb1 /mnt/test
 +
df
 +
 +
=== Why do I get "EXT4-fs: sdb1: not marked OK to use with test code." in my dmesg? ===
 +
 +
This error arises from not executing the "mke2fs -E test_fs /dev/sdb1", which will label
 +
 +
=== How do I turned off the mballoc feature? ===
 +
 +
By default "mount" will enable mballoc feature when mounting.  To turn it off:
 +
 +
mount -t ext4dev -o data=writeback,delalloc,extents,nomballoc /dev/sdb1 /mnt/test
 +
 +
=== How do I turned off the extent feature? ===
 +
 +
By default "mount" will enable extent feature when mounting.  To turn it off:
 +
 +
mount -t ext4dev -o data=writeback,delalloc,noextents,mballoc /dev/sdb1 /mnt/test
 +
 +
CAUTION:  Once extent feature has been turned on, it is not possible to mount it as ext3 anymore.
 +
 +
=== Where in the source code can I see these features enabling in action? ===
 +
 +
In super.c:
 +
 +
        /*
 +
        * turn on extents feature by default in ext4 filesystem
 +
        * User -o noextents to turn it off
 +
        */
 +
        set_opt(sbi->s_mount_opt, EXTENTS);
 +
        /*
 +
        * turn on mballoc feature by default in ext4 filesystem
 +
        * User -o nomballoc to turn it off
 +
        */
 +
 +
=== Why do I get "EXT4-fs: Unrecognized mount option "delalloc" or missing value"? ===
 +
 +
Please download the ext4 version from the git patchset, instead of using the kernel source.
 +
 +
=== What is mballoc feature? After I mounted a partition as mballoc, can I remount it as nomballoc? ===
 +
 +
Yes, it is possible, just dismount the partition first, and execute "mount" with the nomballoc feature.

Revision as of 10:05, 28 March 2008

This page is a stub

You can help Ext2/3/4 Wiki by expanding it.

Contents

Getting Started

Where do I get the latest version of e2fsprogs?

The latest version of e2fsprogs can be found at Soureforge or at kernel.org.

How do I build e2fsprogs?

The INSTALL file in the top of the source tree gives more detailed information, but e2fsprogs uses a standard configure script, so the standard "./configure; make" will build the e2fsprogs binaries. Note that if you wish to build the ELF shared libraries, you need to add the "--enable-elf-shlibs" option to the configure invocation.

How do I mount a fresh new storage device as ext4?

For example, if the new device has been detected as /dev/sdb1 (check "dmesg" output):

Using the newly installed e2fsprogs:

cd misc/ mke2fs -E test_fs /dev/sdb1 cd debugfs/ ./debugfs -w /dev/sdb1 debugfs 1.40.5 (27-Jan-2008) debugfs: set_super_value s_flags 4 debugfs: quit

blkid /dev/sdb1 /dev/sdb1: UUID="3aa983ef-0dcd-474d-a9d3-2660ff6ef3e7" TYPE="ext4dev" mkdir /mnt/test tune2fs -j /dev/sdb1 mount -t ext4dev /dev/sdb1 /mnt/test df

Why do I get "EXT4-fs: sdb1: not marked OK to use with test code." in my dmesg?

This error arises from not executing the "mke2fs -E test_fs /dev/sdb1", which will label

How do I turned off the mballoc feature?

By default "mount" will enable mballoc feature when mounting. To turn it off:

mount -t ext4dev -o data=writeback,delalloc,extents,nomballoc /dev/sdb1 /mnt/test

How do I turned off the extent feature?

By default "mount" will enable extent feature when mounting. To turn it off:

mount -t ext4dev -o data=writeback,delalloc,noextents,mballoc /dev/sdb1 /mnt/test

CAUTION: Once extent feature has been turned on, it is not possible to mount it as ext3 anymore.

Where in the source code can I see these features enabling in action?

In super.c:

       /*
        * turn on extents feature by default in ext4 filesystem
        * User -o noextents to turn it off
        */
       set_opt(sbi->s_mount_opt, EXTENTS);
       /*
        * turn on mballoc feature by default in ext4 filesystem
        * User -o nomballoc to turn it off
        */

Why do I get "EXT4-fs: Unrecognized mount option "delalloc" or missing value"?

Please download the ext4 version from the git patchset, instead of using the kernel source.

What is mballoc feature? After I mounted a partition as mballoc, can I remount it as nomballoc?

Yes, it is possible, just dismount the partition first, and execute "mount" with the nomballoc feature.

Personal tools