prevent btrfs scrub from running at a certain time

  • I know i can change the btrfs scrub schedule from monthly to weekly. However i need something different: to absolutely make sure that there is no operation running on saturday mornings, as interferes with my regular VM backup and makes OMV crash. how can i achieve this?

    SuperMicro CSE-825, X11SSH-F, Xeon E3-1240v6, 32 GB ECC RAM, LSI 9211-8i HBA controller, 2x 8 TB, 1x 4 TB, 1x3TB, MergerFS+SnapRAID

    Powered by Proxmox VE

    • Offizieller Beitrag

    If you look at the change log, it tells you how to do this - https://github.com/openmediava…840ac8b6344489c155a4e5440

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • votdev

    Hat das Label gelöst hinzugefügt.
  • votdev

    Hat das Label OMV 6.x hinzugefügt.
  • somehow i ignored this problem hoping that the scrub times wont interfere with the scheduled backups, now getting back to this.

    how to i set the schudule in OMV for the scrub to run once per month on mondays at 01:00? choosing monthly does not allow me to set specific days or hours.

    choosing "Certain day" i don't know what to enter. i could enter to run in on every 15th of the month, but i want to force it to a specific day of the week and not day of the month


    SuperMicro CSE-825, X11SSH-F, Xeon E3-1240v6, 32 GB ECC RAM, LSI 9211-8i HBA controller, 2x 8 TB, 1x 4 TB, 1x3TB, MergerFS+SnapRAID

    Powered by Proxmox VE

  • *IF* you issue a CANCEL then after Saturday morning you issue a RESUME, would this affect the scrub operation if the data changed? I don't use BTRFS but, maybe let the caller clear a window instead of the callee. I dunno, maybe create a script with btrfs scrub cancel /a/b/c .../n... btrfs scrub resume /a/b/c then run that before backing up.


    EDIT: never mind, I should read, put the command in a script (or not) and then (I don't see how to do it in the GUI):

    Code
    00 1 1-7 * *    root    [ `/bin/date +\%u` -eq 1 ] && /home/$USER/scrub.bash

    Got that from here: https://superuser.com/question…rst-monday-of-every-month

  • this btrfs scrub thing is driving me crazy. scrubbing a single drive takes around 8-12 hours depending on size and filled space. i have 6 of them. when scrubbing is ongoing drive read speeds drop below 10 MB/s. when at the same time a torrent client is trying to download with 20-30 MB/s my system is pretty much useless for 2-3 days even for the most basic tasks.


    i think no amount of scheduling magic can solve this, the best solution would be to do some partial scrubs, like scrub each day for one our until the disk is finished then move on to the next disk. but of course, disk content is changing, maybe this could render the whole scrubbing process useless...

    SuperMicro CSE-825, X11SSH-F, Xeon E3-1240v6, 32 GB ECC RAM, LSI 9211-8i HBA controller, 2x 8 TB, 1x 4 TB, 1x3TB, MergerFS+SnapRAID

    Powered by Proxmox VE

  • You can pause any modern torrent client via it's CLI or using curl/wget/etc.


    With qbittorent it would be something like this, although I don't know the pause syntax (RTFM'n it)


    Code
    sid=$(curl -v -d "username=${username}&password=${password}" -X POST $ip_and_port/api/v2/auth/login 2>&1 | grep -o -P '(?<=SID=)[^;]*');
    
    curl -v -H "Cookie: SID=$sid" -H 'User-Agent: whatever' "${links[@]}" $ip_and_port/api/v2/torrents/add;

    You'll replace this: ${links[@]}" $ip_and_port/api/v2/torrents/add;

    ... with whatever the pause/resume syntax (assuming you're using http to communicate).


    You've seemed to completely ignore my suggestion about scrub cancel/resume, so I assume you didn't try :-/

    • Offizieller Beitrag

    btrfsmaintenance has an option to set the priority of IO. You could install it and disable the scrub jobs from OMV


    Code
    ## Path:        System/File systems/btrfs
    ## Type:        string(idle,normal)
    ## Default:     "idle"
    #
    # Priority of IO at which the scrub process will run. Idle should not degrade
    # performance but may take longer to finish.
    BTRFS_SCRUB_PRIORITY="idle"

    and

  • what values should i set for OMV_BTRFS_SCRUB_PRIORITY? i understand from this https://man7.org/linux/man-pages/man1/ionice.1.html, that the value i should be setting should be -c 3 however its not clear to me how the env value translates to the scrub command.


    also, are there any plans to migrate the environment variables to a config file or something? i hate them so much it made me google this article https://medium.com/israeli-tec…ver-env-vars-d9189d53c4b8 which articulates in a nice way what i cannot due to how much i hate them

    SuperMicro CSE-825, X11SSH-F, Xeon E3-1240v6, 32 GB ECC RAM, LSI 9211-8i HBA controller, 2x 8 TB, 1x 4 TB, 1x3TB, MergerFS+SnapRAID

    Powered by Proxmox VE

    • Offizieller Beitrag

    what values should i set for OMV_BTRFS_SCRUB_PRIORITY? i understand from this https://man7.org/linux/man-pages/man1/ionice.1.html, that the value i should be setting should be -c 3 however its not clear to me how the env value translates to the scrub command.

    You can see in line 77 that the configured command line args are used to run the btrfs scrub command. Populate the OMV_BTRFS_SCRUB_PRIORITY env var with the command line args of your choice.


    also, are there any plans to migrate the environment variables to a config file or something? i hate them so much it made me google this article https://medium.com/israeli-tec…ver-env-vars-d9189d53c4b8 which articulates in a nice way what i cannot due to how much i hate them

    No, i'll stay with the env vars because they are much simpler to handle than a config file.

  • Hi guys, thanks for the work


    I'm a kinda a linux newbie and I have a question about changing this OMV_BTRFS_SCRUB_PRIORITY environment variable.


    I got from the doc that running

    Code
    omv-env list

    Should get me the list of all variables usable, I get OMV_BTRFS_SCRUB_ENABLED and _PERIOD for example, but I don't see OMV_BTRFS_SCRUB_PRIORITY.


    Should I still use:

    Code
    omv-env set -- OMV_BTRFS_SCRUB_PRIORITY "-c 3"

    I get the same issue as molnart, so i'd like to set the priority to idle too.

    And then running the commands to apply the changes


    Or do i have to do something else like modifying a file ?? (but I don't get which one if it's the case)


    Thanks

    • Offizieller Beitrag

    Not all scripts have been parsed for existing env vars. But this doesn't matter, set it via the tool and your fine.

  • Code
    omv-env set -- OMV_BTRFS_SCRUB_PRIORITY "-c 3"

    why is there a -- in the command? without it i get an error

    Code
    molnart@omv6:~$ sudo omv-env set OMV_BTRFS_SCRUB_PRIORITY "-c 3"
    Usage: omv-env set [OPTIONS] KEY VALUE
    Try 'omv-env set --help' for help.

    SuperMicro CSE-825, X11SSH-F, Xeon E3-1240v6, 32 GB ECC RAM, LSI 9211-8i HBA controller, 2x 8 TB, 1x 4 TB, 1x3TB, MergerFS+SnapRAID

    Powered by Proxmox VE

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!