Skip to contentSkip to conversation

Safest way to renumber RAID-5 devices

DISCUSSION Ian Pilcher 2 participants 4 messages Jun 28, 2003 – Jul 1, 2003 1 message not in the archive MD RAID

lore
Share & tools
lore
#0 lore raw

Hi all!

I have several RAID-5 devices that I would like to renumber (incrementing each minor number by 1).

Is it possible to do this without re-creating them? I'd like to avoid unnecessary re-syncs as well as the possibility of screwing up.

Thanks!

Signature · 3 lines
========================================================================
Ian Pilcher                                           [email protected]
========================================================================
#1 lore raw
Quoted 8 lines · On Saturday June 28, [email protected] wrote:

Hi all!

I have several RAID-5 devices that I would like to renumber (incrementing each minor number by 1).

Is it possible to do this without re-creating them? I'd like to avoid unnecessary re-syncs as well as the possibility of screwing up.

mdadm -A --update=superminor /dev/mdNEWNUMBER /dev/sd...

should work with mdadm 1.2.0.

Obviously you have to stop the array first as "mdadm -A" starts a stopped array.

Check the manpage to make sure I haven't mispelled somthing.

NeilBrown

#2 lore raw
Quoted 5 lines · Neil Brown

mdadm -A --update=superminor /dev/mdNEWNUMBER /dev/sd...

should work with mdadm 1.2.0.

Works like a charm. I didn't realize that Red Hat was shipping a back level version (in addition to still using the old raidtools in their init scripts).

Quoted 3 lines

Check the manpage to make sure I haven't mispelled somthing.

You forgot the hyphen in super-minor. :-)

Thanks!

Signature · 3 lines
========================================================================
Ian Pilcher                                           [email protected]
========================================================================

A message that is not in the archive (sent off-list or not yet received): 003301c33f2e$5abfca70$6401a8c0@bmoon

#4 lore raw

Re: Really need RESYNC at creation of array???

Quoted 10 lines · On Monday June 30, [email protected] wrote:

Hi Neil & Raiders,

I am not quite sure if we really need to resync the array at the time of

RAID 1 or RAID 5 array creation. I tried and tested without RESYNC by

modifying "case1" and "case2" from MDADM source, I could not notice

Quoted 9 lines

any problems or issues.

So I want to know from you what is the reason for these codes, and

what you experieced from without RESYNC.

Others have answered with very relevant arguments for an initial sync.

For raid1 it is not absolutely essential, but for the reasons others have mentioned it can be a good idea.

For raid5 it is essential: you do not have any guarantee of data integrity after a drive fails without it.

Consider:
You start with a raid5 array where all the parity blocks are wrong. You write to a block on disk A and update the parity using a read-modify-write cycle. i.e.
pre-read A. pre-read Parity.
subtract old A from parity. Add new A into parity write new A, write new parity.
The parity block is still wrong with respect to all other data blocks in that strip.
Now drive A fails. You have lost the block that you wrote there.

I would not be against adding a flag to mdadm which caused it to create a raid1 array without any initial resync. I would be against allowing it for raid5.

NeilBrown