Skip to content
Snippets Groups Projects

fix-Ubuntu-Bug1942935

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Florian Klemenz
    Edited
    fix-Ubuntu-Bug1942935.sh 1.32 KiB
    
    # Fixes: kernel io hangs during mdcheck/resync 
    # (https://bugs.launchpad.net/ubuntu/+source/linux-signed-hwe-5.11/+bug/1942935)
    
    # Causing hangs when starting and stopping mdraid scrubs periodically as it is implemented in 
    # Ubuntu 20.04 and above
    #
    # adapted from https://bugs.launchpad.net/ubuntu/+source/linux-signed-hwe-5.11/+bug/1942935/comments/5
    #
    # In case of desaster, this may help:
    # echo active > /sys/block/md1/md/array_state
    # (https://bugs.launchpad.net/ubuntu/+source/linux-signed-hwe-5.11/+bug/1942935/comments/10)
    
    
    rm /etc/systemd/system/mdcheck_start.timer /etc/systemd/system/mdcheck_start.service
    systemctl mask mdcheck_continue.service mdcheck_continue.timer mdcheck_start.service mdcheck_start.timer
    cat > /etc/cron.d/mdadm << 'EOF'
    #
    # cron.d/mdadm -- schedules periodic redundancy checks of MD devices
    #
    # Copyright © martin f. krafft <email address hidden>
    # distributed under the terms of the Artistic Licence 2.0
    #
    
    # By default, run at 00:57 on every Sunday, but do nothing unless the day of
    # the month is less than or equal to 7. Thus, only run on the first Sunday of
    # each month. crontab(5) sucks, unfortunately, in this regard; therefore this
    # hack (see #380425).
    57 0 * * 0 root if [ -x /usr/share/mdadm/checkarray ] && [ $(date +\%d) -le 7 ]; then /usr/share/mdadm/checkarray --cron --all --idle --quiet; fi
    EOF
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment