All of lore.kernel.org
 help / color / mirror / Atom feed
* mdadm RAID1 -> 5 conversion safety
@ 2020-02-05 11:51 Paul Dann
  2020-02-05 18:29 ` Wols Lists
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Dann @ 2020-02-05 11:51 UTC (permalink / raw)
  To: linux-raid

Hi there,

I've got a load of data on an md RAID 1 array assembled from 2x4TB
disks. I'm looking to expand this by adding a third 4TB disk and
converting the array to RAID 5. Now the required procedure is
documented on the wiki, but my question is:

When I convert the RAID 1 array to RAID 5, the array will be in a
degraded state as it rebuilds onto the new disk. However, if one of
the original two disks were to fail during this procedure, is mdadm
smart enough to convert the array back to degraded RAID 1, or will my
array now be a broken RAID 5 with no path to recovery?

Many thanks,
Paul

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mdadm RAID1 -> 5 conversion safety
  2020-02-05 11:51 mdadm RAID1 -> 5 conversion safety Paul Dann
@ 2020-02-05 18:29 ` Wols Lists
  2020-02-06 22:41   ` NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: Wols Lists @ 2020-02-05 18:29 UTC (permalink / raw)
  To: Paul Dann, linux-raid

On 05/02/20 11:51, Paul Dann wrote:
> Hi there,
> 
> I've got a load of data on an md RAID 1 array assembled from 2x4TB
> disks. I'm looking to expand this by adding a third 4TB disk and
> converting the array to RAID 5. Now the required procedure is
> documented on the wiki, but my question is:
> 
> When I convert the RAID 1 array to RAID 5, the array will be in a
> degraded state as it rebuilds onto the new disk. However, if one of
> the original two disks were to fail during this procedure, is mdadm
> smart enough to convert the array back to degraded RAID 1, or will my
> array now be a broken RAID 5 with no path to recovery?

There is a "revert reshape" option which will take you back to a raid 1.
This assumes, however, that it's the new disk that has failed.

I'm pretty certain, however, that should one of the old disks fail
during the conversion you will end up with a degraded raid 5.

If you're worried, I would make sure you've done a SMART health check on
your two original drives, although that's no guarantee everything's okay.

If you really are that worried, get two new disks with the intention of
ending up at raid 6. Add a 3rd drive to the mirror, fail and remove one
of the originals, add the 4th to go raid 5, then add back the first to
go raid 6.

One thing I will say - MAKE SURE you have the latest mdadm, and if
possible make sure you're running a recent kernel. There have been
issues converting from 1 to 5. None of them serious, and all fixed by
upgrading mdadm/kernel, hence the advice to be running the latest/greatest.
> 
> Many thanks,
> Paul
> 
Cheers,
Wol

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mdadm RAID1 -> 5 conversion safety
  2020-02-05 18:29 ` Wols Lists
@ 2020-02-06 22:41   ` NeilBrown
  0 siblings, 0 replies; 3+ messages in thread
From: NeilBrown @ 2020-02-06 22:41 UTC (permalink / raw)
  To: Wols Lists, Paul Dann, linux-raid

[-- Attachment #1: Type: text/plain, Size: 2145 bytes --]

On Wed, Feb 05 2020, Wols Lists wrote:

> On 05/02/20 11:51, Paul Dann wrote:
>> Hi there,
>> 
>> I've got a load of data on an md RAID 1 array assembled from 2x4TB
>> disks. I'm looking to expand this by adding a third 4TB disk and
>> converting the array to RAID 5. Now the required procedure is
>> documented on the wiki, but my question is:
>> 
>> When I convert the RAID 1 array to RAID 5, the array will be in a
>> degraded state as it rebuilds onto the new disk. However, if one of
>> the original two disks were to fail during this procedure, is mdadm
>> smart enough to convert the array back to degraded RAID 1, or will my
>> array now be a broken RAID 5 with no path to recovery?
>
> There is a "revert reshape" option which will take you back to a raid 1.
> This assumes, however, that it's the new disk that has failed.
>
> I'm pretty certain, however, that should one of the old disks fail
> during the conversion you will end up with a degraded raid 5.

This is correct.
It is not true to say "the array will be in a degraded state as it
rebuilds onto the new disk" as Paul did above.
During the rebuild the array will be in 2 parts:
 - a non-degraded raid5 which starts small and grows
 - a non-degraded raid1 which starts large and shrinks.

at no point in time is the array without full redundancy (unless a
device fails of course).

NeilBrown


>
> If you're worried, I would make sure you've done a SMART health check on
> your two original drives, although that's no guarantee everything's okay.
>
> If you really are that worried, get two new disks with the intention of
> ending up at raid 6. Add a 3rd drive to the mirror, fail and remove one
> of the originals, add the 4th to go raid 5, then add back the first to
> go raid 6.
>
> One thing I will say - MAKE SURE you have the latest mdadm, and if
> possible make sure you're running a recent kernel. There have been
> issues converting from 1 to 5. None of them serious, and all fixed by
> upgrading mdadm/kernel, hence the advice to be running the latest/greatest.
>> 
>> Many thanks,
>> Paul
>> 
> Cheers,
> Wol

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-06 22:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 11:51 mdadm RAID1 -> 5 conversion safety Paul Dann
2020-02-05 18:29 ` Wols Lists
2020-02-06 22:41   ` NeilBrown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.