Filesystem with huge files cannot be mounted read-write without CONFIG_LBDAF

After skipping 2.6.30 and building a new 2.6.31 I suddenly couldn't mount my ext4 drive anymore and got this rather confusing error in dmesg:

EXT4-fs (sda1): Filesystem with huge files cannot be mounted
read-write without CONFIG_LBDAF

But... I don't have any huge files on that disk. Not bigger than some DVD iso anyway.After a few days I finally get the time to check the kernel configuration docs, and they say:

CONFIG_LBDAF:Enable block devices or files of size 2TB and larger.This option is required to support the full capacity of large
(2TB+) block devices, including RAID, disk, Network Block
Device, Logical Volume Manager (LVM) and loopback.This option also enables support for single files larger than
2TB.The ext4 filesystem requires that this feature be enabled in
order to support filesystems that have the huge_file feature
enabled.  Otherwise, it will refuse to mount in the read-write
mode any filesystems that use the huge_file feature, which is
enabled by default by mke2fs.ext4.The GFS2 filesystem also requires this feature.If unsure, say Y.

Well, alright. mkfs.ext4 has said feature enabled by default. That's what you get for building your own kernels and not reading everything in make oldconfig.

Edit: The feature can be activated at Enable the block layer ---> Support for large (2TB+) block devices and files, thanks to Arix.Edit:: The feature can be removed from an existing filesystem by running the following commands: tune2fs -O ^huge_file /dev/whatever fsck /dev/whatever
This should allow you to mount the drive without CONFIG_LBDAF in the kernel. Thanks Marcus!

Published on Sept. 14, 2009 at 5:43 p.m. by Nicolas and tagged kernel, Linux, ext4. You can follow the discussion with the comment feed for this post.

12 comments

  • avatar
    Arix wrote this comment on Sept. 15, 2009, 3:45 p.m.
    What are the odds? I was just custom building my kernel last night (9/14/2009) and skipped this flag because my laptop has less than 10 GB dedicated to Linux and "large" files over 2TB sounded unattainable. But, like the author, not reading the entire help description and formatting the partitions with ext4, during the kernel boot message I noticed a lot of FATAL messages are being thrown around. Of course, not a single partition was mounted due to this foible, and I couldn't even run the simplest programs (no /usr, no /home, no nothing). For those that have made a similar error like we did, the location of this feature is at: Enable the block layer -> Enable block devices or files of size 2TB and larger Enable it for your own sake of sanity. Of course, you could have just simply `grep' the ".config" file for "CONFIG_LBDAF" or search for it in menuconfig' help console ("/").
    Reply to this comment
    • avatar
      nicolas wrote this comment on Sept. 15, 2009, 3:52 p.m.
      Nice, I didn't know about the search functionality in menuconfig yet. Thanks for pointing that out!
      Reply to this comment
  • avatar
    Arix wrote this comment on Sept. 15, 2009, 3:46 p.m.
    I forgot to add, that I too was custom building the kernel version 2.6.31 (on an old Toshiba laptop). Thank you
    Reply to this comment
  • avatar
    gg wrote this comment on Oct. 22, 2009, 8:24 p.m.
    thanks. this saved me an headache :/ I guess the feature should be automatically flagged whenever ext4 is selected.
    Reply to this comment
    • avatar
      Nicolas wrote this comment on Oct. 23, 2009, 9:55 a.m.
      Indeed, the fooconfig targets offer dependency checking. But I guess the kernel hackers have their reasons for not enabling it, after all not everybody uses the same mkfs options.
      Reply to this comment
  • avatar
    Alessandro Selli wrote this comment on Dec. 8, 2009, 8:37 p.m.
    Since the problem is caused by mke2fs.ext4 that by default formats with the huge_file feature on, one can format a new partition giving a set of features that overrides the default and that does not include the huge_file one: mke2fs -t ext4 -O has_journal,extents,flex_bg,uninit_bg,dir_nlink,extra_isize Or, one could edit the /etc/mke2fs.conf file and remove the huge_file feature among the default ones, as I did on my Gentoo desktop. I don't know if one can change the features without reformatting and already formatted partition, though.
    Reply to this comment
  • avatar
    Marcus H wrote this comment on Dec. 20, 2009, 12:24 p.m.
    For removing the huge_file option from the filesystem without destroying it you can use this command tune2fs -O ^huge_file /dev/sda1 then run fsck /dev/sda1 and it should mount without CONFIG_LBDAF in your kernel.
    Reply to this comment
  • avatar
    Slava wrote this comment on March 31, 2010, 8:37 p.m.
    sorry for a lame question, but what if it is my root partition? tune2fs is unable to clear huge_file flag from it when it mounted, and I can not remount it read-only.
    Reply to this comment
    • avatar
      Nicolas wrote this comment on March 31, 2010, 11:18 p.m.
      You can boot off a different device, some kind of rescue CD would probably be the easiest.
      Reply to this comment
  • avatar
    Zornitsa wrote this comment on May 9, 2010, 5:28 p.m.
    Thanks for the post. Figured that one myself the hard way -- been configuring kernel all weekend :( But you know nothing before you've messed a couple of kernels :)))
    Reply to this comment
  • avatar
    Eric wrote this comment on Nov. 28, 2010, 2:33 a.m.
    Thanks!! :D
    Reply to this comment

Start a new thread

Cancel reply
Markdown. Syntax highlighting with <code lang="php"><?php echo "Hello, world!"; ?></code> etc.