Safest way to renumber RAID-5 devices
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] ========================================================================
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
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] ========================================================================
Re: Really need RESYNC at creation of array???
In reply to a message not in the archiveQuoted 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