Skip to contentSkip to conversation

Unconventional reshape - a success story

DISCUSSION Roman Mamedov 2 participants 3 messages Apr 11, 2011 MD RAID

lore
Share & tools
lore
#0 lore raw

Hello,

Thought I'd share this 'trick' (if using the documented functionality can be called that :).

I needed to upgrade my 3-disk RAID5 to a 5-disk RAID6. Problem is, due to a lack of free space I needed to do that in stages, i.e. add one drive, gain additional space in the array, move some data over, then add another drive.

The usual way of doing this perhaps would be to first reshape to a 4-disk RAID5, and only after that to a 5-disk RAID6.

But I wanted to have this done in just one reshape. So I got the idea to reshape from a 3-disk RAID5 right to a degraded 5-disk RAID6 (with 4 drives active and one missing).

On my RAID5 with 3 "active" drives and 1 newly-added "spare" drive I executed:

  mdadm --grow --level=6 --raid-devices=5 /dev/md0

And indeed, this worked exactly as intended:

/dev/md0:

        Version : 1.2

Creation Time : Wed Jun 9 12:14:49 2010
Raid Level : raid6
Array Size : 3887004672 (3706.94 GiB 3980.29 GB)
Used Dev Size : 1943502336 (1853.47 GiB 1990.15 GB)
Raid Devices : 5
Total Devices : 4
Persistence : Superblock is persistent

Update Time : Fri Apr 8 11:52:03 2011
State : clean, degraded, recovering
Active Devices : 3
Working Devices : 4
Failed Devices : 0
Spare Devices : 1

Layout : left-symmetric-6
Chunk Size : 64K

Reshape Status : 0% complete
Delta Devices : 1, (4->5)
New Layout : left-symmetric

Name : natsu:0 (local to host natsu) UUID : 7f0c87dd:bcd14e11:7624e659:a7701e85
Events : 35389

Number Major Minor RaidDevice State
0 8 35 0 active sync /dev/sdc3
1 8 67 1 active sync /dev/sde3
3 8 51 2 active sync /dev/sdd3
4 8 99 3 spare rebuilding /dev/sdg3
4 0 0 4 removed

Signature · 2 lines
With respect,
Roman
#1 lore raw
Quoted 1 line · On Mon, 11 Apr 2011 16:09:46 +0600 Roman Mamedov <[email protected]> wrote:

And indeed, this worked exactly as intended:

Music to my ears :-)

NeilBrown

#2 lore raw
Quoted 5 lines · On Mon, 11 Apr 2011 20:46:21 +1000 NeilBrown <[email protected]> wrote:
Quoted 1 line · On Mon, 11 Apr 2011 16:09:46 +0600 Roman Mamedov <[email protected]> wrote:

And indeed, this worked exactly as intended:

Music to my ears :-)

Thank you very much for this great software. :)

Signature · 2 lines
With respect,
Roman