BTRFS problem turns disk read-only

My USB disk wich hold garuda wayfire has turned read-only because of a btrfs problem.

Here is a copy of the pertinent part of the system journal :

mai 02 17:04:02 gagaruda kernel: ------------[ cut here ]------------
mai 02 17:04:02 gagaruda kernel: WARNING: CPU: 1 PID: 384 at fs/btrfs/extent-tree.c:860 lookup_inline_extent_backref+0x65c/0x6a0 [btrfs]
mai 02 17:04:02 gagaruda kernel: Modules linked in: btrfs blake2b_generic libcrc32c crc32c_generic xor raid6_pq ecb crypto_simd cryptd glue_helper xts dm_crypt cbc encrypted_keys dm_mod trusted tpm rng_core rtsx_pci_sdmmc mmc_core serio_raw atkbd libps2 rtsx_pci uas sr_mod usb_storage cdrom i8042 serio nouveau mxm_wmi wmi amdgpu gpu_sched i915 video intel_agp intel_gtt hid_logitech_hidpp hid_logitech_dj usbhid radeon i2c_algo_bit drm_ttm_helper ttm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops cec drm agpgart
mai 02 17:04:02 gagaruda kernel: CPU: 1 PID: 384 Comm: umount Not tainted 5.11.17-152-tkg-bmq #1
mai 02 17:04:02 gagaruda kernel: Hardware name: Hewlett-Packard HP Pavilion g6 Notebook PC/169B, BIOS F.34 08/16/2011
mai 02 17:04:02 gagaruda kernel: RIP: 0010:lookup_inline_extent_backref+0x65c/0x6a0 [btrfs]
mai 02 17:04:02 gagaruda kernel: Code: e9 5c fe ff ff 48 83 c1 01 48 83 f9 08 0f 85 f3 fd ff ff e9 59 fe ff ff 49 89 ed 4c 8b 7c 24 10 4c 89 e5 31 db e9 37 fc ff ff <0f> 0b b8 fb ff ff ff e9 1b fb ff ff 80 7c 24 5f bf 0f 87 30 fe ff
mai 02 17:04:02 gagaruda kernel: RSP: 0018:ffffbc2ec0b53a88 EFLAGS: 00010202
mai 02 17:04:02 gagaruda kernel: RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001
mai 02 17:04:02 gagaruda kernel: RDX: 00000000000000f5 RSI: 0000000000000004 RDI: 0000000000000000
mai 02 17:04:02 gagaruda kernel: RBP: ffff9379f8b818c0 R08: 0000000000000000 R09: ffff9379f8b818c0
mai 02 17:04:02 gagaruda kernel: R10: 0001459215d7b5c0 R11: 0000000000000000 R12: ffff9379f8b818c0
mai 02 17:04:02 gagaruda kernel: R13: ffff9379c0463ea0 R14: ffff9379ca7db800 R15: ffff9379ca7b5000
mai 02 17:04:02 gagaruda kernel: FS:  00007fe003bfd740(0000) GS:ffff937a59480000(0000) knlGS:0000000000000000
mai 02 17:04:02 gagaruda kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
mai 02 17:04:02 gagaruda kernel: CR2: 00007fe003c613f9 CR3: 000000010d662000 CR4: 00000000000006e0
mai 02 17:04:02 gagaruda kernel: Call Trace:
mai 02 17:04:02 gagaruda kernel:  ? setup_inline_extent_backref.constprop.0+0x1df/0x260 [btrfs]
mai 02 17:04:02 gagaruda kernel:  insert_inline_extent_backref+0x64/0xf0 [btrfs]
mai 02 17:04:02 gagaruda kernel:  __btrfs_inc_extent_ref.isra.0+0x98/0x270 [btrfs]
mai 02 17:04:02 gagaruda kernel:  __btrfs_run_delayed_refs+0x569/0x1000 [btrfs]
mai 02 17:04:02 gagaruda kernel:  ? __pagevec_release+0x1c/0x70
mai 02 17:04:02 gagaruda kernel:  ? __filemap_fdatawait_range+0xe5/0xf0
mai 02 17:04:02 gagaruda kernel:  btrfs_run_delayed_refs+0x64/0x1f0 [btrfs]
mai 02 17:04:02 gagaruda kernel:  btrfs_commit_transaction+0xe7/0xb30 [btrfs]
mai 02 17:04:02 gagaruda kernel:  ? kmem_cache_alloc+0x152/0x290
mai 02 17:04:02 gagaruda kernel:  ? btrfs_attach_transaction_barrier+0x1f/0x50 [btrfs]
mai 02 17:04:02 gagaruda kernel:  sync_filesystem+0x74/0x90
mai 02 17:04:02 gagaruda kernel:  generic_shutdown_super+0x22/0x100
mai 02 17:04:02 gagaruda kernel:  kill_anon_super+0x14/0x30
mai 02 17:04:02 gagaruda kernel:  btrfs_kill_super+0x12/0x20 [btrfs]
mai 02 17:04:02 gagaruda kernel:  deactivate_locked_super+0x36/0x90
mai 02 17:04:02 gagaruda kernel:  cleanup_mnt+0x12d/0x190
mai 02 17:04:02 gagaruda kernel:  task_work_run+0x5c/0x90
mai 02 17:04:02 gagaruda kernel:  exit_to_user_mode_prepare+0x158/0x160
mai 02 17:04:02 gagaruda kernel:  syscall_exit_to_user_mode+0x23/0x50
mai 02 17:04:02 gagaruda kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xa9
mai 02 17:04:02 gagaruda kernel: RIP: 0033:0x7fe003cff08b
mai 02 17:04:02 gagaruda kernel: Code: 1d 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 90 f3 0f 1e fa 31 f6 e9 05 00 00 00 0f 1f 44 00 00 f3 0f 1e fa b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 8b 15 b1 1d 0c 00 f7 d8
mai 02 17:04:02 gagaruda kernel: RSP: 002b:00007ffc1b3ee798 EFLAGS: 00000202 ORIG_RAX: 00000000000000a6
mai 02 17:04:02 gagaruda kernel: RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000558d542b9b30
mai 02 17:04:02 gagaruda kernel: RBP: 0000558d542b9b50 R08: 0000000000000000 R09: 0000000000000003
mai 02 17:04:02 gagaruda kernel: R10: fffffffffffffb87 R11: 0000000000000202 R12: 0000558d542b9ad0
mai 02 17:04:02 gagaruda kernel: R13: 0000558d542b9b30 R14: 0000000000000000 R15: 00007ffc1b3ee9a8
mai 02 17:04:02 gagaruda kernel: ---[ end trace a338d5dfea986ad7 ]---

After booting from the laptop disk on my other linux (opensuse tumbleweed), I haved tried a "btrfsck" and it abended with the following message :

I had many blocks with the following message

type WARNING: tree block [17807228928, 17807245312) crosses 64K page boudnary, may cause problem for 64K page system

then the rest goes :
[3/7] checking free space cache
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups
check/qgroup-verify.c:546: account_all_refs: BUG_ON `ref->num_bytes != num_bytes` triggered, value 1
btrfs check(+0x1f7d0)[0x55d239cc57d0]
btrfs check(qgroup_verify_all+0x643)[0x55d239cc7483]
btrfs check(+0x4a4ca)[0x55d239cf04ca]
btrfs check(main+0x90)[0x55d239cbde00]
/lib64/libc.so.6(__libc_start_main+0xd5)[0x7f6cb88ecb25]
btrfs check(_start+0x2e)[0x55d239cbe13e]
Aborted (core dumped)
or paste code here

The last dump from the btrfsck is similar from the first dump showed in this post.

What should I do with that ??? I'm really puzzle. I have all the data on my laptop disk. The USB disk is more a backup disk with Garuda wayfire installed and a large subvolume for backups. I'm having big doubts now on BTRFS , is my disk broken ??? Is my data in danger ???

Regards,
BT

Just live boot into bootable USB pen drive and try formatting BTRFS partition (only the one with Garuda wayfire) using gparted.
Also, see if in Live media, you can transfer data from your USB disk to laptop disk. I think that only the BTRFS partition that contains the OS should be affected.

Also, post inxi -Fxxza . It is very important to see that.

1 Like

I have only one btrfs partition with subvolumes for root, home, cache, log, tmp...

I really would like not to reformat. If I'm to reformat, I would think twice before sticking to BTRFS ...

Thanks,
BT

Okay, do not format, but at least check if you can transfer files between USB drive and laptop drive using live medium.

Also, you should know that OS and data must be on different partitions. unless you are compelled to do them on same partition (And I don't see why you will be compelled)

And also post
lsblk

1 Like

Hello @PerfMonk ,

Could you please show the output of

btrfs filesystem show

as well?

Thx

2 Likes

pssst....

prepend sudo to above command. :wink:

3 Likes

Here is the result :

#linux-0rk5:~ # btrfs filesystem show /run/media/bt/b1377a2e-14fe-433a-b268-2fee065f1fc1
Label: none uuid: b1377a2e-14fe-433a-b268-2fee065f1fc1
Total devices 1 FS bytes used 248.99GiB
devid 1 size 922.51GiB used 279.52GiB path /dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b

Here is lsblk

linux-0rk5:~ # lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 931.5G 0 disk
├─sdb1 8:17 0 922.5G 0 part
│ └─luks-18c56783-809e-43cd-b687-7377c138a95b 254:5 0 922.5G 0 crypt /run/media/bt/b1377a2e-14fe-433a-b268-2fee065f1fc1
└─sdb3 8:19 0 9G 0 part
└─luks-5c0d8e1e-f391-48d7-b32d-32bbfdb61f83 254:4 0 9G 0 crypt

The second partition is the encrypted swap.

The last "big" update had the same result for me. I didn't try to fix it for long and reset the whole system with the newest garuda image. (I have my files at another drive. So, that comes in handy.)

Today I saw an update of the btrfs-utils in version 5.12. That might cause issues, when one uses a 5.12 kernel while the filessytem-utils still run with 5.11? Just a thought...