can metadata type be changed for an active array?

can metadata type be changed for an active array?

am 26.02.2009 20:12:37 von PGNet

i've created an array,

mdadm --create /dev/md5 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1

checking,

cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [linear]
md5 : active raid1 sda2[0] sdb2[1]
341991616 blocks [2/2] [UU]
bitmap: 0/164 pages [0KB], 1024KB chunk

i realized that it defaulted to metadata type = 0.90.

is it possible to _modify_ this array to use "super 1.x" metadata
type, rather than the default 0.90?

neither 'manage' or 'grow' modes seem to allow it,

mdadm --manage --metadata=1.2 /dev/md5
mdadm:option --metadata not valid in manage mode
mdadm --grow --metadata=1.2 /dev/md5
mdadm:option --metadata not valid in grow mode

thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: can metadata type be changed for an active array?

am 27.02.2009 05:57:49 von NeilBrown

On Fri, February 27, 2009 6:12 am, PGNet wrote:
> i've created an array,
>
> mdadm --create /dev/md5 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
>
> checking,
>
> cat /proc/mdstat
> Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [linear]
> md5 : active raid1 sda2[0] sdb2[1]
> 341991616 blocks [2/2] [UU]
> bitmap: 0/164 pages [0KB], 1024KB chunk
>
> i realized that it defaulted to metadata type = 0.90.
>
> is it possible to _modify_ this array to use "super 1.x" metadata
> type, rather than the default 0.90?
>
> neither 'manage' or 'grow' modes seem to allow it,
>
> mdadm --manage --metadata=1.2 /dev/md5
> mdadm:option --metadata not valid in manage mode
> mdadm --grow --metadata=1.2 /dev/md5
> mdadm:option --metadata not valid in grow mode

Yes and no....

There is no way to have mdadm convert the metadata (yet, maybe one day.
I accept patches).

However the 1.0 metadata uses less space than the 0.90 metadata so
it is fairly safe to simply stop the array and then create it with 1.0
metadata. All your data will still be there.

The bitmap could get written at a different place, and could over-write
data. So to be safe:

mdadm -S /dev/md5
mdadm -C /dev/md5 -l1 -n2 -e 1.0 -z 341991616 /dev/sda2 /dev/sdb2
--assume-clean

# make sure your data looks right

mdadm --grow /dev/md5 --bitmap=internal

Should be sufficient.

BTW, I doubt that I'll ever support online metadata conversion.
So the eventual command would be

mdadm --assemble /dev/md5 --metadata=1.0 --update=metadata /dev/sd[ab]2

or something like that.

NeilBrown


--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: can metadata type be changed for an active array?

am 27.02.2009 06:10:07 von PGNet

hi,

On Thu, Feb 26, 2009 at 8:57 PM, NeilBrown wrote:
> However the 1.0 metadata uses less space than the 0.90 metadata so
> it is fairly safe to simply stop the array and then create it with 1.=
0
> metadata. =A0All your data will still be there.

curious, is that also true for 1.0 -> 1.2 ?

> The bitmap could get written at a different place, and could over-wri=
te
> data. =A0So to be safe:

got it.

> mdadm --assemble /dev/md5 --metadata=3D1.0 --update=3Dmetadata /dev=
/sd[ab]2

fair enough.

thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" i=
n
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: can metadata type be changed for an active array?

am 27.02.2009 06:24:25 von NeilBrown

On Fri, February 27, 2009 4:10 pm, PGNet wrote:
> hi,
>
> On Thu, Feb 26, 2009 at 8:57 PM, NeilBrown wrote:
>> However the 1.0 metadata uses less space than the 0.90 metadata so
>> it is fairly safe to simply stop the array and then create it with 1=
0
>> metadata. =A0All your data will still be there.
>
> curious, is that also true for 1.0 -> 1.2 ?

No.
The difference between 1.0, 1.1, and 1.2 is where the metadata lives.
1.0 uses a similar location to 0.90.
1.1 and 1.2 use locations near the start of the device.


>
>> The bitmap could get written at a different place, and could over-wr=
ite
>> data. =A0So to be safe:
>
> got it.
>
>> mdadm --assemble /dev/md5 --metadata=3D1.0 --update=3Dmetadata
>> /dev/sd[ab]2
>
> fair enough.
>
> thanks!
>

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" i=
n
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: can metadata type be changed for an active array?

am 27.02.2009 06:44:59 von PGNet

On Thu, Feb 26, 2009 at 9:24 PM, NeilBrown wrote:
> The difference between 1.0, 1.1, and 1.2 is where the metadata lives.
> 1.0 uses a similar location to 0.90.
> 1.1 and 1.2 use locations near the start of the device.

got it.

clearly best i read up more, and -- for now -- get it right the 1st
time @ create.

thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: can metadata type be changed for an active array?

am 27.02.2009 20:30:31 von Piergiorgio Sartor

Hi,

> clearly best i read up more, and -- for now -- get it right the 1st
> time @ create.

well, for RAID-1 types, there is a (dirty) trick
to change this kind of information.

Mount the partition read-only, if it is not
possible (system), you'll have to use a live CD.
Fail and remove one of the components of the RAID-1.
Zero the superblock of the removed component and
re-create a RAID-1, using a "missing" device,
setting the proper features, with this component.
Create a filesystem on the new RAID-1 volume.
Mount it read-write and copy the files from the old
to the new.
Stop the old RAID-1 volume, zero the superblock, add
the, now clean, component to the newly created array.

Now, this could be risky, of course, since during
the process there is no mirror.
Also, if you make a mistake and do not realize in
time, there is the possibility to end up with no
data in both RAIDs.

This means that, clearly, if you try this trick,
you'll do at your own risk...

bye,

--

piergiorgio
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: can metadata type be changed for an active array?

am 27.02.2009 20:43:37 von PGNet

On Fri, Feb 27, 2009 at 11:30 AM, Piergiorgio Sartor
wrote:
> well, for RAID-1 types, there is a (dirty) trick
> to change this kind of information.

good to know/learn the options. thanks.

> This means that, clearly, if you try this trick,
> you'll do at your own risk...

heh. all the more reason for me to 'get it right the 1st time'! :-)

thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html