BTRFS issues

My wife’s HP 6570p laptop is running with a Crucial 2TB SSD, but is beginning to act very sluggishly, and throws errors into the dmesg about BTRFS. I checked her SSD directly with my machine (USB-Sata dongle), and no problems, including full SMART self test.

This is from the journal:

Apr 08 08:21:09 hpprobook6570b kernel:  ? read_block_for_search+0x1d7/0x320 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 08:21:09 hpprobook6570b kernel:  wait_log_commit+0x99/0xf0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 08:21:09 hpprobook6570b kernel:  btrfs_sync_log+0x69b/0xb50 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 08:21:09 hpprobook6570b kernel:  btrfs_sync_file+0x40d/0x5b0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 08:21:09 hpprobook6570b kernel:  btrfs_sync_log+0xa78/0xb50 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 08:21:09 hpprobook6570b kernel:  btrfs_sync_file+0x40d/0x5b0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  wait_log_commit+0x99/0xf0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_log+0x69b/0xb50 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_file+0x40d/0x5b0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel: Workqueue: writeback wb_workfn (flush-btrfs-1)
Apr 08 10:31:30 hpprobook6570b kernel:  wait_log_commit+0x99/0xf0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_log+0x68a/0xb50 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_file+0x40d/0x5b0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  ? btrfs_dirty_inode+0x7a/0xc0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  ? btrfs_setattr+0x434/0x8f0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_log+0xa78/0xb50 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_file+0x40d/0x5b0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  ? read_block_for_search+0x1d7/0x320 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  wait_log_commit+0x99/0xf0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_log+0x69b/0xb50 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_file+0x40d/0x5b0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  wait_log_commit+0x99/0xf0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_log+0x69b/0xb50 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_file+0x40d/0x5b0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  ? read_block_for_search+0x1d7/0x320 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  wait_log_commit+0x99/0xf0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_log+0x69b/0xb50 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  ? btrfs_log_inode+0x1219/0x1920 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_file+0x40d/0x5b0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  wait_log_commit+0x99/0xf0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_log+0x69b/0xb50 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  ? btrfs_log_inode+0x79e/0x1920 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  btrfs_sync_file+0x40d/0x5b0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  ? merge_next_state+0x1a/0x90 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  ? btrfs_block_rsv_release+0x1ac/0x200 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
Apr 08 10:31:30 hpprobook6570b kernel:  ? btrfs_buffered_write+0x430/0x980 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]

Dmesg:

[Tue Apr  8 10:30:10 2025] INFO: task ThreadPoolForeg:4075 blocked for more than 122 seconds.
[Tue Apr  8 10:30:10 2025]       Not tainted 6.12.21-1-lts #1
[Tue Apr  8 10:30:10 2025] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[Tue Apr  8 10:30:10 2025] task:ThreadPoolForeg state:D stack:0     pid:4075  tgid:4070  ppid:4065   flags:0x00004002
[Tue Apr  8 10:30:10 2025] Call Trace:
[Tue Apr  8 10:30:10 2025]  <TASK>
[Tue Apr  8 10:30:10 2025]  __schedule+0x425/0x12b0
[Tue Apr  8 10:30:10 2025]  schedule+0x27/0xf0
[Tue Apr  8 10:30:10 2025]  wait_log_commit+0x99/0xf0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
[Tue Apr  8 10:30:10 2025]  ? __pfx_autoremove_wake_function+0x10/0x10
[Tue Apr  8 10:30:10 2025]  btrfs_sync_log+0x69b/0xb50 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
[Tue Apr  8 10:30:10 2025]  ? btrfs_log_inode+0x79e/0x1920 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
[Tue Apr  8 10:30:10 2025]  ? kmem_cache_free+0x3a4/0x440
[Tue Apr  8 10:30:10 2025]  btrfs_sync_file+0x40d/0x5b0 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
[Tue Apr  8 10:30:10 2025]  do_fsync+0x3a/0x70
[Tue Apr  8 10:30:10 2025]  __x64_sys_fdatasync+0x16/0x20
[Tue Apr  8 10:30:10 2025]  do_syscall_64+0x82/0x190
[Tue Apr  8 10:30:10 2025]  ? xas_load+0xd/0xd0
[Tue Apr  8 10:30:10 2025]  ? __xa_set_mark+0x67/0x90
[Tue Apr  8 10:30:10 2025]  ? __wake_up+0x44/0x60
[Tue Apr  8 10:30:10 2025]  ? merge_next_state+0x1a/0x90 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
[Tue Apr  8 10:30:10 2025]  ? btrfs_block_rsv_release+0x1ac/0x200 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
[Tue Apr  8 10:30:10 2025]  ? btrfs_buffered_write+0x430/0x980 [btrfs 0b91eeb62ad83948edc8d75e25cbf8300c3859a9]
[Tue Apr  8 10:30:10 2025]  ? vfs_write+0x311/0x450
[Tue Apr  8 10:30:10 2025]  ? vfs_write+0x311/0x450
[Tue Apr  8 10:30:10 2025]  ? __x64_sys_pwrite64+0xa8/0xd0
[Tue Apr  8 10:30:10 2025]  ? syscall_exit_to_user_mode+0x37/0x1c0
[Tue Apr  8 10:30:10 2025]  ? do_syscall_64+0x8e/0x190
[Tue Apr  8 10:30:10 2025]  ? do_syscall_64+0x8e/0x190
[Tue Apr  8 10:30:10 2025]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
[Tue Apr  8 10:30:10 2025] RIP: 0033:0x7371c3d78be2
[Tue Apr  8 10:30:10 2025] RSP: 002b:00007371bf4cd428 EFLAGS: 00000246 ORIG_RAX: 000000000000004b
[Tue Apr  8 10:30:10 2025] RAX: ffffffffffffffda RBX: 00007371bf4d06c0 RCX: 00007371c3d78be2
[Tue Apr  8 10:30:10 2025] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000000001c
[Tue Apr  8 10:30:10 2025] RBP: 00007371bf4cd450 R08: 0000000000000000 R09: 0000000000000000
[Tue Apr  8 10:30:10 2025] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000003d
[Tue Apr  8 10:30:10 2025] R13: 00002894000a66b8 R14: 0000289400022c80 R15: 00002894000a6708
[Tue Apr  8 10:30:10 2025]  </TASK>
[Tue Apr  8 10:30:10 2025] Future hung task reports are suppressed, see sysctl kernel.hung_task_warnings

I have re-done thermal paste, made sure it’s cooling.

Any ideas what’s going on?

With respect to temperatures, you can use either of these commands to get some details:

Storage specific:

inxi -Dxx --za

All sensors:

sensors

How much space do you have free?

df -h

There are also two BTRFS specific processes you can run. These are detailed in the Wiki under Scrub and Balance. These can take a long time, so keep that in mind before commencing.

The btrfs scrub command re-checks data, re-calculating the checksums and comparing it against the stored values. Essentially, it validates data, checking for corruption.

sudo btrfs scrub start /some/mount/point

That’ll start running in the background, and will likely take quite a while. To check it’s progress, you replace start with status:

sudo btrfs scrub status /some/mount/point

The next tool is balance. This sends all file-system data to the allocator again, which on a single-device file-system (ie: not using RAID) can help fix “file system full” issues. It does a bit more than that on RAID setups (regenerates the RAID).

sudo btrfs balance start --bg /some/mount/point

That’ll start in the background. To check in on its status, run:

sudo btrfs balance status /some/mount/point
1 Like

You could also run btrfs check (warning against --repair flag) and see if it reports something.

sudo btrfs check /path/to/btrfs/device (unmounted filesystem)

This will check it read only by default.

WARNING: the repair mode is considered dangerous and should not be used
without prior analysis of problems found on the filesystem.

1 Like

Drives:
Local Storage: total: 1.82 TiB used: 647.34 GiB (34.7%)
ID-1: /dev/sda vendor: Crucial model: CT2000BX500SSD1 size: 1.82 TiB speed: 6.0 Gb/s
serial:
sensors:
BAT0-acpi-0
Adapter: ACPI interface
in0: 12.36 V
curr1: 0.00 A

coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +58.0°C (high = +87.0°C, crit = +105.0°C)
Core 0: +49.0°C (high = +87.0°C, crit = +105.0°C)
Core 1: +58.0°C (high = +87.0°C, crit = +105.0°C)

acpitz-acpi-0
Adapter: ACPI interface
temp1: +54.0°C
temp2: +0.0°C
temp3: +37.0°C
temp4: +43.0°C
temp5: +27.0°C
temp6: +127.0°C

disk free 65%

Scrub status:
UUID: e28d55fb-f807-41a2-9370-92a73507d533
Scrub started: Tue Apr 8 13:44:09 2025
Status: finished
Duration: 0:36:44
Total to scrub: 646.85GiB
Rate: 300.51MiB/s
Error summary: no errors found

So with no errors found, what do you reckon? IO chipset error?

The processor in your wife’s HP is 13 years old, so it’s on the dated side. A degree of sluggishness is to be expected, particularly under more modern desktop environments.

What desktop environment is she using?

1 Like

Yes, it’s dated. Running Cinnamon.

# dmesg | grep -i btrfs 
[    2.442911] Btrfs loaded, zoned=yes, fsverity=yes
[   10.047573] BTRFS: device fsid 238994ec-a97e-4f0b-aaea-ab69eb2ea337 devid 1 transid 541772 /dev/nvme1n1p2 (259:2) scanned by mount (344)
[   10.047899] BTRFS info (device nvme1n1p2): first mount of filesystem 238994ec-a97e-4f0b-aaea-ab69eb2ea337
[   10.047913] BTRFS info (device nvme1n1p2): using crc32c (crc32c-x86) checksum algorithm
[   10.047920] BTRFS info (device nvme1n1p2): using free-space-tree
[   11.253013] BTRFS info (device nvme1n1p2 state M): use lzo compression, level 0

This is what I see in dmesg.

I would run the check command in read only mode (default) to see if there is something wrong with the file system.

Maybe it’s a good time for a backup of personal data to avoid unpleasant surprises.

2 Likes

so far it’s not looking so great :slight_smile:

Opening filesystem to check...
WARNING: filesystem mounted, continuing because of --force
Checking filesystem on /dev/sda1
UUID: e28d55fb-f807-41a2-9370-92a73507d533
[1/8] checking log
[2/8] checking root items
parent transid verify failed on 701014654976 wanted 682395 found 682398
parent transid verify failed on 701014654976 wanted 682395 found 682398
parent transid verify failed on 701014654976 wanted 682395 found 682398
Ignoring transid failure
parent transid verify failed on 701014704128 wanted 682395 found 682398
parent transid verify failed on 701014704128 wanted 682395 found 682398
parent transid verify failed on 701014704128 wanted 682395 found 682398
Ignoring transid failure
parent transid verify failed on 701014753280 wanted 682395 found 682398
parent transid verify failed on 701014753280 wanted 682395 found 682398
parent transid verify failed on 701014753280 wanted 682395 found 682398
Ignoring transid failure
parent transid verify failed on 701019652096 wanted 682396 found 682398
parent transid verify failed on 701019652096 wanted 682396 found 682398
parent transid verify failed on 701019652096 wanted 682396 found 682398
Ignoring transid failure
parent transid verify failed on 701019684864 wanted 682396 found 682398
parent transid verify failed on 701019684864 wanted 682396 found 682398
parent transid verify failed on 701019684864 wanted 682396 found 682398
Ignoring transid failure

Try using three backticks (`), like this:
```
Some block of
text here
```

Produces:

Some block of
text here
1 Like

You would need to run it on unmounted filesystem

:wink:

1 Like

yeh, going to need to put it onto my machine…it just went crazy dumping inode errors etc.
We do have backups…

1 Like

I’d persue @cactux’s advice first :+1:

But of note, my wife’s NUC is using a newer (2015) but only slightly lower spec Intel i3-6100U (UserBenchmark i5-3210M vs i3-6100U). We had KDE Plasma on that system initially and it was painfully sluggish. I’m not experienced with Cinnamon, but from what I understand, it’s demand on resources isn’t markedly different to KDE.

A super lightweight desktop environment suitable for these older systems would be something like LXQt, which is generally regarded as perhaps the lightest option. This breathed new life into my wife’s old NUC. The only downside is it’s nowhere near as visually polished as KDE Plasma, nor Cinnamon I expect. It feels a bit clunky by comparison, although very performant.

The other common options for lightweight desktop environment are XFCE and LXDE, which may better suit anyway given existing familiarity with a GTK based desktop environment.

Just some food for thought.

2 Likes

That’s good!

I’m just an amateur user of btrfs but judging by what you show it doesn’t look good.

You could run the check and post back the result here for getting an assessment from the experts on the matter or just format, reinstall and restore backup data.

As far as I know, the --repair option is advised against. It must be done after a thorough analysis of the problem by experts. Even so it could lead to data loss.

1 Like

I’m thinking it’s time to backup to external, wipe, format to ext4, and reload…I miss the days when reloading windohs would take a week…

1 Like

That would be taking the fast lane to get things back up and running.

:laughing:

2 Likes

If I’m not mistaken, an assisted BTRFS install will also default enable compression. That’s good if you want to improve storage space and reduce SSD writes, and on systems where I/O is slow but CPU is decent, it can actually increase speed. On your wife’s system though, it could potentially be slowing things down.

1 Like

I think EOS defaults to zstd:3.

2 Likes

Booted to a Cachyos live usb, on her machine, run the btrfsck, and no errors found…hmmm
going to do it anyway. Currently copying @ and @home parts of the btrfs system to external ext4 disk.
Then I will boot into her system and follow this recipe:

To restore Arch Linux packages on a fresh reload using Yay, you can follow these steps. First, ensure you have a list of explicitly installed packages from your previous installation using the command pacman -Qqe > packages.txt . This command will create a file named packages.txt containing all the native and AUR packages that were explicitly installed. To restore these packages, you can use the command yay -S --needed --nouseask --nocleanmenu --nodiffmenu --removemake - < ~/packages.txt . This command will install the necessary packages from the list, skipping those already installed, and minimizing user interaction during the process.

I suspect because the system is so elderly, the overhead of cinnamon and the btrfs with compression is too much to bear. Will do xfce4 and ext4.

2 Likes

I wouldn’t say btrfs is a bad option, still. The checksumming and snapshotting has the potential to get one out of a bad situation, whether it’s recovery from data corruption, a bad update, or restoring potentially lost data.

The compression aspect of btrfs is adjustable. See Btrfs Compression for how to adjust or disable that, and apply those changes to existing files.

1 Like

Reporting back on my adventures:
I backed it up. I wiped the laptop SSD. I loaded the OS to the SSD.
I had a spare linuxmint PC sitting idle, so I set it up, SATA connected, with the backup drive ( a 3TB platter ) and the 2TB SSD, and used Thunar to copy from 3TB back to the SSD. It was unbelievably slow, averaging <1mb/s transfer rates on a 650GB dataset. It was going to be days.
“strange,” said I, and so for giggles tried Midnight Commander instead. Boom. Averaging 25mb/s.
So that was fun learning experience. Mrs Wabbit’s machine is now a heap faster, running on EXT4, with CachyOs, and XFCE.
Thanks all.

2 Likes