deleting mdadm array?
Hello,
I just created a new array /dev/md1 like this:
mdadm --create --verbose /dev/md1 --chunk=64 --level=raid5 \
--metadata=1.1 --bitmap=internal \
--raid-devices=3 /dev/hdc2 /dev/sda2 missing
But later I changed my mind, and I wanted to use chunk 128. Do I need to delete this array somehow first, or can I just create an array again (overwriting the current one)?
Signature · 1 line
Janek Kozicki |
Quoted 4 lines · On Thursday October 25, [email protected] wrote:
Hello,
I just created a new array
/dev/md1like this:
Quoted 8 lines
mdadm --create --verbose
/dev/md1--chunk=64 --level=raid5 \
--metadata=1.1 --bitmap=internal \
--raid-devices=3/dev/hdc2/dev/sda2missingBut later I changed my mind, and I wanted to use chunk 128. Do I need to delete this array somehow first, or can I just create an array again (overwriting the current one)?
Just recreate with new values, overwriting the current one.
NeilBrown
Quoted 4 lines · Janek Kozicki
Hello,
I just created a new array
/dev/md1like this:
Quoted 8 lines
mdadm --create --verbose
/dev/md1--chunk=64 --level=raid5 \
--metadata=1.1 --bitmap=internal \
--raid-devices=3/dev/hdc2/dev/sda2missingBut later I changed my mind, and I wanted to use chunk 128. Do I need to delete this array somehow first, or can I just create an array again (overwriting the current one)?
How much later? This will, of course, destroy any data on the array (!) and you'll need to mkfs again...
To answer the question though: just run mdadm again to create a new array with new parameters.
I think the only time you need to 'delete' an array before creating a new one is if you change the superblock version since it quietly writes different superblocks to different disk locations you may end up with 2 superblocks on the disk and then you get confusion :)
(I'm not sure if mdadm is clever about this though...)
Also, if you don't mind me asking: why did you choose version 1.1 for the metadata/superblock version?
David
Quoted 6 lines · On Thursday October 25, [email protected] wrote:
I think the only time you need to 'delete' an array before creating a new one is if you change the superblock version since it quietly writes different superblocks to different disk locations you may end up with 2 superblocks on the disk and then you get confusion :)
(I'm not sure if mdadm is clever about this though...)
Mdadm tries to be clever.
When creating an array, it zeros any superblocks that it finds on the array in any of the expected locations.
And when guessing the metadata format used, if it find two or more, it chooses the one with the more recent create timestamp.
NeilBrown
David Greaves said: (by the date of Thu, 25 Oct 2007 10:55:44 +0100)
Quoted 2 lines
How much later? This will, of course, destroy any data on the array (!) and you'll need to mkfs again...
Just after, I didn't even create LVM volume on it (not mentioning formatting it).
Quoted 2 lines
Also, if you don't mind me asking: why did you choose version 1.1 for the metadata/superblock version?
In "time to deprecate old RAID formats" Doug Ledford said, that 1.1 is safest when used with LVM. I wish that this info would get into the man page. I just hope that grub will be able to boot from LVM from '/' partition raid1 (version 1.1), I didn't check this yet.
Doug Ledford said: (by the date of Fri, 19 Oct 2007 12:15:34 -0400)
Quoted 16 lines
1.0, 1.1, and 1.2 are the same format, just in different positions on the disk. Of the three, the 1.1 format is the safest to use since it won't allow you to accidentally have some sort of metadata between the beginning of the disk and the raid superblock (such as an lvm2 superblock), and hence whenever the raid array isn't up, you won't be able to accidentally mount the lvm2 volumes, filesystem, etc. (In worse case situations, I've seen lvm2 find a superblock on one RAID1 array member when the RAID1 array was down, the system came up, you used the system, the two copies of the raid array were made drastically inconsistent, then at the next reboot, the situation that prevented the RAID1 from starting was resolved, and it never know it failed to start last time, and the two inconsistent members we put back into a clean array). So, deprecating any of these is not really helpful. And you need to keep the old 0.90 format around for back compatibility with thousands of existing raid arrays.
Signature · 1 line
Janek Kozicki |