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

Tagged Linux

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!

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Related posts:

  1. PPC Mac partition oddity
  2. Canon Powershot A60 on Debian
  3. Using any Debian box as a wireless access point

11 Comments

  • Posted by Arix on 15. September 2009 at 15:45.

    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 (“/”).

    • Posted by nicolas on 15. September 2009 at 15:52.

      Nice, I didn’t know about the search functionality in menuconfig yet. Thanks for pointing that out!

  • Posted by Arix on 15. September 2009 at 15:46.

    I forgot to add, that I too was custom building the kernel version 2.6.31 (on an old Toshiba laptop).

    Thank you

  • Posted by gg on 22. October 2009 at 20:24.

    thanks. this saved me an headache :/
    I guess the feature should be automatically flagged whenever ext4 is selected.

    • Posted by Nicolas on 23. October 2009 at 09:55.

      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.

  • Posted by Alessandro Selli on 8. December 2009 at 20:37.

    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.

  • Posted by Marcus H on 20. December 2009 at 12:24.

    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.

  • Posted by Slava on 31. March 2010 at 20:37.

    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.

    • Posted by Nicolas on 31. March 2010 at 23:18.

      You can boot off a different device, some kind of rescue CD would probably be the easiest.

  • Posted by Zornitsa on 9. May 2010 at 17:28.

    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 :) ))

Leave a Reply

Your email is never shared. Required fields are marked *

*
*