Leap 15.5 shutdown is very slow

I press esc, then it shows message like below:

A stop job is running for scrub btrfs filesystem, verify block checksum(1min50s/3min)

Hi and welcome to the forums :smile:

This is just a stroke of bad luck that you happened to shutdown the system while a scrub was in progress. btrfs-scrub.timer performs a scrub (checks data/metadata checksums for corruption and fix if there are other copies) of the filesystem every month in the default setting, once a week on mine.

Is your btrfs root filesystem on SSD or spinning rust? The latter would take way more time for the scrub to finish. On an NVMe SSD it takes about 1 minute, SATA SSD 10x that, and SATA HDD 100x (roughly how it’s on my various btrfs FSs).

You can check when the scrub would next trigger by doing:

systemctl status btrfs-scrub.timer

My disk is nvme ssd, but it takes 3 minutes.
Here is output:

$ systemctl status btrfs-scrub.timer
● btrfs-scrub.timer - Scrub btrfs filesystem, verify block checksums
     Loaded: loaded (/usr/lib/systemd/system/btrfs-scrub.timer; enabled; vendor preset: enabled)
     Active: active (waiting) since Fri 2024-01-12 12:22:35 CST; 3 months 3 days ago
    Trigger: Wed 2024-05-01 00:00:00 CST; 2 weeks 0 days left
   Triggers: ● btrfs-scrub.service
       Docs: man:btrfs-scrub

3 minutes is reasonable for a large SSD with lots of data.

Looks like it’s setup for the monthly scrub, so not sure what else could’ve triggered it recently.

Please provide the output of:

sudo journalctl --no-pager -u btrfs-scrub.service
# assuming the slowdown happened during last boot, -1 being the last boot, -2 the boot before that...
sudo journalctl --no-pager -b -1

Here is the output:

$ sudo journalctl --no-pager -u btrfs-scrub.service
4月 16 18:16:34 localhost.localdomain systemd[1]: Started Scrub btrfs filesystem, verify block checksums.
4月 16 18:16:34 localhost.localdomain btrfs-scrub.sh[3686]: Running scrub on /
4月 16 18:31:37 localhost.localdomain btrfs-scrub.sh[3686]: Scrub device /dev/mapper/system-root (id 1) done
4月 16 18:31:37 localhost.localdomain btrfs-scrub.sh[3686]: Scrub started:    Tue Apr 16 18:16:34 2024
4月 16 18:31:37 localhost.localdomain btrfs-scrub.sh[3686]: Status:           finished
4月 16 18:31:37 localhost.localdomain btrfs-scrub.sh[3686]: Duration:         0:15:03
4月 16 18:31:37 localhost.localdomain btrfs-scrub.sh[3686]: Total to scrub:   242.05GiB
4月 16 18:31:37 localhost.localdomain btrfs-scrub.sh[3686]: Rate:             249.89MiB/s
4月 16 18:31:37 localhost.localdomain btrfs-scrub.sh[3686]: Error summary:    no errors found
4月 16 18:31:37 localhost.localdomain systemd[1]: btrfs-scrub.service: Deactivated successfully.

Great, so I looked at the timer file systemctl cat btrfs-scrub.timer and it has Persistent set to True.

This means it would run whenever it gets a chance if the machine was off the last time it would’ve run (Apr 01 midnight) but couldn’t. I suppose you turned the machine on today (Apr 16) after some time away?

Source:
https://www.freedesktop.org/software/systemd/man/latest/systemd.timer.html#Persistent=

No.
Yesterday my machine’s power went out.
Today after I boot, the time went wrong.
Maybe that’s why.

So maybe I should change Persistent to false.

Perhaps it’s time to replace the CMOS battery.

Wouldn’t recommend it, as it’s not the root cause of the issue.

I understand. Thanks for your help.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.