From: Christian Zangl <coralllama@gmail.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>, linux-btrfs@vger.kernel.org
Subject: Re: "missing data block" when converting ext4 to btrfs
Date: Tue, 14 Jul 2020 11:33:41 +0200 [thread overview]
Message-ID: <409fb0aa-7c7f-db52-6442-d746b9944fa3@gmail.com> (raw)
In-Reply-To: <b49c8f68-5897-7bc1-21d5-03125e798a76@gmx.com>
On 2020-07-14 10:09, Qu Wenruo wrote:
>
>
> On 2020/7/14 下午3:58, Christian Zangl wrote:
>> On 2020-07-14 08:10, Qu Wenruo wrote:
>>>
>>>
>>> On 2020/7/14 上午3:46, Christian Zangl wrote:
>>>> 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
>>>
>>> Can btrfs-convert -r rollback the fs?
>>
>> No:
>>
>> $ sudo btrfs-convert -r /dev/sdb1
>> No valid Btrfs found on /dev/sdb1
>> ERROR: unable to open ctree
>> ERROR: rollback failed
>>
>> If I do `fsck -f /dev/sdb1` I get lots of errors:
>>
>> t-arch:~$ sudo fsck -f /dev/sdb1
>> fsck from util-linux 2.35.2
>> e2fsck 1.45.6 (20-Mar-2020)
>> Resize inode not valid. Recreate<y>? yes
>> Pass 1: Checking inodes, blocks, and sizes
>> Deleted inode 3681 has zero dtime. Fix<y>? yes
>> Inodes that were part of a corrupted orphan linked list found. Fix<y>? yes
>> Inode 3744 was part of the orphaned inode list. FIXED.
>> Deleted inode 3745 has zero dtime. Fix<y>? yes
>> Inode 3747 has INLINE_DATA_FL flag on filesystem without inline data
>> support.
>> Clear<y>? yes
>> Inode 3748 was part of the orphaned inode list. FIXED.
>> Inode 3748 has a extra size (6144) which is invalid
>> Fix<y>? yes
>> Inode 3751 is in use, but has dtime set. Fix<y>? yes
>> Inode 3751 has imagic flag set. Clear<y>? yes
>> Inode 3752 was part of the orphaned inode list. FIXED.
>> Inode 3753 was part of the orphaned inode list. FIXED.
>> Inode 3754 is in use, but has dtime set. Fix<y>? yes
>> Inode 3755 was part of the orphaned inode list. FIXED.
>> Inode 3755 has imagic flag set. Clear ('a' enables 'yes' to all) <y>? yes
>> Deleted inode 3801 has zero dtime. Fix ('a' enables 'yes' to all) <y>?
>> ...
>
> This sounds like the cause.
>
> As btrfs completely rely on the used space reported from ext*, and if
> the fs is corrupted, then a lot of things can go wrong.
No, maybe you missed it but I did a fsck before the convert (see above).
It reported no errors.
Only after the failed btrfs-convert I get the errors.
>>
>>> If you can rollback, would you provide the ext4 fs image?
>>
>> You mean the vmdk from VMware? I do have a backup.
>
> Would you mind to run e2fsck on the backup first to see if that's the
> problem?
The backup has no fsck issues.
> If the fixed fs can not pass btrfs-convert still, would you mind to send
> the fs image?
How/where would you like me to send it?
Thanks, Christian
>
> Thanks,
> Qu
>
>>
>> Thanks!
>>
>> Christian
>>
>>>
>>> Thanks,
>>> Qu
>>>
>>>>
>>>> $ uname -a
>>>> Linux t-arch 5.7.7-arch1-1 #1 SMP PREEMPT Wed, 01 Jul 2020 14:53:16
>>>> +0000 x86_64 GNU/Linux
>>>>
>>>> $ btrfs --version
>>>> btrfs-progs v5.7
>>>
>>
>
next prev parent reply other threads:[~2020-07-14 9:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-13 19:46 "missing data block" when converting ext4 to btrfs Christian Zangl
2020-07-14 6:10 ` Qu Wenruo
2020-07-14 7:58 ` Christian Zangl
2020-07-14 8:09 ` Qu Wenruo
2020-07-14 9:33 ` Christian Zangl [this message]
2020-07-14 10:10 ` Qu Wenruo
2020-07-15 7:22 ` Christian Zangl
2020-07-20 12:56 ` Qu Wenruo
2020-07-20 19:33 ` Christian Zangl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=409fb0aa-7c7f-db52-6442-d746b9944fa3@gmail.com \
--to=coralllama@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox