4

I am on a test VM where I am trying to convert a second disk to btrfs.

The conversion fails with the error missing data block for bytenr 1048576 (see below).

I couldn't find any information about the error. What can I do to fix this?

$ fsck -f /dev/sdb1
fsck from util-linux 2.35.2
e2fsck 1.45.6 (20-Mar-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 150510/4194304 files (0.5% non-contiguous), 2726652/16777216 blocks

$ btrfs-convert /dev/sdb1
create btrfs filesystem:
        blocksize: 4096
        nodesize:  16384
        features:  extref, skinny-metadata (default)
        checksum:  crc32c
creating ext2 image file
ERROR: missing data block for bytenr 1048576
ERROR: failed to create ext2_saved/image: -2
WARNING: an error occurred during conversion, filesystem is partially created but not finalized and not mountable

2 Answers 2

4

It was a bug

Now we have pinned down the bug, it's a bit overflow for multiplying unsigned int.

Also see:

As a workaround you can resize your filesystem to something smaller/larger before the conversion.

4
  • Great - this fix works for me. As the fix isnt released yet, could you add these links to your answer? github.com/kdave/btrfs-progs/commit/… and spinics.net/lists/linux-btrfs/msg103379.html
    – dcorking
    Commented Sep 5, 2020 at 20:05
  • OK - also see my workaround.
    – laktak
    Commented Sep 5, 2020 at 20:33
  • I applied the patch to btrfs-progs v5.7 (git cherry-pick) and recompiled it on Ubuntu Groovy: btrfs-convert ran cleanly. I am not sure I understand the workaround. I had a roughly 250 GB ext4 filesystem with about 111 GB of data. The thread from the patch author suggests that the overflow occurs for filesystems bigger than 64 GB. Do you mean move my data off the disk, to make the ext4 filesystem smaller than 64 GB?
    – dcorking
    Commented Sep 5, 2020 at 20:41
  • 1
    No, I resized the disk from 64 to 100GB on one machine, 70 on the other. That allowed me to run the conversion without errors.
    – laktak
    Commented Sep 5, 2020 at 21:11
0

Bug is present in btrfs-progs version 5.7 (default in, e.g. Ubuntu 20.10) and occurs on other sizes as well (here I have a 457.26 GiB drive). Upgrading to later versions of btrfs-progs (e.g., 5.10, from Ubuntu 21.04) fixes the problem.

EDIT: This is not recommended as a production solution (kernel/btrfs-progs version mismatch), but it can get you out of a tricky situation. Better to use a recovery system that has the new version already.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .