每次重新启动后 mdadm 检查 RAID 5 阵列

mas*_*rds 5 server mdadm hard-drive raid5

系统信息:Ubuntu 20.04 Software raid 5(添加了第三个硬盘并从 raid 1 转换)。FS 是 LUKS 之上的 Ext4。

我发现重新启动后系统速度变慢,因此我通过 proc/mdstat 检查了阵列状态,它显示以下内容:

Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10]
md0 : active raid5 sdb[2] sdc[0] sdd[1]
      7813772928 blocks super 1.2 level 5, 64k chunk, algorithm 2 [3/3] [UUU]
      [==>..................]  check = 14.3% (558996536/3906886464) finish=322.9min speed=172777K/sec
      bitmap: 0/30 pages [0KB], 65536KB chunk
unused devices: <none>
Run Code Online (Sandbox Code Playgroud)

正在重新检查,但不知道为什么。没有 cron 作业设置。这是日志条目,在系统转换为 RAID5 之后,每次重新启动后都会出现该日志条目,但我不确定是否每次都重新检查:

Jan  3 14:34:47 <sysname> kernel: [    3.473942] md/raid:md0: device sdb operational as raid disk 2
Jan  3 14:34:47 <sysname> kernel: [    3.475170] md/raid:md0: device sdc operational as raid disk 0
Jan  3 14:34:47 <sysname> kernel: [    3.476402] md/raid:md0: device sdd operational as raid disk 1
Jan  3 14:34:47 <sysname> kernel: [    3.478290] md/raid:md0: raid level 5 active with 3 out of 3 devices, algorithm 2
Jan  3 14:34:47 <sysname> kernel: [    3.520677] md0: detected capacity change from 0 to 8001303478272
Run Code Online (Sandbox Code Playgroud)

mdadm --详细信息 /dev/md0

/dev/md0:
           Version : 1.2
     Creation Time : Wed Nov 25 23:06:18 2020
        Raid Level : raid5
        Array Size : 7813772928 (7451.79 GiB 8001.30 GB)
     Used Dev Size : 3906886464 (3725.90 GiB 4000.65 GB)
      Raid Devices : 3
     Total Devices : 3
       Persistence : Superblock is persistent
     Intent Bitmap : Internal
       Update Time : Sun Jan  3 16:17:28 2021
    State : clean, checking
    Active Devices : 3
   Working Devices : 3
    Failed Devices : 0
     Spare Devices : 0
            Layout : left-symmetric
        Chunk Size : 64K
Consistency Policy : bitmap
      Check Status : 16% complete
              Name : ubuntu-server:0
              UUID : <UUID>
            Events : 67928
    Number   Major   Minor   RaidDevice State
       0       8       32        0      active sync   /dev/sdc
       1       8       48        1      active sync   /dev/sdd
       2       8       16        2      active sync   /dev/sdb
Run Code Online (Sandbox Code Playgroud)

这是正常行为吗?

感谢任何输入

小智 1

更新 18/06/2021

\n

对于 mdcheck_start.timer 中的 svc mdcheck_continue.timer;执行 sudo systemctl stop ${svc}; sudo systemctl 禁用 ${svc}; 完毕

\n

摘自:\n https://a20.net/bert/2020/11/02/disable-periodic-raid-check-on-ubuntu-20-04-systemd/

\n

更新于 2021 年 4 月 5 日开始。
\n我之前的回答似乎没有帮助。
\n尽管发生了更改,但检查再次发生/etc/default/mdadm

\n

我发现了其他事情需要调查。
\n mdcheck_start.service
\n mdcheck_start.timer
\n mdcheck_continue.service
\n mdcheck_continue.timer
\n /etc/systemd/system/mdmonitor.service.wants/mdcheck_start.timer
\n /etc/systemd/system/mdmonitor.service.wants/mdcheck_continue.timer
\n/etc/systemd/system/mdmonitor.service.wants/mdmonitor-oneshot.timer

\n
systemctl status mdcheck_start.service\n\xe2\x97\x8f mdcheck_start.service - MD array scrubbing\n     Loaded: loaded (/lib/systemd/system/mdcheck_start.service; static; vendor preset: enabled)\n     Active: inactive (dead)\nTriggeredBy: \xe2\x97\x8f mdcheck_start.timer\n
Run Code Online (Sandbox Code Playgroud)\n
systemctl status mdcheck_start.timer\n\xe2\x97\x8f mdcheck_start.timer - MD array scrubbing\n     Loaded: loaded (/lib/systemd/system/mdcheck_start.timer; enabled; vendor preset: enabled)\n     Active: active (waiting) since Sun 2021-05-02 19:40:50 CEST; 1 day 14h ago\n    Trigger: Sun 2021-06-06 22:36:42 CEST; 1 months 3 days left\n   Triggers: \xe2\x97\x8f mdcheck_start.service\n\nMay 02 19:40:50 xxx systemd[1]: Started MD array scrubbing.\n\n
Run Code Online (Sandbox Code Playgroud)\n
systemctl status mdcheck_continue.service\n\xe2\x97\x8f mdcheck_continue.service - MD array scrubbing - continuation\n     Loaded: loaded (/lib/systemd/system/mdcheck_continue.service; static; vendor preset: enabled)\n     Active: inactive (dead)\nTriggeredBy: \xe2\x97\x8f mdcheck_continue.timer\n  Condition: start condition failed at Tue 2021-05-04 06:38:39 CEST; 3h 26min ago\n             \xe2\x94\x94\xe2\x94\x80 ConditionPathExistsGlob=/var/lib/mdcheck/MD_UUID_* was not met\n
Run Code Online (Sandbox Code Playgroud)\n
systemctl status mdcheck_continue.timer\n\xe2\x97\x8f mdcheck_continue.timer - MD array scrubbing - continuation\n     Loaded: loaded (/lib/systemd/system/mdcheck_continue.timer; enabled; vendor preset: enabled)\n     Active: active (waiting) since Sun 2021-05-02 19:40:50 CEST; 1 day 14h ago\n    Trigger: Wed 2021-05-05 00:35:53 CEST; 14h left\n   Triggers: \xe2\x97\x8f mdcheck_continue.service\n\nMay 02 19:40:50 xxx systemd[1]: Started MD array scrubbing - continuation.\n
Run Code Online (Sandbox Code Playgroud)\n
sudo cat /etc/systemd/system/mdmonitor.service.wants/mdcheck_start.timer\n#  This file is part of mdadm.\n#\n#  mdadm is free software; you can redistribute it and/or modify it\n#  under the terms of the GNU General Public License as published by\n#  the Free Software Foundation; either version 2 of the License, or\n#  (at your option) any later version.\n\n[Unit]\nDescription=MD array scrubbing\n\n[Timer]\nOnCalendar=Sun *-*-1..7 1:00:00\nRandomizedDelaySec=24h\nPersistent=true\n\n[Install]\nWantedBy=mdmonitor.service\nAlso=mdcheck_continue.timer\n
Run Code Online (Sandbox Code Playgroud)\n
sudo cat /etc/systemd/system/mdmonitor.service.wants/mdcheck_continue.timer \n#  This file is part of mdadm.\n#\n#  mdadm is free software; you can redistribute it and/or modify it\n#  under the terms of the GNU General Public License as published by\n#  the Free Software Foundation; either version 2 of the License, or\n#  (at your option) any later version.\n\n[Unit]\nDescription=MD array scrubbing - continuation\n\n[Timer]\nOnCalendar=daily\nRandomizedDelaySec=12h\nPersistent=true\n\n[Install]\nWantedBy=mdmonitor.service\n
Run Code Online (Sandbox Code Playgroud)\n
sudo cat /etc/systemd/system/mdmonitor.service.wants/mdmonitor-oneshot.timer \n#  This file is part of mdadm.\n#\n#  mdadm is free software; you can redistribute it and/or modify it\n#  under the terms of the GNU General Public License as published by\n#  the Free Software Foundation; either version 2 of the License, or\n#  (at your option) any later version.\n\n[Unit]\nDescription=Reminder for degraded MD arrays\n\n[Timer]\nOnCalendar=daily\nRandomizedDelaySec=24h\nPersistent=true\n\n[Install]\nWantedBy= mdmonitor.service\n
Run Code Online (Sandbox Code Playgroud)\n

更新于 2021 年 4 月 5 日结束。

\n
\n

尝试sudo dpkg-reconfigure mdadm

\n

请注意,我不确定上述提示是否有帮助。
\n我在 20.04 上的 raid5 也有同样的问题。

\n

首先,我尝试/etc/default/mdadm手动编辑并更改AUTOCHECK=trueAUTOCHECK=false。\n它没有帮助。

\n

今天我已经使用了dpkg-reconfigure mdadm。\n现在该/etc/default/mdadm文件看起来相同 ( AUTOCHECK=false),但作为其中的一部分,dpkg-reconfigure mdadm还有一个update-initramfs调用。我希望它会有所帮助。

\n

... update-initramfs: deferring update (trigger activated) ...

\n

扩展日志:

\n
sudo dpkg-reconfigure mdadm\nupdate-initramfs: deferring update (trigger activated)\nSourcing file `/etc/default/grub\'\nSourcing file `/etc/default/grub.d/50-curtin-settings.cfg\'\nSourcing file `/etc/default/grub.d/init-select.cfg\'\nGenerating grub configuration file ...\nFile descriptor 3 (pipe:[897059]) leaked on vgs invocation. Parent PID 655310: /usr/sbin/grub-probe\nFile descriptor 3 (pipe:[897059]) leaked on vgs invocation. Parent PID 655310: /usr/sbin/grub-probe\nFound linux image: /boot/vmlinuz-5.4.0-72-generic\nFound initrd image: /boot/initrd.img-5.4.0-72-generic\nFound linux image: /boot/vmlinuz-5.4.0-71-generic\nFound initrd image: /boot/initrd.img-5.4.0-71-generic\nFound linux image: /boot/vmlinuz-5.4.0-70-generic\nFound initrd image: /boot/initrd.img-5.4.0-70-generic\nFile descriptor 3 (pipe:[897059]) leaked on vgs invocation. Parent PID 655841: /usr/sbin/grub-probe\nFile descriptor 3 (pipe:[897059]) leaked on vgs invocation. Parent PID 655841: /usr/sbin/grub-probe\ndone\nProcessing triggers for initramfs-tools (0.136ubuntu6.4) ...\nupdate-initramfs: Generating /boot/initrd.img-5.4.0-72-generic\n
Run Code Online (Sandbox Code Playgroud)\n

完整/etc/default/mdadm文件:

\n
cat /etc/default/mdadm \n# mdadm Debian configuration\n#\n# You can run \'dpkg-reconfigure mdadm\' to modify the values in this file, if\n# you want. You can also change the values here and changes will be preserved.\n# Do note that only the values are preserved; the rest of the file is\n# rewritten.\n#\n\n# AUTOCHECK:\n#   should mdadm run periodic redundancy checks over your arrays? See\n#   /etc/cron.d/mdadm.\nAUTOCHECK=false\n\n# AUTOSCAN:\n#   should mdadm check once a day for degraded arrays? See\n#   /etc/cron.daily/mdadm.\nAUTOSCAN=true\n\n# START_DAEMON:\n#   should mdadm start the MD monitoring daemon during boot?\nSTART_DAEMON=true\n\n# DAEMON_OPTIONS:\n#   additional options to pass to the daemon.\nDAEMON_OPTIONS="--syslog"\n\n# VERBOSE:\n#   if this variable is set to true, mdadm will be a little more verbose e.g.\n#   when creating the initramfs.\nVERBOSE=false\n
Run Code Online (Sandbox Code Playgroud)\n