[opensuse] Rebuilding a broken RAID1 array with previously used RAID1 partition
Hi, I have two near identical boxes, each with RAID1 arrays: Box 1 md0 = Partitions /dev/sda1+/dev/sdb1 Disk sdb is dead Box 2 md0 = Partitions /dev/sda1+/dev/sdb1 Disk sda is dead I would like to repair Box 2 using the good disk sda taken from Box 1. After reading https://www.howtoforge.com/replacing_hard_disks_in_a_raid1_array My plan is to 1. On Box 2, mdadm --manage /dev/md0 --fail /dev/sda1 2. Place good drive taken from Box 1 in Box 2 as the "new" sda 3. On Box 2, mdadm --manage /dev/md0 --add /dev/sda1 However the "new" partition /dev/sda1 is already a healthy RAID1 partition. Will it be automatically wiped clean of all previous Box 1 data before the Box 2 synchronisation takes place? I cannot find any documentation which says this. I don't want to end up with Box 1 data plus Box 2 data. Roger -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hi Roger, a RAID1 mirrors all data on each partition. As long as there is at least one working partition in a RAID1 it is not broken -- although it is called "degraded" as soon as one partition has dropped out. If you want to repair Box 2 do the following as root: swapoff -a mdadm --manage /dev/md0 --fail /dev/sda1 --remove /dev/sda1 shutdown -h now ----- System is now off. Disconnect power and replace the failed drive with a new drive or at least take care that there is a partition available with at least as much space as /dev/sdb1. Then connect power again and boot the system. Check if the drives have the same name, e.g. with smartctl -a /dev/sdb. That gives you the serial number of the drive. If you want to copy the partition table of drive /dev/sdb to a new disk /dev/sda give the command: dd if=/dev/sdb of=/dev/sda count=1 bs=512 Now you can insert the fresh partition /dev/sda1 into the degraded RAID1 by mdadm /dev/md0 --add /dev/sda1 After that, the RAID1 will automatically rebuild itself. You can watch that by: cat /proc/mdstat If you go ahead as you suggested in your post your Box 1 will be lost as all data on the only remaining healthy partition of box 1 would be overwritten. You can repair Box 1 in the same way as described here. Good luck Wilhelm Am 28.03.2016 um 12:01 schrieb Roger Price:
Hi, I have two near identical boxes, each with RAID1 arrays:
Box 1 md0 = Partitions /dev/sda1+/dev/sdb1 Disk sdb is dead
Box 2 md0 = Partitions /dev/sda1+/dev/sdb1 Disk sda is dead
I would like to repair Box 2 using the good disk sda taken from Box 1. After reading https://www.howtoforge.com/replacing_hard_disks_in_a_raid1_array My plan is to
1. On Box 2, mdadm --manage /dev/md0 --fail /dev/sda1
2. Place good drive taken from Box 1 in Box 2 as the "new" sda
3. On Box 2, mdadm --manage /dev/md0 --add /dev/sda1
However the "new" partition /dev/sda1 is already a healthy RAID1 partition. Will it be automatically wiped clean of all previous Box 1 data before the Box 2 synchronisation takes place? I cannot find any documentation which says this. I don't want to end up with Box 1 data plus Box 2 data.
Roger
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Roger Price wrote:
Hi, I have two near identical boxes, each with RAID1 arrays:
Box 1 md0 = Partitions /dev/sda1+/dev/sdb1 Disk sdb is dead
Box 2 md0 = Partitions /dev/sda1+/dev/sdb1 Disk sda is dead
I would like to repair Box 2 using the good disk sda taken from Box 1. After reading https://www.howtoforge.com/replacing_hard_disks_in_a_raid1_array My plan is to
1. On Box 2, mdadm --manage /dev/md0 --fail /dev/sda1 2. Place good drive taken from Box 1 in Box 2 as the "new" sda 3. On Box 2, mdadm --manage /dev/md0 --add /dev/sda1
However the "new" partition /dev/sda1 is already a healthy RAID1 partition. Will it be automatically wiped clean of all previous Box 1 data before the Box 2 synchronisation takes place? I cannot find any documentation which says this. I don't want to end up with Box 1 data plus Box 2 data.
Yes, a newly added disk will be presumed to be empty. If valid signatures or super blocks are found, you may need to confirm at some point. -- Per Jessen, Zürich (9.8°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (3)
-
Per Jessen
-
Roger Price
-
Wilhelm Köpper