Years ago I was curious about btrfs and converted one of my virtuals machines to use it. The virtual in question had used ext4 before and was converted in-place into btrfs. Later on it was learned this was in fact a bad idea as the btrfs conversion tool seems to be a gamble on data integrity.
Anyway, this system ran with converted btrfs for years, during which time I had learned that btrfs created from scratch was pretty decent for some things, but the converted ones wouldn't pass btrfs' fsck even when they would pass online scrub. This virtual was one of those cases and I decided to migrate the existing filesystem's content onto a freshly created one on file level.
Just out of curiosity, I ran btrfs check on it and it was just what I had encountered before:
# btrfs check /dev/xvdb1
Opening filesystem to check...
Checking filesystem on /dev/xvdb1
UUID: 8c7512e2-3613-474d-9234-835a57b6f896
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space cache
[4/7] checking fs roots
root 5 inode 1177668 errors 8000, inline file extent too large
root 5 inode 1177752 errors 8000, inline file extent too large
--- bazillion lines cut ---
root 5 inode 1831684 errors 8000, inline file extent too large
root 5 inode 2878563 errors 8000, inline file extent too large
ERROR: errors found in fs roots
found 7227060224 bytes used, error(s) found
total csum bytes: 6377088
total tree bytes: 159498240
total fs tree bytes: 132104192
total extent tree bytes: 16334848
btree space waste bytes: 40630997
file data blocks allocated: 120313016320
referenced 6451007488
While the errors are numerous and scary, there's apparently no data loss. I created a fresh btrfs filesystem, mounted them both and then created one monster of a rsync command:
rsync -axHAWXS --numeric-ids --progress /mnt/source/ /mnt/target/
After rsync was finished, I just had to use grub-install to write a new boot track on the freshly created virtual disk and this Debian 11 based system booted off fine and continues collecting data with Munin.
No comments:
Post a Comment