I have an encrypted USB disk formatted with BTRFS with many subvolumes on it (and another linux distro).
I mount it on my Tumbleweed to take backups. But I have a BTRFS error that set the disk drive read only.
Here are the extract of the systemd log :
[HR][/HR][FONT=courier new]May 03 10:55:28 linux-0rk5 kernel: BTRFS info (device dm-5): disk space caching is enabled
May 03 10:55:28 linux-0rk5 kernel: BTRFS info (device dm-5): has skinny extents
May 03 10:55:30 linux-0rk5 kernel: BTRFS info (device dm-5): checking UUID tree
May 03 10:55:30 linux-0rk5 udisksd[2191]: Mounted /dev/dm-5 at /run/media/bt/b1377a2e-14fe-433a-b268-2fee065f1fc1 on behalf of uid 1000
May 03 10:55:30 linux-0rk5 kernel: BTRFS info (device dm-5): devid 1 device path /dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b changed to /dev/dm-5 scanned by systemd-udevd (12774)
May 03 10:55:30 linux-0rk5 kernel: BTRFS info (device dm-5): devid 1 device path /dev/dm-5 changed to /dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b scanned by systemd-udevd (12774)
May 03 10:55:31 linux-0rk5 kernel: BTRFS info (device dm-5): balance: resume -dusage=5
May 03 10:55:31 linux-0rk5 kernel: BTRFS info (device dm-5): relocating block group 7815036928 flags data
May 03 10:55:34 linux-0rk5 kernel: BTRFS info (device dm-5): found 395 extents, stage: move data extents
May 03 10:55:35 linux-0rk5 kernel: ------------ cut here ]------------
May 03 10:55:35 linux-0rk5 kernel: WARNING: CPU: 0 PID: 12794 at fs/btrfs/extent-tree.c:862 lookup_inline_extent_backref+0x65c/0x6a0 [btrfs]
May 03 10:55:35 linux-0rk5 kernel: Modules linked in: uas usb_storage ccm rfcomm nft_objref nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_REJECT xt_geoip(O) nft_fib_inet nft_fib_ipv4 nf>
May 03 10:55:35 linux-0rk5 kernel: ** snd_hda_codec irqbypass hp_wmi joydev wmi_bmof sparse_keymap snd_hda_core pcspkr rfkill libarc4 r8169 snd_hwdep thermal snd_pcm realtek mdio_devres snd_ti**>
May 03 10:55:35 linux-0rk5 kernel: CPU: 0 PID: 12794 Comm: btrfs-balance Tainted: G W O 5.12.0-1-default #1 openSUSE Tumbleweed
May 03 10:55:35 linux-0rk5 kernel: Hardware name: Hewlett-Packard HP Pavilion g6 Notebook PC/169B, BIOS F.34 08/16/2011
May 03 10:55:35 linux-0rk5 kernel: RIP: 0010:lookup_inline_extent_backref+0x65c/0x6a0 [btrfs]
May 03 10:55:35 linux-0rk5 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 >
May 03 10:55:35 linux-0rk5 kernel: RSP: 0018:ffffaf7302403940 EFLAGS: 00010202
May 03 10:55:35 linux-0rk5 kernel: RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001
May 03 10:55:35 linux-0rk5 kernel: RDX: 00000000000000f5 RSI: 0000000000000004 RDI: 0000000000000000
May 03 10:55:35 linux-0rk5 kernel: RBP: ffff8ce40633f310 R08: 0000000000000000 R09: ffff8ce40633f310
May 03 10:55:35 linux-0rk5 kernel: R10: 00015953ed6426d0 R11: 0000000000000000 R12: ffff8ce40633f310
May 03 10:55:35 linux-0rk5 kernel: R13: ffff8ce3c04c0680 R14: ffff8ce2ce489000 R15: ffff8ce3e1d60000
May 03 10:55:35 linux-0rk5 kernel: FS: 0000000000000000(0000) GS:ffff8ce459400000(0000) knlGS:0000000000000000
May 03 10:55:35 linux-0rk5 kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
May 03 10:55:35 linux-0rk5 kernel: CR2: 00007f53c1b37008 CR3: 00000000b5e10000 CR4: 00000000000006f0
May 03 10:55:35 linux-0rk5 kernel: Call Trace:
May 03 10:55:35 linux-0rk5 kernel: ** ? setup_inline_extent_backref.constprop.0+0x1df/0x260 [btrfs]
May 03 10:55:35 linux-0rk5 kernel: ** insert_inline_extent_backref+0x5b/0xf0 [btrfs]
May 03 10:55:35 linux-0rk5 kernel: ** __btrfs_inc_extent_ref.isra.0+0x81/0x260 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** ? kmem_cache_free+0x40a/0x440**
May 03 10:55:35 linux-0rk5 kernel: ** ? __btrfs_run_delayed_refs+0xfbd/0x1010 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** __btrfs_run_delayed_refs+0x598/0x1010 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** ? kmem_cache_free+0x103/0x440**
May 03 10:55:35 linux-0rk5 kernel: ** btrfs_run_delayed_refs+0x73/0x1f0 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** btrfs_commit_transaction+0x6f/0xaa0 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** ? btrfs_update_reloc_root+0x1ca/0x240 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** prepare_to_merge+0x21e/0x250 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** relocate_block_group+0x2d3/0x5e0 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** btrfs_relocate_block_group+0x15d/0x300 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** btrfs_relocate_chunk+0x27/0xc0 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** btrfs_balance+0x6f7/0xec0 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** ? btrfs_balance+0xec0/0xec0 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** balance_kthread+0x35/0x50 [btrfs]**
May 03 10:55:35 linux-0rk5 kernel: ** kthread+0x11b/0x140**
May 03 10:55:35 linux-0rk5 kernel: ** ? __kthread_bind_mask+0x60/0x60**
May 03 10:55:35 linux-0rk5 kernel: ** ret_from_fork+0x22/0x30**
May 03 10:55:35 linux-0rk5 kernel: — end trace 8ec11e5725b0ca96 ]—
May 03 10:55:35 linux-0rk5 kernel: BTRFS: error (device dm-5) in btrfs_run_delayed_refs:2159: errno=-5 IO failure
May 03 10:55:35 linux-0rk5 kernel: BTRFS info (device dm-5): forced readonly
May 03 10:55:35 linux-0rk5 kernel: BTRFS info (device dm-5): balance: ended with status: -30
[/FONT][HR][/HR]
I have tried to btrfsck the disk but it abend with the same error message.
I have a copy of everything from this disk on my laptop disk since its a backup.
This is an almost new 1 Tb USB disk and it shouldn’t be faulty.
Any advices ? I’m not sure of what are my options to save the data.
and this does make me have some doubts about BTRFS .
I’m not an expert at BTRFS anybody here would have some clues ???
regards,
BT :’(
PS: It has a lot of free space on it and the device doesn’t report any IO errors.
[HR][/HR][FONT=courier new]linux-0rk5:/home/bt/bin # btrfs filesystem usage /run/media/bt/b1377a2e-14fe-433a-b268-2fee065f1fc1
Overall:
Device size: 922.51GiB
Device allocated: 279.52GiB
Device unallocated: 642.99GiB
Device missing: 0.00B
Used: 250.80GiB
Free (estimated): 669.82GiB (min: 348.32GiB)
Free (statfs, df): 669.82GiB
Data ratio: 1.00
Metadata ratio: 2.00
Global reserve: 358.08MiB (used: 0.00B)
Multiple profiles: no
Data,single: Size:274.01GiB, Used:247.18GiB (90.21%)
/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b 274.01GiB
Metadata,DUP: Size:2.75GiB, Used:1.81GiB (65.86%)
/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b 5.50GiB
System,DUP: Size:8.00MiB, Used:48.00KiB (0.59%)
/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b 16.00MiB
Unallocated:
/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b 642.99GiB
[/FONT]linux-0rk5:/home/bt/bin # btrfs device stats /run/media/bt/b1377a2e-14fe-433a-b268-2fee065f1fc1
[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].write_io_errs 0
[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].read_io_errs 0
[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].flush_io_errs 0
[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].corruption_errs 0
[/dev/mapper/luks-18c56783-809e-43cd-b687-7377c138a95b].generation_errs 0
[HR][/HR]