On 11/23/20 10:46 AM, Simon Matter wrote:>> Hi, >> >> I want to replace my hard drives based SW RAID-1 with SSD's. >> >> What would be the recommended procedure? Can I just remove one drive, >> replace with SSD and rebuild, then repeat with the other drive? > > I suggest to "mdadm --fail" one drive, then "mdadm --remove" it. After > replacing the drive you can "mdadm --add" it. > > If you boot from the drives you also have to care for the boot loader. I > guess this depends on how exactly the system is configured.Thanks, that's what I had in mind. Of course, I will rebuild grab2 after each iteration. Thanks Fra -- <listfrank1 at gmail.com>
On 23/11/2020 15:49, Frank Bures wrote:> On 11/23/20 10:46 AM, Simon Matter wrote: >>> Hi, >>> >>> I want to replace my hard drives based SW RAID-1 with SSD's. >>> >>> What would be the recommended procedure?? Can I just remove one drive, >>> replace with SSD and rebuild, then repeat with the other drive? >> >> I suggest to "mdadm --fail" one drive, then "mdadm --remove" it. After >> replacing the drive you can "mdadm --add" it. >> >> If you boot from the drives you also have to care for the boot loader. I >> guess this depends on how exactly the system is configured. > > Thanks, that's what I had in mind.? Of course, I will rebuild grab2 > after each iteration. > > Thanks > Fra > >You could also grow the array to add in the new devices before removing the old HDDs ensuring you retain at least 2 devices in the array at any one time. For example, in an existing raid of sda1 and sdb1, add in sdc1 before removing sda1 and add sdd1 before removing sdb1, finally shrinking the array back to 2 devices: mdadm --grow /dev/md127 --level=1 --raid-devices=3 --add /dev/sdc1 mdadm --fail /dev/md127 /dev/sda1 mdadm --remove /dev/md127 /dev/sda1 mdadm /dev/md127 --add /dev/sdd1 mdadm --fail /dev/md127 /dev/sdb1 mdadm --remove /dev/md127 /dev/sdb1 mdadm --grow /dev/md127 --raid-devices=2 then reinstall grub to sdc and sdd once everything has fully sync'd: blockdev --flushbufs /dev/sdc1 blockdev --flushbufs /dev/sdd1 grub2-install --recheck /dev/sdc grub2-install --recheck /dev/sdd
On 23/11/2020 16:49, Frank Bures wrote:> On 11/23/20 10:46 AM, Simon Matter wrote: >>> Hi, >>> >>> I want to replace my hard drives based SW RAID-1 with SSD's. >>> >>> What would be the recommended procedure?? Can I just remove one drive, >>> replace with SSD and rebuild, then repeat with the other drive? >> >> I suggest to "mdadm --fail" one drive, then "mdadm --remove" it. After >> replacing the drive you can "mdadm --add" it. >> >> If you boot from the drives you also have to care for the boot loader. I >> guess this depends on how exactly the system is configured. >If you can the new disks while the original 2 disks are still available then grow, add, wait, fail, remove, shrink. That way you will never loose redundancy... # grow and add new disk mdadm --grow -n 3 /dev/mdX -a /dev/... # wait for rebuild of the array mdadm --wait /dev/mdX # fail old disk mdadm --fail /dev/sdY # remove old disk mdadm /dev/mdX? --remove /dev/sdY # add second disk mdadm /dev/mdX --add /dev/... # wait mdadm --wait /dev/mdX # fail and remove old disk mdadm --fail /dev/sdZ mdadm /dev/mdX? --remove /dev/sdZ # shrink mdadm? --grow -n 2 /dev/mdX peter
Backup!!!!!!!! Von meinem iPhone gesendet> Am 23.11.2020 um 17:10 schrieb centos at niob.at: > > ?On 23/11/2020 16:49, Frank Bures wrote: >> On 11/23/20 10:46 AM, Simon Matter wrote: >>>> Hi, >>>> >>>> I want to replace my hard drives based SW RAID-1 with SSD's. >>>> >>>> What would be the recommended procedure? Can I just remove one drive, >>>> replace with SSD and rebuild, then repeat with the other drive? >>> >>> I suggest to "mdadm --fail" one drive, then "mdadm --remove" it. After >>> replacing the drive you can "mdadm --add" it. >>> >>> If you boot from the drives you also have to care for the boot loader. I >>> guess this depends on how exactly the system is configured. >> > If you can the new disks while the original 2 disks are still available then grow, add, wait, fail, remove, shrink. That way you will never loose redundancy... > > # grow and add new disk > > mdadm --grow -n 3 /dev/mdX -a /dev/... > > # wait for rebuild of the array > > mdadm --wait /dev/mdX > > # fail old disk > > mdadm --fail /dev/sdY > > # remove old disk > > mdadm /dev/mdX --remove /dev/sdY > > # add second disk > > mdadm /dev/mdX --add /dev/... > > # wait > > mdadm --wait /dev/mdX > > # fail and remove old disk > > mdadm --fail /dev/sdZ > > mdadm /dev/mdX --remove /dev/sdZ > > # shrink > > mdadm --grow -n 2 /dev/mdX > > > > > peter > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos