Control: reasign -1 fsarchiver

Michael Biebl <[email protected]> writes:

> On Thu, 23 Jul 2026 19:02:23 +0200 Michael Biebl <[email protected]> wrote:
>
>> < interestingly, running it once again then works again >
>> 
>> # mkfs.btrfs -f -q -L Test -U 'f42896b1-3815-4e1e-a01a-9261c5bab6f8' $DEVICE
>> ERROR: superblock magic doesn't match

I get this:

# mkfs.btrfs -f -q -L Test -U 'f42896b1-3815-4e1e-a01a-9261c5bab6f8' $DEVICE
ERROR: cannot open device '/dev/loop0': Device or resource busy
ERROR: open ctree failed
# mkfs.btrfs -f -q -L Test -U 'f42896b1-3815-4e1e-a01a-9261c5bab6f8' $DEVICE
ERROR: superblock magic doesn't match
# mkfs.btrfs -f -q -L Test -U 'f42896b1-3815-4e1e-a01a-9261c5bab6f8' $DEVICE
ERROR: cannot open device '/dev/loop0': Device or resource busy
ERROR: open ctree failed
# sync  # and wait a few seconds
# mkfs.btrfs -f -q -L Test -U 'f42896b1-3815-4e1e-a01a-9261c5bab6f8' $DEVICE
ERROR: superblock magic doesn't match

And the pattern repeats infinitely.

>
> It does output an error here, but the resulting fs has the correct UUID, 
> btrfsck does not complain and the fs can be mounted successfully.
> The return code is also "0".
>
> So it looks like "ERROR: superblock magic doesn't match" can be ignored?

You're inducing a UUID collision, and this was a fs corruption footgun
until the kernel introduced a check for it.  UUIDs are supposed to be
unique, by definition, and you need to wipefs -a $DEVICE to eliminate
this collision before the second mkfs.  I'm reassigning this bug to
fsarchiver, because it should be running wipefs before mkfs.  As an
asside, this is also best practices when changing filesystems.

Best,
Nicholas

Attachment: signature.asc
Description: PGP signature

Reply via email to