Skip to content

dm-crypt corruption issues (?) #200

@flokli

Description

@flokli

In the last few days I've been running into a bunch of btrfs corruption issues on my Macbook M2 Air. I initially suspected a single fluke, but it got worse.

Yesterday I entirely re-created the filesystem (luks with --allow-discards), then mkfs.btrfs with default params, and again got btrfs errors.

It seems I can rule out the internal SSD internal, as the same issues also happens on a (somewhat reliable and fast) external SSD (formatted with LUKS and btrfs).

Opening filesystem to check...
Checking filesystem on /dev/mapper/usb
UUID: a4d7d051-44ee-4512-bcfd-3b634526b02a
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space tree
[4/7] checking fs roots
[5/7] checking csums against data
mirror 1 bytenr 23302864896 csum 0xc296d77c expected csum 0xe5e91fb3
ERROR: errors found in csum tree
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)
found 42043219968 bytes used, error(s) found
total csum bytes: 40380008
total tree bytes: 685703168
total fs tree bytes: 570392576
total extent tree bytes: 63324160
btree space waste bytes: 119804959
file data blocks allocated: 41357516800
 referenced 41357484032

This was after copying my /nix/store from the host to /mnt, and unmounting.

dmesg of the host:

    6.192083] BTRFS: device label root devid 1 transid 41 /dev/disk/by-label/root scanned by mount (530)
[    6.192241] BTRFS info (device dm-0): first mount of filesystem 5eaac3f0-833c-4f0f-b6f5-df3eb94e4327
[    6.192248] BTRFS info (device dm-0): using crc32c (crc32c-generic) checksum algorithm
[    6.192252] BTRFS info (device dm-0): forcing free space tree for sector size 4096 with page size 16384
[    6.192254] BTRFS info (device dm-0): using free-space-tree
[    6.192254] BTRFS warning (device dm-0): read-write for sector size 4096 with page size 16384 is experimental
[    6.200521] BTRFS info (device dm-0): checking UUID tree
[    6.740028] systemd-journald[807]: Creating journal file /var/log/journal/bbe02739e577495c999bfebef448138d/system.journal on a btrfs file system, and copy-on-write is enabled. This is likely to slow down journal access substantially, please consider turning off the copy-on-write file attribute on the journal directory, using chattr +C.
[    6.817857] BTRFS info: devid 1 device path /dev/disk/by-label/root changed to /dev/dm-0 scanned by (udev-worker) (936)
[ 7896.890101] BTRFS: device fsid a4d7d051-44ee-4512-bcfd-3b634526b02a devid 1 transid 6 /dev/mapper/usb scanned by mount (17224)
[ 7896.890774] BTRFS info (device dm-2): first mount of filesystem a4d7d051-44ee-4512-bcfd-3b634526b02a
[ 7896.890802] BTRFS info (device dm-2): using crc32c (crc32c-generic) checksum algorithm
[ 7896.890811] BTRFS info (device dm-2): forcing free space tree for sector size 4096 with page size 16384
[ 7896.890816] BTRFS info (device dm-2): using free-space-tree
[ 7896.890819] BTRFS warning (device dm-2): read-write for sector size 4096 with page size 16384 is experimental
[ 7896.892854] BTRFS info (device dm-2): checking UUID tree
[ 7896.893323] BTRFS info (device dm-2): last unmount of filesystem a4d7d051-44ee-4512-bcfd-3b634526b02a
[ 7902.339423] BTRFS: device fsid a4d7d051-44ee-4512-bcfd-3b634526b02a devid 1 transid 8 /dev/mapper/usb scanned by mount (17294)
[ 7902.340267] BTRFS info (device dm-2): first mount of filesystem a4d7d051-44ee-4512-bcfd-3b634526b02a
[ 7902.340294] BTRFS info (device dm-2): using crc32c (crc32c-generic) checksum algorithm
[ 7902.340303] BTRFS info (device dm-2): forcing free space tree for sector size 4096 with page size 16384
[ 7902.340308] BTRFS info (device dm-2): using free-space-tree
[ 7902.340312] BTRFS warning (device dm-2): read-write for sector size 4096 with page size 16384 is experimental
[ 8089.623727] BTRFS warning (device dm-0): csum failed root 5 ino 978709 off 1253376 csum 0x81dd87df expected csum 0xe77556aa mirror 1
[ 8089.623738] BTRFS error (device dm-0): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 1, gen 0
[ 8320.442776] BTRFS warning (device dm-0): csum failed root 5 ino 807754 off 49152 csum 0x579bee4a expected csum 0x8a36f543 mirror 1
[ 8320.442794] BTRFS error (device dm-0): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 2, gen 0
[ 8320.450734] BTRFS warning (device dm-0): csum failed root 5 ino 807754 off 94208 csum 0x857c0a3b expected csum 0xc3bf7a9c mirror 1
[ 8320.450739] BTRFS error (device dm-0): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 3, gen 0
[ 8320.462502] BTRFS warning (device dm-0): csum failed root 5 ino 807754 off 49152 csum 0x579bee4a expected csum 0x8a36f543 mirror 1
[ 8320.462507] BTRFS error (device dm-0): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 4, gen 0
[ 8320.470859] BTRFS warning (device dm-0): csum failed root 5 ino 807754 off 49152 csum 0x579bee4a expected csum 0x8a36f543 mirror 1
[ 8320.470866] BTRFS error (device dm-0): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 5, gen 0
[ 8336.179155] BTRFS warning (device dm-0): checksum verify failed on logical 1039695872 mirror 1 wanted 0x9e547725 found 0x87cd70c6 level 0
[ 8336.179673] BTRFS info (device dm-0): read error corrected: ino 0 off 1039695872 (dev /dev/dm-0 sector 2047040)
[ 8651.859183] BTRFS info (device dm-2): last unmount of filesystem a4d7d051-44ee-4512-bcfd-3b634526b02a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions