我有一个 RAID5 阵列,我尝试在其中添加磁盘以扩大阵列,但似乎卡住了。我找到了有关类似问题的各种帖子,但似乎找不到明确的解决方案。
基本上,我是这样做的:
mdadm --grow --raid-devices=6 --backup-file=/root/grow_md0.bak /dev/md0
现在,我得到:
[root@server ~]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid5 sdg1[7] sde1[3] sdd1[5] sdc1[6] sda1[2] sdb1[0]
15627540480 blocks super 1.2 level 5, 512k chunk, algorithm 2 [6/6] [UUUUUU]
[>....................] reshape = 0.0% (4096/3906885120) finish=362200428.2min speed=0K/sec
注意 0k/sec 的速度。现在,4096 原本是 1024。我根据一些建议尝试了此方法:
mdadm --grow --continue --backup-file=/root/grow_md0.bak /dev/md0
这将 1024 提升到 2048,但没有做其他事情。
我还注意到此时/root/grow_md0.bak
根本不存在。其他几次“继续”尝试使我达到了 4096,但仅此而已。
其他信息:
[root@server ~]# cat /sys/block/md0/md/stripe_cache_size
643
[root@server ~]# cat /sys/block/md0/md/sync_min
0
[root@server ~]# cat /sys/block/md0/md/sync_max
8192
[root@server ~]# cat /sys/block/md0/md/sync_speed
0
[root@server ~]# cat /proc/sys/dev/raid/speed_limit_min
50000
[root@server ~]# cat /proc/sys/dev/raid/speed_limit_max
200000
[root@server ~]# dmesg |grep md
[ 2734.805157] md: md_do_sync() got signal ... exiting
[ 2735.071850] md: reshape of RAID array md0
[ 2735.071854] md: minimum _guaranteed_ speed: 50000 KB/sec/disk.
[ 2735.071855] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reshape.
[ 2735.071860] md: using 128k window, over a total of 3906885120k.
[ 2766.527554] md: md_do_sync() got signal ... exiting
[ 2766.578718] md: reshape of RAID array md0
[ 2766.578722] md: minimum _guaranteed_ speed: 50000 KB/sec/disk.
[ 2766.578723] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reshape.
[ 2766.578728] md: using 128k window, over a total of 3906885120k.
[ 2950.824300] md: md_do_sync() got signal ... exiting
[ 2950.874411] md: reshape of RAID array md0
[ 2950.874418] md: minimum _guaranteed_ speed: 50000 KB/sec/disk.
[ 2950.874420] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reshape.
[ 2950.874427] md: using 128k window, over a total of 3906885120k.
[ 2974.287731] md: md_do_sync() got signal ... exiting
[ 2974.365615] md: reshape of RAID array md0
[ 2974.365620] md: minimum _guaranteed_ speed: 50000 KB/sec/disk.
[ 2974.365621] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reshape.
[ 2974.365625] md: using 128k window, over a total of 3906885120k.
在这里做些改变会有帮助吗?我将其增加到speed_limit_min
50000,但这似乎没有任何效果,因为它卡住了,而不是变慢了。
编辑
我尝试更新stripe_cache_size
到 16384,但没有成功。
答案1
经过大量搜索后,我终于找到了这个链接:https://www.spinics.net/lists/raid/msg45107.html
确定这样做:
echo max > /sys/block/md0/md/sync_max
这启动了同步。希望这能帮助其他寻找答案的人。
答案2
它对我有用。我只需要使用(因为许可):
sudo nano /sys/block/md4/md/sync_max
并保存字符串:max
您也可以使用命令:
echo max |sudo tee /sys/block/md4/md/sync_max