linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* can metadata type be changed for an active array?
@ 2009-02-26 19:12 PGNet
  2009-02-27  4:57 ` NeilBrown
  0 siblings, 1 reply; 7+ messages in thread
From: PGNet @ 2009-02-26 19:12 UTC (permalink / raw)
  To: linux-raid

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: can metadata type be changed for an active array?
  2009-02-26 19:12 can metadata type be changed for an active array? PGNet
@ 2009-02-27  4:57 ` NeilBrown
  2009-02-27  5:10   ` PGNet
  0 siblings, 1 reply; 7+ messages in thread
From: NeilBrown @ 2009-02-27  4:57 UTC (permalink / raw)
  To: PGNet; +Cc: linux-raid

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: can metadata type be changed for an active array?
  2009-02-27  4:57 ` NeilBrown
@ 2009-02-27  5:10   ` PGNet
  2009-02-27  5:24     ` NeilBrown
  0 siblings, 1 reply; 7+ messages in thread
From: PGNet @ 2009-02-27  5:10 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

hi,

On Thu, Feb 26, 2009 at 8:57 PM, NeilBrown <neilb@suse.de> 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.  All 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-write
> data.  So to be safe:

got it.

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

fair enough.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: can metadata type be changed for an active array?
  2009-02-27  5:10   ` PGNet
@ 2009-02-27  5:24     ` NeilBrown
  2009-02-27  5:44       ` PGNet
  0 siblings, 1 reply; 7+ messages in thread
From: NeilBrown @ 2009-02-27  5:24 UTC (permalink / raw)
  To: PGNet; +Cc: linux-raid

On Fri, February 27, 2009 4:10 pm, PGNet wrote:
> hi,
>
> On Thu, Feb 26, 2009 at 8:57 PM, NeilBrown <neilb@suse.de> 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.  All 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-write
>> data.  So to be safe:
>
> got it.
>
>>  mdadm --assemble /dev/md5 --metadata=1.0 --update=metadata
>> /dev/sd[ab]2
>
> fair enough.
>
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: can metadata type be changed for an active array?
  2009-02-27  5:24     ` NeilBrown
@ 2009-02-27  5:44       ` PGNet
  2009-02-27 19:30         ` Piergiorgio Sartor
  0 siblings, 1 reply; 7+ messages in thread
From: PGNet @ 2009-02-27  5:44 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

On Thu, Feb 26, 2009 at 9:24 PM, NeilBrown <neilb@suse.de> 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: can metadata type be changed for an active array?
  2009-02-27  5:44       ` PGNet
@ 2009-02-27 19:30         ` Piergiorgio Sartor
  2009-02-27 19:43           ` PGNet
  0 siblings, 1 reply; 7+ messages in thread
From: Piergiorgio Sartor @ 2009-02-27 19:30 UTC (permalink / raw)
  To: PGNet; +Cc: linux-raid

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: can metadata type be changed for an active array?
  2009-02-27 19:30         ` Piergiorgio Sartor
@ 2009-02-27 19:43           ` PGNet
  0 siblings, 0 replies; 7+ messages in thread
From: PGNet @ 2009-02-27 19:43 UTC (permalink / raw)
  To: Piergiorgio Sartor; +Cc: linux-raid

On Fri, Feb 27, 2009 at 11:30 AM, Piergiorgio Sartor
<piergiorgio.sartor@nexgo.de> 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-02-27 19:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-26 19:12 can metadata type be changed for an active array? PGNet
2009-02-27  4:57 ` NeilBrown
2009-02-27  5:10   ` PGNet
2009-02-27  5:24     ` NeilBrown
2009-02-27  5:44       ` PGNet
2009-02-27 19:30         ` Piergiorgio Sartor
2009-02-27 19:43           ` PGNet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).