* MD device id change
@ 2003-04-03 16:20 Alexander Kisselev
2003-04-03 22:16 ` Neil Brown
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Kisselev @ 2003-04-03 16:20 UTC (permalink / raw)
To: raid-list
Hallo colleagues,
I have few 4-disk boxes arranged in the following way:
[root@data]: ~ > more /proc/mdstat
Personalities : [linear] [raid1]
read_ahead 1024 sectors
md1 : active linear sda2[0] 292021440 blocks 16k rounding
md2 : active linear sdb2[0] 292021440 blocks 16k rounding
md3 : active linear sdc2[0] 292021440 blocks 16k rounding
md0 : active raid1 sdd1[3] sdc1[2] sdb1[1] sda1[0] 1028032 blocks [4/4] [UUUU]
md4 : active linear sdd2[0] 292021440 blocks 16k rounding
unused devices: <none>
as you see 'md0' is a small RAID1 across 1-st partitions of all 4
disks while md1..md4 are one-disk RAID linear volumes. Well, sda..sdd
are in turn 4-disk 3Ware hardware RAID5 volumes each, but I hope this does
not matter here.
Now I want to shuffle volumes between machines and consequently
want to put let's say 'md1' from machine A and 'md1' from machine B
in one box C. This does not work (or at least it did not when I tried
it last time, perhaps with kernel 2.2.19), since RAID layer
recognizes only the first 'md1' device.
Here is the question: is there an easy way to change RAID device ID?
If not, is the following sequence correct in my case (1-disk RAID linear):
- stop device;
- 'dd' 4k RAID superblock from /dev/sda2 at offset 292021440;
- change 4-byte field at offset 11 (md_minor) to the desired number
(say '5' for md5);
- copy superblock back;
- reboot;
I remember I tried this trick once and it seemed to work, but am I
probably missing something here?
Regards,
Alexander.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: MD device id change
2003-04-03 16:20 MD device id change Alexander Kisselev
@ 2003-04-03 22:16 ` Neil Brown
2003-04-04 13:20 ` Mike Black
2003-04-07 8:41 ` Alexander Kisselev
0 siblings, 2 replies; 5+ messages in thread
From: Neil Brown @ 2003-04-03 22:16 UTC (permalink / raw)
To: Alexander Kisselev; +Cc: raid-list
On Thursday April 3, kisselev@mail.desy.de wrote:
>
> Here is the question: is there an easy way to change RAID device ID?
> If not, is the following sequence correct in my case (1-disk RAID linear):
>
> - stop device;
> - 'dd' 4k RAID superblock from /dev/sda2 at offset 292021440;
> - change 4-byte field at offset 11 (md_minor) to the desired number
> (say '5' for md5);
> - copy superblock back;
> - reboot;
Sort of, but it is much easier to get mdadm to do this.
Get mdadm 1.2.0 and check out
--assemble --update=super-minor
in the documentation.
NeilBrown
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MD device id change
2003-04-03 22:16 ` Neil Brown
@ 2003-04-04 13:20 ` Mike Black
2003-04-06 5:20 ` Neil Brown
2003-04-07 8:41 ` Alexander Kisselev
1 sibling, 1 reply; 5+ messages in thread
From: Mike Black @ 2003-04-04 13:20 UTC (permalink / raw)
To: Neil Brown; +Cc: raid-list
Here's one I've run into Neil -- Put an already-running md on another system with the same minor #.
Can you start the new md and not have to stop the old one?
i.e.
/dev/md2 on system#1
/dev/md2 on system#2
move /dev/md2 chassis to system#2
Would this work?
mdadm --assemble --uuid=MOVED_MD2 --super-minor=2 /dev/md3
And would the array now stay as md3?
----- Original Message -----
From: "Neil Brown" <neilb@cse.unsw.edu.au>
To: "Alexander Kisselev" <kisselev@mail.desy.de>
Cc: "raid-list" <linux-raid@vger.kernel.org>
Sent: Thursday, April 03, 2003 5:16 PM
Subject: Re: MD device id change
> On Thursday April 3, kisselev@mail.desy.de wrote:
> >
> > Here is the question: is there an easy way to change RAID device ID?
> > If not, is the following sequence correct in my case (1-disk RAID linear):
> >
> > - stop device;
> > - 'dd' 4k RAID superblock from /dev/sda2 at offset 292021440;
> > - change 4-byte field at offset 11 (md_minor) to the desired number
> > (say '5' for md5);
> > - copy superblock back;
> > - reboot;
>
> Sort of, but it is much easier to get mdadm to do this.
> Get mdadm 1.2.0 and check out
> --assemble --update=super-minor
>
> in the documentation.
>
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MD device id change
2003-04-04 13:20 ` Mike Black
@ 2003-04-06 5:20 ` Neil Brown
0 siblings, 0 replies; 5+ messages in thread
From: Neil Brown @ 2003-04-06 5:20 UTC (permalink / raw)
To: Mike Black; +Cc: raid-list
On Friday April 4, mblack@csi-inc.com wrote:
> Here's one I've run into Neil -- Put an already-running md on another system with the same minor #.
>
> Can you start the new md and not have to stop the old one?
>
> i.e.
> /dev/md2 on system#1
> /dev/md2 on system#2
> move /dev/md2 chassis to system#2
>
> Would this work?
> mdadm --assemble --uuid=MOVED_MD2 --super-minor=2 /dev/md3
You would need to tell mdadm that devices to look at, possibly
using --config=partitions, but that would work to assemble the array.
>
> And would the array now stay as md3?
Not in 2.4 (though in 2.5 it would).
You need --update=super-minor for that to happen. Ofcourse if you use
mdadm for assembling arrays and always use UUID, then you don't need
to convern yourself with the minor number in the superblock at all.
NeilBrown
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MD device id change
2003-04-03 22:16 ` Neil Brown
2003-04-04 13:20 ` Mike Black
@ 2003-04-07 8:41 ` Alexander Kisselev
1 sibling, 0 replies; 5+ messages in thread
From: Alexander Kisselev @ 2003-04-07 8:41 UTC (permalink / raw)
To: Neil Brown; +Cc: raid-list
Hi Neil,
> On Thursday April 3, kisselev@mail.desy.de wrote:
> >
> > Here is the question: is there an easy way to change RAID device ID?
> > If not, is the following sequence correct in my case (1-disk RAID linear):
> >
> > - stop device;
> > - 'dd' 4k RAID superblock from /dev/sda2 at offset 292021440;
> > - change 4-byte field at offset 11 (md_minor) to the desired number
> > (say '5' for md5);
> > - copy superblock back;
> > - reboot;
>
> Sort of, but it is much easier to get mdadm to do this.
> Get mdadm 1.2.0 and check out
> --assemble --update=super-minor
>
> in the documentation.
thank you, worked fine.
Cheers,
Alexander.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-04-07 8:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-03 16:20 MD device id change Alexander Kisselev
2003-04-03 22:16 ` Neil Brown
2003-04-04 13:20 ` Mike Black
2003-04-06 5:20 ` Neil Brown
2003-04-07 8:41 ` Alexander Kisselev
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).