大网数据广告活动
服务器运维问答

How to stop resync and start rebuild on software raid (mdadm)?

· 52CE 我爱测

I have RAID6 on 24 drives. The raid was setup with mdadm , so it is a software raid. One of the drives died and the server freezed due to that, so it had to be rebooted using Power Cycle (power off + power on). When the server bo…

问题原文

原帖链接 · Tomas M · CC BY-SA 3.0

I have RAID6 on 24 drives. The raid was setup with mdadm, so it is a software raid. One of the drives died and the server freezed due to that, so it had to be rebooted using Power Cycle (power off + power on).

When the server booted, it started the RAID array with 23 devices, and it started resync operation. If I understand it correctly, this resync just reads data on all drives and checks if everything is all right, no writes are performed. I can confirm this by iostat -m 1 which shows only reading.

So I've replaced the faulty drive by a new one, and I would like to start REBUILD, so it actually writes data to the newly added device. I have issued the following command:

mdadm --add /dev/md0 /dev/sdc # this adds sdc to the array

It went smoothly, however the raid is still resyncing, not rebuilding. The drive is reported as spare (S) in /proc/mdstat, and it probably waits for the resync to finish in order to start rebuild.

I have to say that I don't care about resync, I need it stopped immediately and start rebuild immediately. Is there any way to do that? Thank you

已采纳解答

原帖链接 · Tomas M · CC BY-SA 3.0

I was not able to wait for a solution, anything I found online didn't work while the array was active. So I stopped the array

mdadm --stop /dev/md0

and then started it again

mdadm --assemble /dev/md0 /dev/sd{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x}

This effectively stopped the resync and started rebuild.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-07-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。