Skip to contentSkip to conversation

BTRFS w/ quotas hangs on read-write mount using all available RAM - rev2

DISCUSSION [email protected] 2 participants 4 messages Oct 9, 2022 – Oct 10, 2022 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Dear btrfs team,
thanks for all your great work!
I have been running btrfs now for several years and really like the robustness and ease of use!

Last week I experienced 99% the same thing as described here by Loren M. Lang:
https://www.spinics.net/lists/linux-btrfs/msg81173.html
only difference: This is not my / but a 40TB storage mounted to /media/btrfs1/

quick summary what happend:
- enabled quotas to better understand where all my space has gone
- started balancing
- system got completely stuck due to the meanwhile well understood reasons
- pushed reset button

I can mount my btrfs system perfectly read-only and access the data. As soon as I try to mount rw, my system will exremely slow down, memory will fill up until I will finally end up with a panicking kernel.

So, no problem to successfully boot with the fstab entries on ro or commented out.

   admiral@server:/$ uname -a
   Linux server.domain.loc 4.19.0-21-amd64 #1 SMP Debian 4.19.249-2
(2022-06-30) x86_64 GNU/Linux
   admiral@server:/$ btrfs --version
   btrfs-progs v5.10.1

Here the question:
I am looking for the option to disable quota on an unmounted btrfs like described here:
https://patchwork.kernel.org/project/linux-btrfs/patch/20180812013358.16431-
[email protected]/

All my trials and checks et cetera were performed with btrfs-progs v4.20.1-2 as debian buster's latest state:
https://packages.debian.org/de/buster/btrfs-progs

I already upgraded the btrfs-progs to debian backport v5.10.1 but do not find any option to offline disable quota, yet:
https://packages.debian.org/buster-backports/btrfs-progs

Can you point me some direction how to move forward to recover the btrfs?

Thanks a lot,

admiralbulli

#1 lore raw
Quoted 21 lines · On 2022/10/9 19:03, [email protected] wrote:

Dear btrfs team,
thanks for all your great work!
I have been running btrfs now for several years and really like the robustness and ease of use!

Last week I experienced 99% the same thing as described here by Loren M. Lang:
https://www.spinics.net/lists/linux-btrfs/msg81173.html
only difference: This is not my / but a 40TB storage mounted to /media/btrfs1/

quick summary what happend:
- enabled quotas to better understand where all my space has gone
- started balancing
- system got completely stuck due to the meanwhile well understood reasons
- pushed reset button

I can mount my btrfs system perfectly read-only and access the data. As soon as I try to mount rw, my system will exremely slow down, memory will fill up until I will finally end up with a panicking kernel.

Quoted 6 lines

So, no problem to successfully boot with the fstab entries on ro or commented out.

    admiral@server:/$ uname -a
    Linux server.domain.loc 4.19.0-21-amd64 #1 SMP Debian 4.19.249-2
(2022-06-30) x86_64 GNU/Linux

Your kernel is just one version too old...

In fact, v5.0 kernel we have introduced a lot of qgroup optimization to address the slow performance (including hang, huge memory usage) of balance with qgroup enabled.

Although that optimization also introduced some regression, all the known regression should have been fixed and backported.

But for older kernels, like your 4.x kernels, we don't have the optimization at all.

Thus in your case, you may want to use the latest LTS kernel at least (v5.15.x).

Thanks,
Qu

Quoted 24 lines
    admiral@server:/$ btrfs --version
    btrfs-progs v5.10.1

Here the question:
I am looking for the option to disable quota on an unmounted btrfs like described here:
https://patchwork.kernel.org/project/linux-btrfs/patch/20180812013358.16431-
[email protected]/

All my trials and checks et cetera were performed with btrfs-progs v4.20.1-2 as debian buster's latest state:
https://packages.debian.org/de/buster/btrfs-progs

I already upgraded the btrfs-progs to debian backport v5.10.1 but do not find any option to offline disable quota, yet:
https://packages.debian.org/buster-backports/btrfs-progs

Can you point me some direction how to move forward to recover the btrfs?

Thanks a lot,

admiralbulli

#2 lore raw
Quoted 27 lines · Qu Wenruo
Quoted 24 lines · On 2022/10/9 19:03, [email protected] wrote:

Dear btrfs team,
thanks for all your great work!
I have been running btrfs now for several years and really like the robustness and ease of use!

Last week I experienced 99% the same thing as described here by Loren M. Lang:
https://www.spinics.net/lists/linux-btrfs/msg81173.html
only difference: This is not my / but a 40TB storage mounted to /media/btrfs1/

quick summary what happend:
- enabled quotas to better understand where all my space has gone
- started balancing
- system got completely stuck due to the meanwhile well understood reasons
- pushed reset button

I can mount my btrfs system perfectly read-only and access the data. As soon
as I try to mount rw, my system will exremely slow down, memory will fill up
until I will finally end up with a panicking kernel.

Quoted 8 lines
Quoted 6 lines

So, no problem to successfully boot with the fstab entries on ro or commented out.

    admiral@server:/$ uname -a
    Linux server.domain.loc 4.19.0-21-amd64 #1 SMP Debian 4.19.249-2
(2022-06-30) x86_64 GNU/Linux

Your kernel is just one version too old...

My bad, two versions too old.

Quoted 2 lines

In fact, v5.0 kernel we have introduced a lot of qgroup optimization to

Git describes --contains shows it's v5.1 for the optimization.

Quoted 40 lines

address the slow performance (including hang, huge memory usage) of balance with qgroup enabled.

Although that optimization also introduced some regression, all the known regression should have been fixed and backported.

But for older kernels, like your 4.x kernels, we don't have the optimization at all.

Thus in your case, you may want to use the latest LTS kernel at least (v5.15.x).

Thanks,
Qu

Quoted 25 lines
    admiral@server:/$ btrfs --version
    btrfs-progs v5.10.1

Here the question:
I am looking for the option to disable quota on an unmounted btrfs like described here:
https://patchwork.kernel.org/project/linux-btrfs/patch/20180812013358.16431-
[email protected]/

All my trials and checks et cetera were performed with btrfs-progs v4.20.1-2
as debian buster's latest state:
https://packages.debian.org/de/buster/btrfs-progs

I already upgraded the btrfs-progs to debian backport v5.10.1 but do not find any option to offline disable quota, yet:
https://packages.debian.org/buster-backports/btrfs-progs

Can you point me some direction how to move forward to recover the btrfs?

Thanks a lot,

admiralbulli

#3 lore raw

Dear Qu,
thank you so much for your quick and well directed feedback. I really appreciate this!
Thanks,
admiralbulli

P.S.:
For the sake of simplicity, I booted into an Ubuntu 22.04 (kernel 5.15) live system. Mounting the btrfs rw worked like a charm.

disabled quota:
btrfs quota disable /mymount

did some cleanup:
btrfs balance start -dusage=5 /mymount
btrfs balance start -musage=20 /mymount
btrfs scrub start -BdR /mymount

Rebooted into the old debian system.
Able to mount eveything again rw.

THANKS AGAIN!

Quoted 84 lines · Qu Wenruo
Quoted 27 lines · Qu Wenruo
Quoted 24 lines · On 2022/10/9 19:03, [email protected] wrote:

Dear btrfs team,
thanks for all your great work!
I have been running btrfs now for several years and really like the robustness and ease of use!

Last week I experienced 99% the same thing as described here by Loren M. Lang:
https://www.spinics.net/lists/linux-btrfs/msg81173.html
only difference: This is not my / but a 40TB storage mounted to /media/btrfs1/

quick summary what happend:
- enabled quotas to better understand where all my space has gone
- started balancing
- system got completely stuck due to the meanwhile well understood reasons
- pushed reset button

I can mount my btrfs system perfectly read-only and access the data. As soon
as I try to mount rw, my system will exremely slow down, memory will fill up
until I will finally end up with a panicking kernel.

Quoted 8 lines
Quoted 6 lines

So, no problem to successfully boot with the fstab entries on ro or commented out.

    admiral@server:/$ uname -a
    Linux server.domain.loc 4.19.0-21-amd64 #1 SMP Debian 4.19.249-2
(2022-06-30) x86_64 GNU/Linux

Your kernel is just one version too old...

My bad, two versions too old.

Quoted 2 lines

In fact, v5.0 kernel we have introduced a lot of qgroup optimization to

Git describes --contains shows it's v5.1 for the optimization.

Quoted 40 lines

address the slow performance (including hang, huge memory usage) of balance with qgroup enabled.

Although that optimization also introduced some regression, all the known regression should have been fixed and backported.

But for older kernels, like your 4.x kernels, we don't have the optimization at all.

Thus in your case, you may want to use the latest LTS kernel at least (v5.15.x).

Thanks,
Qu

Quoted 25 lines
    admiral@server:/$ btrfs --version
    btrfs-progs v5.10.1

Here the question:
I am looking for the option to disable quota on an unmounted btrfs like described here:
https://patchwork.kernel.org/project/linux-btrfs/patch/20180812013358.16431-
[email protected]/

All my trials and checks et cetera were performed with btrfs-progs v4.20.1-2
as debian buster's latest state:
https://packages.debian.org/de/buster/btrfs-progs

I already upgraded the btrfs-progs to debian backport v5.10.1 but do not find any option to offline disable quota, yet:
https://packages.debian.org/buster-backports/btrfs-progs

Can you point me some direction how to move forward to recover the btrfs?

Thanks a lot,

admiralbulli