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

Linux- Convert 2 disk raid1 to raid0

· 52CE 我爱测

I have a linux server (3.19.0) which has raid setup with md (v3.2.5). / is a raid1 device with 2 disks. There was a mistake when installing this machine, instead we need those 2 disks to be in raid0 configuration. Is there an eas…

问题原文

原帖链接 · Amandasaurus · CC BY-SA 3.0

I have a linux server (3.19.0) which has raid setup with md (v3.2.5). / is a raid1 device with 2 disks. There was a mistake when installing this machine, instead we need those 2 disks to be in raid0 configuration. Is there an easy way to change the md device like this?

I can maybe figure out how to make this happen by jugglying disks around, (and reinstalling is an option), but is there an easy way to turn a raid1 into a raid0?

In theory this feels possible to me. Is it possible for md to act like one of the disks is empty, and change the raid type from 1 to 0?

已采纳解答

原帖链接 · womble · CC BY-SA 3.0

mdadm(8) sez:

The GROW mode is used for changing the size or shape of an active array. [...] Currently the supported changes include

[...]

  • convert between RAID1 and RAID5, between RAID5 and RAID6, between RAID0, RAID4, and RAID5, and between RAID0 and RAID10 (in the near-2 mode).

So, going from RAID1 to RAID0 doesn't appear to be possible. If you had a third disk, you could perhaps go from RAID1 to RAID5 to RAID0, but that seems like a rather roundabout way to do it.

The manpage does, however, say that you can "increase or decrease the "raid-devices" attribute of RAID0, RAID1, RAID4, RAID5, and RAID6", so you could break the RAID1, turn one of the disks into a new one-disk RAID0 array, copy the data across, then nuke the other half of the RAID1 and add that now available disk into the RAID0.

Finally, you can do it the right way, and just backup the data, reconfigure the RAID array offline, and then restore the backup onto the new array.

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

资料来源与适用范围

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

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

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