Re: RAID 1 | Changing HDs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 3 Sep 2025 at 20:45 +0500, Roman Mamedov wrote:
> If so, the safest would be to connect all three drives, and then:
> 
>   mdadm --add (new drive)
>   mdadm --grow -n3 (array)
>   mdadm --fail --remove (old drive).
>   mdadm --grow -n2 (array)

I do something similar about once a year on my RAID5 array: I replace the oldest drive with a new
one so each drive gets refreshed roughly every three years.

The main difference is that I use mdadm’s "replace" feature, which keeps the array non-degraded
while the data is copied:

mdadm /dev/md0 --add-spare /dev/new_drive
mdadm /dev/md0 --replace /dev/old_drive --with /dev/new_drive


(not sure if this also works for other RAID levels)

On my setup the copy takes about 8 hours. After it completes:

mdadm /dev/md0 --remove /dev/old_drive

This minimizes the time the array would otherwise run degraded and thus reduces the risk of a second
failure during a rebuild.

regards, Michael


-- 
Michael Reinelt <michael@xxxxxxxxxxxxx>
Ringsiedlung 75
A-8111 Gratwein-Straßengel
+43 676 3079941





[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux