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

Disable scrub by default? #73

Open
mikhailnov opened this issue Apr 30, 2019 · 9 comments
Open

Disable scrub by default? #73

mikhailnov opened this issue Apr 30, 2019 · 9 comments
Labels

Comments

@mikhailnov
Copy link

I would suggest to disable scrub by default. It loads CPU really severely, causes very high Load Average and is not really needed when there is no RAID, I think.

@awerlang
Copy link

awerlang commented Mar 4, 2020

For single device setups: I find scrub is still helpful for detecting bitrot as soon as possible, then restore from a backup.

@mikhailnov
Copy link
Author

mikhailnov commented Mar 5, 2020 via email

@awerlang
Copy link

awerlang commented Mar 5, 2020

I was referring how it is helpful. It is not needed in a sense that no other linux native FS provides that. But it's a feature that has its worth. I'm not on board on running these routines in background though. Here scrub runs pretty fast so far, but in your case I'd look to run it at an appropriate moment manually.

@kdave
Copy link
Owner

kdave commented Mar 11, 2020

With the default it's hard to please everybody. The load caused by scrub has appeared after the CFQ (io scheduler) has been replaced by mq-deadline that does not implement ionice priorities anymore. The BFQ sheduler does, so this can be "fixed" by swtiching to it. Or disable running scrub in the sysconfig and run it manually.
On newer kernels it might be possible to confine scrub in a cgroup with all its bells and whistles to limit the resources, this is being evaluated.

@barak
Copy link

barak commented Jul 13, 2020

At least on a setup with duplication, not running scrub seems like a bad idea. I've had it fix many single-bit cosmic-ray errors.

On a setup without duplication, yeah that's more complex. It doesn't really do any good to do a scrub and then just throw away any error messages. What's really needed is a way to get the information to a human being in a position to make use of the information. This has two components. (1) Getting the fact that an unrecoverable storage corruption event has occurred. This seems straightforward, although I must admit that it doesn't seem properly available. It does seem like something that there should be an official unified API for which desktop systems etc can then queue and present appropriately. But the killer is (2) the information should be presented in a fashion that allows more humans to make use of it. So, an inode number is not very helpful for your typical non-expert. It should be resolved to a filename, and options for dealing with it should be automated and presented in a pleasant way. Like, delete the file / test the problematic block and add it to a badblocks list if it still fails / recover the file from backup, or download and reinstall it from the appropriate package if it's a system file, etc.

That's all beyond the scope of btrfsmaintenance I suppose. But the fact that there's no such infrastructure puts btrfsmaintenance in an awkward position, because btrfsmaintenance is in the job of using approved mechanisms for finding problems, but it doesn't have any good way of actually dealing with them.

@montvid
Copy link

montvid commented Jan 13, 2021

With the default it's hard to please everybody. The load caused by scrub has appeared after the CFQ (io scheduler) has been replaced by mq-deadline that does not implement ionice priorities anymore. The BFQ sheduler does, so this can be "fixed" by swtiching to it. Or disable running scrub in the sysconfig and run it manually.
On newer kernels it might be possible to confine scrub in a cgroup with all its bells and whistles to limit the resources, this is being evaluated.

Maybe it is a good idea to state that in the readme? i.e. change to bfq scheduler.

@montvid
Copy link

montvid commented Jan 14, 2021

Or better still include a script to change to bfq?

@ronnystandtke
Copy link

Or better still include a script to change to bfq?

Yes, please!
Btrfs scrub is killing my system every month for a whole day. If btrfsmaintenance could do the

modprobe bfq
echo bfq > /sys/block/sdX/queue/scheduler

before starting the btrfs scrub (and maybe resetting the scheduler to the original value afterwards) would be really helpful!

@barak
Copy link

barak commented May 17, 2021

Re btrfs scrub killing the system, and dealing with it by enabling bfq or such ... this seems like something the btrfs scrub command should be doing internally. It should have an option, like sudo btrfs scrub --bring-system-to-its-knees=no ... Anything else is just working around the original sin: btrfs scrub itself should be well behaved by default.

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

6 participants