* Auto-assembling arrays using mdadm
@ 2006-03-09 8:54 Sean Puttergill
2006-03-09 17:41 ` dean gaudet
0 siblings, 1 reply; 7+ messages in thread
From: Sean Puttergill @ 2006-03-09 8:54 UTC (permalink / raw)
To: linux-raid
Hi.
I am looking to script auto-assembly of all arrays
detected on an arbitrary set of drives using mdadm.
The way I am thinking of doing this is as follows:
mdadm.conf =
DEVICE /dev/sd*
----
1. Use "mdadm -E" on each drive in turn to get the
UUID for the array to which it belongs and assemble a
list of unique UUIDs.
2. Run "mdadm -A --uuid=<UUID> --auto=md --scan" for
each unique UUID.
My question is, is it currently possible for me to get
mdadm to do this automatically? Ideally I would
invoke mdadm once to discover all RAID arrays that
exist on the devices listed in the mdadm.conf file and
assemble them, automatically creating the require md
devices.
I know that I could use kernel RAID autodetect, but I
hear that this is to be deprecated soon. Also, the
RAID arrays I am using live on bare drives, not
partitions (i.e. no partition to set to type 0xFD).
Thanks,
Sean
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Auto-assembling arrays using mdadm
2006-03-09 8:54 Auto-assembling arrays using mdadm Sean Puttergill
@ 2006-03-09 17:41 ` dean gaudet
2006-03-09 19:23 ` Sean Puttergill
0 siblings, 1 reply; 7+ messages in thread
From: dean gaudet @ 2006-03-09 17:41 UTC (permalink / raw)
To: Sean Puttergill; +Cc: linux-raid
On Thu, 9 Mar 2006, Sean Puttergill wrote:
> Hi.
>
> I am looking to script auto-assembly of all arrays
> detected on an arbitrary set of drives using mdadm.
>
> The way I am thinking of doing this is as follows:
>
> mdadm.conf =
>
> DEVICE /dev/sd*
i prefer to use "DEVICE partitions"
> 1. Use "mdadm -E" on each drive in turn to get the
> UUID for the array to which it belongs and assemble a
> list of unique UUIDs.
>
> 2. Run "mdadm -A --uuid=<UUID> --auto=md --scan" for
> each unique UUID.
>
>
> My question is, is it currently possible for me to get
> mdadm to do this automatically?
the man page has an example... it's just:
mdadm --assemble --scan
-dean
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Auto-assembling arrays using mdadm
2006-03-09 17:41 ` dean gaudet
@ 2006-03-09 19:23 ` Sean Puttergill
2006-03-09 21:51 ` dean gaudet
0 siblings, 1 reply; 7+ messages in thread
From: Sean Puttergill @ 2006-03-09 19:23 UTC (permalink / raw)
To: dean gaudet; +Cc: linux-raid
As far as I know, "mdadm --assemble --scan" requires
that there be ARRAY lines in the mdadm.conf file.
These lines must list the device node and the UUID of
the array at a minimum.
What I want to achieve is to automatically inspect a
set of disks and start all the RAID arrays found
without the need for any a priori information in the
mdadm.conf file. I.e. with mdadm.conf as follows:
"
DEVICE /dev/sd*
"
This is the kind of functionality provided by kernel
RAID autodetect. You don't have to have any config
information provided in advance. The kernel finds and
assembles all arrays on disks with RAID autodetect
partition type. I want to do the same thing, but with
mdadm.
Perhaps I am confused. Has this changed in 2.x? I am
using version 1.11.0
Sean
--- dean gaudet <dean@arctic.org> wrote:
> On Thu, 9 Mar 2006, Sean Puttergill wrote:
>
> > Hi.
> >
> > I am looking to script auto-assembly of all arrays
> > detected on an arbitrary set of drives using
> mdadm.
> >
> > The way I am thinking of doing this is as follows:
> >
> > mdadm.conf =
> >
> > DEVICE /dev/sd*
>
> i prefer to use "DEVICE partitions"
>
> > 1. Use "mdadm -E" on each drive in turn to get the
> > UUID for the array to which it belongs and
> assemble a
> > list of unique UUIDs.
> >
> > 2. Run "mdadm -A --uuid=<UUID> --auto=md --scan"
> for
> > each unique UUID.
> >
> >
> > My question is, is it currently possible for me to
> get
> > mdadm to do this automatically?
>
> the man page has an example... it's just:
>
> mdadm --assemble --scan
>
> -dean
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Auto-assembling arrays using mdadm
2006-03-09 19:23 ` Sean Puttergill
@ 2006-03-09 21:51 ` dean gaudet
2006-03-10 4:58 ` Sean Puttergill
0 siblings, 1 reply; 7+ messages in thread
From: dean gaudet @ 2006-03-09 21:51 UTC (permalink / raw)
To: Sean Puttergill; +Cc: linux-raid
On Thu, 9 Mar 2006, Sean Puttergill wrote:
> This is the kind of functionality provided by kernel
> RAID autodetect. You don't have to have any config
> information provided in advance. The kernel finds and
> assembles all arrays on disks with RAID autodetect
> partition type. I want to do the same thing, but with
> mdadm.
you know i've been bitten by that several times... the kernel sees the
autodetect partition type of a disk which used to belong in another box
(which for various reasons i've not yet been able to zero the old raid
superblock)... and brings up a raid minor which conflicts with another
array already present in the system... which causes device renaming to
occur and can mess up the boot. (although if i'm using UUIDs or labels
for mounting the filesystems it can almost work -- there are still a few
cases where those don't help... such as xfs external log partition.)
i suppose what i suggested doesn't do what you want... but i prefer not
using kernel autoassembly these days because of the above problem.
the 1.12 man page has more examples which can help you...
echo "DEVICE partitions" >tmp.mdadm.conf
mdadm --detail --scan --config=tmp.mdadm.conf >>tmp.mdadm.conf
mdadm --assemble --scan --config=tmp.mdadm.conf
i think that'll do what you want...
-dean
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Auto-assembling arrays using mdadm
2006-03-09 21:51 ` dean gaudet
@ 2006-03-10 4:58 ` Sean Puttergill
2006-03-10 5:28 ` Neil Brown
0 siblings, 1 reply; 7+ messages in thread
From: Sean Puttergill @ 2006-03-10 4:58 UTC (permalink / raw)
To: dean gaudet; +Cc: linux-raid
That did the trick, except you must do:
mdadm --examine --scan --config=tmp.mdadm.conf
>>tmp.mdadm.conf
instead of:
mdadm --detail --scan --config=tmp.mdadm.conf
>>tmp.mdadm.conf
I assume that this method would have the same problems
with conflicting minor number. Will have to add an
intermediate step to process the tmp.mdadm.conf file
to uniquify the RAID array device names (i.e. remove
duplicate /dev/md0, etc.).
Thanks for the tip. I personally think mdadm should
be modified to do this all in one step (including
dealing with minor number conflicts).
Sean
--- dean gaudet <dean@arctic.org> wrote:
> you know i've been bitten by that several times...
> the kernel sees the
> autodetect partition type of a disk which used to
> belong in another box
> (which for various reasons i've not yet been able to
> zero the old raid
> superblock)... and brings up a raid minor which
> conflicts with another
> array already present in the system... which causes
> device renaming to
> occur and can mess up the boot. (although if i'm
> using UUIDs or labels
> for mounting the filesystems it can almost work --
> there are still a few
> cases where those don't help... such as xfs external
> log partition.)
>
> i suppose what i suggested doesn't do what you
> want... but i prefer not
> using kernel autoassembly these days because of the
> above problem.
>
> the 1.12 man page has more examples which can help
> you...
>
> echo "DEVICE partitions" >tmp.mdadm.conf
> mdadm --detail --scan --config=tmp.mdadm.conf
> >>tmp.mdadm.conf
> mdadm --assemble --scan --config=tmp.mdadm.conf
>
> i think that'll do what you want...
>
> -dean
> -
> 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
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Auto-assembling arrays using mdadm
2006-03-10 4:58 ` Sean Puttergill
@ 2006-03-10 5:28 ` Neil Brown
2006-03-10 9:34 ` Sean Puttergill
0 siblings, 1 reply; 7+ messages in thread
From: Neil Brown @ 2006-03-10 5:28 UTC (permalink / raw)
To: Sean Puttergill; +Cc: dean gaudet, linux-raid
On Thursday March 9, puttergi@yahoo.ca wrote:
It is not clear to me that this is something that you would ever want
to do, just as you would not want an automatic process to mount every
filesystem that it finds on any disk drive. (I agree with dean here).
Maybe if you explained why you wanted to do this, a more focussed
response could be provided.
> That did the trick, except you must do:
>
> mdadm --examine --scan --config=tmp.mdadm.conf
> >>tmp.mdadm.conf
>
> instead of:
>
> mdadm --detail --scan --config=tmp.mdadm.conf
> >>tmp.mdadm.conf
>
> I assume that this method would have the same problems
> with conflicting minor number. Will have to add an
> intermediate step to process the tmp.mdadm.conf file
> to uniquify the RAID array device names (i.e. remove
> duplicate /dev/md0, etc.).
>
>
> Thanks for the tip. I personally think mdadm should
> be modified to do this all in one step (including
> dealing with minor number conflicts).
This is unlikely to happen.
It is, however, possible that "mdadm --examine --scan" could grow an option
whereby the device names are given as
/dev/md/UUID:OF:THE:ARRAY:THAT:WAS:FOUND
This, toogether with giving 'auto=mdp' could avoid and issues with
minor number conflicts. Then:
echo DEV partitions > /etc/mdadm.conf
mdadm -Es --new-flag >> /etc/mdadm.conf
mdadm -As --auto-mdp
would assemble all arrays, which is what you claim to want.
NeilBrown
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Auto-assembling arrays using mdadm
2006-03-10 5:28 ` Neil Brown
@ 2006-03-10 9:34 ` Sean Puttergill
0 siblings, 0 replies; 7+ messages in thread
From: Sean Puttergill @ 2006-03-10 9:34 UTC (permalink / raw)
To: Neil Brown; +Cc: dean gaudet, linux-raid
I definitely wish to do this, that's why I'm asking.
I assume your statement refers to the general
usefulness of what I am asking for.
As to why I wish to implement this functionality, well
you can tell that I am not targetting this at your
average user's PC. Not to be too secretive, but think
along the lines of something more appliance like.
Amongst the requirements that I have for the system
that I am constructing, I must deal with installing
RAID sets that come from other boxes. I need to be
able to automatically start up existing RAID arrays on
drive sets that have migrated over without needing to
have any a priori knowledge of the RAID arrays that
might exist on the drives.
In any case, your suggestion of a new flag to output
unique device names from mdadm --examine (using UUID
of array) sounds like an acceptable solution. Please
consider adding it.
I assume that using "--auto=md" when assembling will
currently not take care of minor number conflicts in
the config file?
Thanks,
Sean
--- Neil Brown <neilb@suse.de> wrote:
> On Thursday March 9, puttergi@yahoo.ca wrote:
>
> It is not clear to me that this is something that
> you would ever want
> to do, just as you would not want an automatic
> process to mount every
> filesystem that it finds on any disk drive. (I agree
> with dean here).
>
> Maybe if you explained why you wanted to do this, a
> more focussed
> response could be provided.
>
>
> > That did the trick, except you must do:
> >
> > mdadm --examine --scan --config=tmp.mdadm.conf
> > >>tmp.mdadm.conf
> >
> > instead of:
> >
> > mdadm --detail --scan --config=tmp.mdadm.conf
> > >>tmp.mdadm.conf
> >
> > I assume that this method would have the same
> problems
> > with conflicting minor number. Will have to add
> an
> > intermediate step to process the tmp.mdadm.conf
> file
> > to uniquify the RAID array device names (i.e.
> remove
> > duplicate /dev/md0, etc.).
> >
> >
> > Thanks for the tip. I personally think mdadm
> should
> > be modified to do this all in one step (including
> > dealing with minor number conflicts).
>
> This is unlikely to happen.
>
> It is, however, possible that "mdadm --examine
> --scan" could grow an option
> whereby the device names are given as
> /dev/md/UUID:OF:THE:ARRAY:THAT:WAS:FOUND
>
> This, toogether with giving 'auto=mdp' could avoid
> and issues with
> minor number conflicts. Then:
> echo DEV partitions > /etc/mdadm.conf
> mdadm -Es --new-flag >> /etc/mdadm.conf
> mdadm -As --auto-mdp
> would assemble all arrays, which is what you claim
> to want.
>
> NeilBrown
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-03-10 9:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-09 8:54 Auto-assembling arrays using mdadm Sean Puttergill
2006-03-09 17:41 ` dean gaudet
2006-03-09 19:23 ` Sean Puttergill
2006-03-09 21:51 ` dean gaudet
2006-03-10 4:58 ` Sean Puttergill
2006-03-10 5:28 ` Neil Brown
2006-03-10 9:34 ` Sean Puttergill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox