Btrfs group rescan ..causing major cpu issues

I’m getting a few btrfs applications that seem to run pretty often, about every hour or so, and peg my cpu or at least some of it’s cores at 99% which makes my computer completely unresponsive for about 10sec until it stops and goes away. I’ve seen btrfs “clean” also do it but “group rescan” seems to be the most frequent culprit.

I’m running TW and it’s up to date…dup yesterday.

I’m not sure if this has anything to do with it but for transparency I did recently upgrade my drive from a SSD to a larger NVME. I used clonezilla and it went perfectly; then I used gparted and expanded the root partition which also extended the FS automatically for me since it has built in btrfs tools. It all went well, the space is there. Smart also reports the nvme being healthy and no errors

Anybody else experience this?

1 Like

Show

snapper get-config

Here is the output.

 sudo snapper get-config
[sudo] password for root: 
Key                    │ Value
───────────────────────┼──────
ALLOW_GROUPS           │
ALLOW_USERS            │
BACKGROUND_COMPARISON  │ yes
EMPTY_PRE_POST_CLEANUP │ yes
EMPTY_PRE_POST_MIN_AGE │ 1800
FREE_LIMIT             │ 0.2
FSTYPE                 │ btrfs
NUMBER_CLEANUP         │ yes
NUMBER_LIMIT           │ 2-10
NUMBER_LIMIT_IMPORTANT │ 4-10
NUMBER_MIN_AGE         │ 1800
QGROUP                 │ 1/0
SPACE_LIMIT            │ 0.5
SUBVOLUME              │ /
SYNC_ACL               │ no
TIMELINE_CLEANUP       │ yes
TIMELINE_CREATE        │ no
TIMELINE_LIMIT_DAILY   │ 10
TIMELINE_LIMIT_HOURLY  │ 10
TIMELINE_LIMIT_MONTHLY │ 10
TIMELINE_LIMIT_WEEKLY  │ 0
TIMELINE_LIMIT_YEARLY  │ 10
TIMELINE_MIN_AGE       │ 1800

How many snapshots do you have? How full is the filesystem? Show

btrfs qgroup show /
snapper list
sudo btrfs qgroup show /
[sudo] password for root: 
Qgroupid    Referenced    Exclusive   Path 
--------    ----------    ---------   ---- 
0/5           16.00KiB     16.00KiB   <toplevel>
0/256         16.00KiB     16.00KiB   @
0/257         44.07GiB     44.07GiB   @/var
0/258          7.02MiB    248.00KiB   @/usr/local
0/259         10.41MiB     10.41MiB   @/tmp
0/260         50.82MiB     50.82MiB   @/srv
0/261         40.52MiB     40.52MiB   @/root
0/262        363.80MiB    363.74MiB   @/opt
0/263        344.14GiB    344.13GiB   @/home
0/264          4.33MiB      4.33MiB   @/boot/grub2/x86_64-efi
0/265         16.00KiB     16.00KiB   @/boot/grub2/i386-pc
0/266          1.29MiB      1.29MiB   @/.snapshots
0/340         16.00KiB     16.00KiB   @/var/lib/machines
0/1741        11.38GiB      1.17GiB   @/.snapshots/794/snapshot
0/1827        11.38GiB      1.06GiB   @/.snapshots/805/snapshot
0/1833        11.52GiB    358.36MiB   @/.snapshots/808/snapshot
0/1843        11.72GiB      6.55MiB   @/.snapshots/815/snapshot
0/1847        11.72GiB     33.52MiB   @/.snapshots/817/snapshot
0/1850        11.62GiB    396.74MiB   @/.snapshots/820/snapshot
0/2037        11.90GiB    488.68MiB   @/.snapshots/951/snapshot
0/2047        11.91GiB      5.79GiB   @/.snapshots/954/snapshot
0/2056        12.04GiB    408.44MiB   @/.snapshots/958/snapshot
0/2088        12.45GiB    605.81MiB   @/.snapshots/972/snapshot
0/2116        12.33GiB    698.49MiB   @/.snapshots/987/snapshot
0/2154        12.99GiB      6.23GiB   @/.snapshots/1014/snapshot
0/2158        12.79GiB     38.66MiB   @/.snapshots/1018/snapshot
0/2164        12.46GiB     21.24MiB   @/.snapshots/1024/snapshot
0/2167        12.79GiB     26.56MiB   @/.snapshots/1025/snapshot
0/2171        13.17GiB    246.57MiB   @/.snapshots/1029/snapshot
0/2172        13.35GiB    554.26MiB   @/.snapshots/1030/snapshot
0/2234        12.23GiB      1.92GiB   @/.snapshots/1069/snapshot
0/2249        12.55GiB      1.72GiB   @/.snapshots/1084/snapshot
0/2258        12.70GiB      5.39GiB   @/.snapshots/1093/snapshot
0/2274        11.98GiB      5.47GiB   @/.snapshots/1107/snapshot
0/2292        11.94GiB      3.81GiB   @/.snapshots/1114/snapshot
0/2299        11.62GiB      3.29GiB   @/.snapshots/1119/snapshot
0/2332        11.98GiB      3.29GiB   @/.snapshots/1141/snapshot
0/2344        12.19GiB      2.34GiB   @/.snapshots/1146/snapshot
0/2362        12.30GiB      4.02MiB   @/.snapshots/1151/snapshot
0/2370        12.30GiB      3.67MiB   @/.snapshots/1159/snapshot
0/2374        12.42GiB      5.12MiB   @/.snapshots/1160/snapshot
0/2375        12.42GiB      2.47MiB   @/.snapshots/1161/snapshot
0/2376        12.11GiB     75.97MiB   @/.snapshots/1162/snapshot
0/2387        12.13GiB      1.58MiB   @/.snapshots/1169/snapshot
0/2389        12.13GiB    544.00KiB   @/.snapshots/1171/snapshot
0/2391        12.48GiB    156.91MiB   @/.snapshots/1172/snapshot
0/2658        12.36GiB    576.00KiB   @/.snapshots/1189/snapshot
0/2659        12.37GiB    320.00KiB   @/.snapshots/1190/snapshot
0/2665        12.37GiB    820.00KiB   @/.snapshots/1191/snapshot
0/2666        12.37GiB    112.00KiB   @/.snapshots/1192/snapshot
0/2667        12.40GiB    128.00KiB   @/.snapshots/1193/snapshot
0/2668        12.40GiB    148.00KiB   @/.snapshots/1194/snapshot
0/2670        12.40GiB     30.36MiB   @/.snapshots/1195/snapshot
0/2673        12.66GiB      5.61MiB   @/.snapshots/1196/snapshot
0/2674        12.66GiB      2.28MiB   @/.snapshots/1197/snapshot
0/2676        12.46GiB      5.09MiB   @/.snapshots/1198/snapshot
1/0           22.69GiB      1.34GiB   <0 member qgroups>
255/340       16.00KiB     16.00KiB   <0 member qgroups>

sudo snapper list
    # │ Type   │ Pre # │ Date                            │ User │ Used Space │ Cleanup │ Description                   │ Userdata
──────┼────────┼───────┼─────────────────────────────────┼──────┼────────────┼─────────┼───────────────────────────────┼──────────────
   0  │ single │       │                                 │ root │            │         │ current                       │
 794  │ single │       │ Thu 24 Aug 2023 03:02:30 PM CDT │ root │   1.17 GiB │         │ 8-24-23                       │
 805  │ single │       │ Sat 07 Oct 2023 02:06:18 PM CDT │ root │   1.06 GiB │         │ 10-7-23                       │
 808  │ single │       │ Sat 07 Oct 2023 02:59:37 PM CDT │ root │ 358.36 MiB │         │ 10-7-23.before-kernel         │
 815  │ single │       │ Sat 07 Oct 2023 04:49:53 PM CDT │ root │   6.55 MiB │         │ 10-7-23.new.kernel            │
 817  │ single │       │ Sat 14 Oct 2023 12:44:02 PM CDT │ root │  33.52 MiB │         │ 10-14-23                      │
 820  │ single │       │ Sat 14 Oct 2023 01:37:37 PM CDT │ root │ 396.74 MiB │         │ 10-14-23.bk                   │
 951  │ single │       │ Mon 15 Jan 2024 01:33:33 PM CST │ root │ 488.68 MiB │         │ 1-15-24                       │
 954  │ single │       │ Sat 02 Mar 2024 12:45:22 PM CST │ root │   5.79 GiB │         │ 3-2-24                        │
 958  │ single │       │ Sat 02 Mar 2024 10:26:46 PM CST │ root │ 408.44 MiB │         │ 3-2-24.pre-kernel             │
 972  │ single │       │ Sat 13 Apr 2024 04:48:07 PM CDT │ root │ 605.81 MiB │         │ 4-13-24.pre-kernel            │
 987  │ single │       │ Tue 18 Jun 2024 12:26:27 PM CDT │ root │ 698.49 MiB │         │ 6-18-24.pre-kernel            │

df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p3  926G  508G  414G  56% /
devtmpfs        4.0M   12K  4.0M   1% /dev
tmpfs            16G  6.2M   16G   1% /dev/shm
tmpfs           6.3G  2.1M  6.3G   1% /run
efivarfs        150K   83K   63K  58% /sys/firmware/efi/efivars
tmpfs           1.0M     0  1.0M   0% /run/credentials/systemd-journald.service
/dev/nvme0n1p3  926G  508G  414G  56% /.snapshots
/dev/nvme0n1p3  926G  508G  414G  56% /boot/grub2/i386-pc
/dev/nvme0n1p3  926G  508G  414G  56% /boot/grub2/x86_64-efi
/dev/nvme0n1p3  926G  508G  414G  56% /home
/dev/nvme0n1p3  926G  508G  414G  56% /opt
/dev/nvme0n1p3  926G  508G  414G  56% /root
/dev/nvme0n1p3  926G  508G  414G  56% /srv
/dev/nvme0n1p3  926G  508G  414G  56% /tmp
/dev/nvme0n1p3  926G  508G  414G  56% /usr/local
/dev/nvme0n1p3  926G  508G  414G  56% /var
/dev/nvme0n1p1  500M  6.1M  494M   2% /boot/efi
/dev/loop0      128K  128K     0 100% /snap/bare/5
/dev/loop1       22M   22M     0 100% /snap/bashtop/501
/dev/loop2       22M   22M     0 100% /snap/bashtop/504
/dev/loop3      384K  384K     0 100% /snap/bpytop/279
/dev/loop4      384K  384K     0 100% /snap/bpytop/284
/dev/loop6      185M  185M     0 100% /snap/brave/507
/dev/loop7      1.8M  1.8M     0 100% /snap/btop/836
/dev/loop8      1.9M  1.9M     0 100% /snap/btop/845
/dev/loop12      56M   56M     0 100% /snap/core18/2855
/dev/loop13      64M   64M     0 100% /snap/core20/2501
/dev/loop10     105M  105M     0 100% /snap/core/17200
/dev/loop16      74M   74M     0 100% /snap/core22/1963
/dev/loop17      67M   67M     0 100% /snap/core24/739
/dev/loop11      56M   56M     0 100% /snap/core18/2846
/dev/loop18      67M   67M     0 100% /snap/core24/888
/dev/loop19      69M   69M     0 100% /snap/cups/1085
/dev/loop15      64M   64M     0 100% /snap/core20/2571
/dev/loop14      74M   74M     0 100% /snap/core22/1908
/dev/loop20      68M   68M     0 100% /snap/cups/1100
/dev/loop21     172M  172M     0 100% /snap/element-desktop/146
/dev/loop23     2.0M  2.0M     0 100% /snap/fast/4
/dev/loop24     165M  165M     0 100% /snap/gnome-3-28-1804/194
/dev/loop25     165M  165M     0 100% /snap/gnome-3-28-1804/198
/dev/loop26     219M  219M     0 100% /snap/gnome-3-34-1804/90
/dev/loop27     219M  219M     0 100% /snap/gnome-3-34-1804/93
/dev/loop28     506M  506M     0 100% /snap/gnome-42-2204/176
/dev/loop29     517M  517M     0 100% /snap/gnome-42-2204/202
/dev/loop32     405M  405M     0 100% /snap/gnome-46-2404/90
/dev/loop31      82M   82M     0 100% /snap/gtk-common-themes/1534
/dev/loop33      92M   92M     0 100% /snap/gtk-common-themes/1535
/dev/loop34     126M  126M     0 100% /snap/iptvnator/90
/dev/loop35     119M  119M     0 100% /snap/iptvnator/92
/dev/loop36     172M  172M     0 100% /snap/mailspring/548
/dev/loop30     405M  405M     0 100% /snap/gnome-46-2404/77
/dev/loop38     212M  212M     0 100% /snap/mesa-2404/143
/dev/loop37     172M  172M     0 100% /snap/mailspring/549
/dev/loop39     208M  208M     0 100% /snap/mesa-2404/495
/dev/loop40      45M   45M     0 100% /snap/snapd/23771
/dev/loop41      51M   51M     0 100% /snap/snapd/24505
tmpfs           1.0M     0  1.0M   0% /run/credentials/getty@tty1.service
tmpfs           3.2G  4.1M  3.2G   1% /run/user/1000
/dev/loop42     105M  105M     0 100% /snap/core/17210
/dev/loop9      172M  172M     0 100% /snap/element-desktop/148
/dev/loop22     185M  185M     0 100% /snap/brave/511
neal@localhost:~>