Public bug reported:
Hello!
Btrfs-convert fails to convert and corrupts an EXT4 filesystem, please see the example below. The kernel developers are aware of this problem and the fix has been applied after the current 5.7.1 version. Please apply the patch or jump to the fixed version in the repo.
I used the btrfs-progs_5.10-1_amd64.deb package from the dev branch and it worked!
Regards
https://github.com/kdave/btrfs-progs/commit/c9c4eb1f3fd343512d50b075b40bba656cbd02cb
https://bugzilla.kernel.org/show_bug.cgi?id=206995
https://www.spinics.net/lists/linux-btrfs/msg103379.html
xubuntu at xubuntu:/tmp$ sudo btrfs-convert /dev/nvme0n1p1
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
xubuntu at xubuntu:/tmp$ sudo fsck.ext4 -f -y /dev/nvme0n1p1
.
.
.
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Inode 4001 (...) is an illegal FIFO.
Clear? yes
Inode 4002 (...) has invalid mode (00).
Clear? yes
Inode 4003 ref count is 192, should be 1. Fix? yes
Inode 4005 (...) has invalid mode (00).
Clear? yes
Pass 5: Checking group summary information
Free blocks count wrong for group #0 (75, counted=76).
Fix? yes
Free blocks count wrong (31948715, counted=31948716).
Fix? yes
Free inodes count wrong for group #0 (962, counted=959).
Fix? yes
Free inodes count wrong (12276349, counted=12276346).
Fix? yes
/dev/nvme0n1p1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/nvme0n1p1: 830854/13107200 files (0.3% non-contiguous), 20480084/52428800 blocks
** Affects: btrfs-tools (Ubuntu)
Importance: Undecided
Status: New
** Tags: btrfs btrfs-convert bug convert corrupt ext4 filesystem
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to btrfs-tools in Ubuntu.
https://bugs.launchpad.net/bugs/1913527
Title:
btrfs-convert fails and corrupts ext4 FS because of bit overflow
Status in btrfs-tools package in Ubuntu:
New
Bug description:
Hello!
Btrfs-convert fails to convert and corrupts an EXT4 filesystem, please see the example below. The kernel developers are aware of this problem and the fix has been applied after the current 5.7.1 version. Please apply the patch or jump to the fixed version in the repo.
I used the btrfs-progs_5.10-1_amd64.deb package from the dev branch and it worked!
Regards
https://github.com/kdave/btrfs-progs/commit/c9c4eb1f3fd343512d50b075b40bba656cbd02cb
https://bugzilla.kernel.org/show_bug.cgi?id=206995
https://www.spinics.net/lists/linux-btrfs/msg103379.html
xubuntu at xubuntu:/tmp$ sudo btrfs-convert /dev/nvme0n1p1
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
xubuntu at xubuntu:/tmp$ sudo fsck.ext4 -f -y /dev/nvme0n1p1
.
.
.
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Inode 4001 (...) is an illegal FIFO.
Clear? yes
Inode 4002 (...) has invalid mode (00).
Clear? yes
Inode 4003 ref count is 192, should be 1. Fix? yes
Inode 4005 (...) has invalid mode (00).
Clear? yes
Pass 5: Checking group summary information
Free blocks count wrong for group #0 (75, counted=76).
Fix? yes
Free blocks count wrong (31948715, counted=31948716).
Fix? yes
Free inodes count wrong for group #0 (962, counted=959).
Fix? yes
Free inodes count wrong (12276349, counted=12276346).
Fix? yes
/dev/nvme0n1p1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/nvme0n1p1: 830854/13107200 files (0.3% non-contiguous), 20480084/52428800 blocks
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/btrfs-tools/+bug/1913527/+subscriptions