Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrub process interferes with loading and play the game and prevent shut down system #943

Open
VladimirMrzv opened this issue Jan 28, 2025 · 7 comments
Labels

Comments

@VladimirMrzv
Copy link

On my system i use HDD drive with btrfs, volume is 12 Tb.
Every month is started scrub process but i not use pc 24x7 and when want shutdown or reboot system wait stopping process very long. For scrub I need more 20 hours and cannot ending this process. I think it is need continius process from last block not begin from first evry time.
Also I play games and one game become very long time to load and got staters when playing. All problem from scrub, after cancel all ok. but it starts again when playing.

My system Ubuntu 24.10 and btrfs-progs v6.6.3

@kdave kdave added the bug label Jan 28, 2025
@Forza-tng
Copy link
Contributor

You can read about limiting scrub's performance imact on https://btrfs.readthedocs.io/en/latest/Scrub.html

You can cancel and resume scrubs too using btrfs scrub cancel and btrfs scrub resume.

https://btrfs.readthedocs.io/en/latest/btrfs-scrub.html

@adam900710
Copy link
Collaborator

And I believe it will be even better if we can add an option to btrfs scrub start to limit the speed (using the same sysfs interface).

As the sysfs interface is not really an end user friendly solution (one has to create a script doing all the wrapping and setting the sysfs interface instead).

@VladimirMrzv
Copy link
Author

@Forza-tng thanks. Now i stop scrub before play game, but is starts again after some time.
After reboot it starts from beginning and not resume last.

@Forza-tng
Copy link
Contributor

@Forza-tng thanks. Now i stop scrub before play game, but is starts again after some time. After reboot it starts from beginning and not resume last.

If it starts again it may be you have some maintenance service interfering.

@VladimirMrzv
Copy link
Author

After boot PC, scrub process begins from start. Then cancel scrub and reboot system, after boot send command to resume and it continuous scrubbing, not start again from beginning. I think it must be automatic, trying resume and only then start.

@VladimirMrzv
Copy link
Author

VladimirMrzv commented Feb 4, 2025

How I can stop scrub and run only manual?
If I cancel process, some time ago it starts again but not resume, it starts from beginning.

find config and change intervals, does it helps or not?

# cat /etc/btrfsd/settings.conf 
#
# Configuration for Btrfsd
#

# Settings can be adjusted per mountpoint,
# if no settings are defined for a mountpoint,
# the ones from the "default" section are used.
# Check man btrfsd(8) for more informtion.

[default]
# Address to send mails about filesystem errors to
mail_address=""

# Approximate intervals at which to execute
# maintenance actions.
stats_interval=10h
scrub_interval=3M
balance_interval=never

adam900710 added a commit to adam900710/btrfs-progs that referenced this issue Feb 4, 2025
I know there is already `btrfs scrub limit` command to set the limit,
but a lot of users are not aware of that command.

Thus adding a new option `-t <throughput_limit>` to `btrfs scrub start`.

This has some extra behavior compared to `btrfs scrub limit`:

- Only set the value for the involved scrub device(s)
  If it's a full fs scrub, it will be the same as
  `btrfs scrub limit -a -l <value>`.
  If it's a single device, it will bt the same as
  `btrfs scrub limit -d <devid> -l <value>`.

- Automatically reset the limit after scrub is finished

- It only needs one single command line to set the limit

Issue: kdave#943
Signed-off-by: Qu Wenruo <[email protected]>
---
RFC:
I'm not sure if this is really needed since we already have `btrfs scrub
limit`.
Involved tools like btrfs-maintenance scripts should have such support,
but to my surprise, David introduced the `btrfs scrub limit` but not
adding any support to btrfs-maintenance.
adam900710 added a commit to adam900710/btrfs-progs that referenced this issue Feb 6, 2025
…limit at runtime

Add a new option `--limit <throughput_limit>` to `btrfs scrub start`.

This has some extra behavior differences compared to `btrfs scrub limit`:

- Only set the value for the involved scrub device(s)
  If it's a full fs scrub, it will be the same as
  `btrfs scrub limit -a -l <value>`.
  If it's a single device, it will bt the same as
  `btrfs scrub limit -d <devid> -l <value>`.

- Automatically revert to the old limit after scrub is finished

- It only needs one single command line to set the limit

Issue: kdave#943
Signed-off-by: Qu Wenruo <[email protected]>
@VladimirMrzv
Copy link
Author

yesterday finished scrub process, but need manual cancel before power off or reboot and resume after boot with option resume. I think need check start process and force resume not start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants