All of lore.kernel.org
 help / color / mirror / Atom feed
* Some info given by 'mdadm --detail --export' are not convenient to use
@ 2014-04-11 11:01 Francis Moreau
  2014-04-11 23:43 ` NeilBrown
  0 siblings, 1 reply; 4+ messages in thread
From: Francis Moreau @ 2014-04-11 11:01 UTC (permalink / raw)
  To: linux-raid

Hello,

I'm writing a tool that relies udev lib in order to manage block
devices connected to my computer.

One thing that I need is to retrieve disks contained by a RAID array.

The current usefull information exported by udev are, for example:

MD_DEVICES=3
MD_DEVICE_loop0p1_DEV=/dev/loop0p1
MD_DEVICE_loop0p1_ROLE=0
MD_DEVICE_loop1p1_DEV=/dev/loop1p1
MD_DEVICE_loop1p1_ROLE=1
MD_DEVICE_loop2p1_DEV=/dev/loop2p1
MD_DEVICE_loop2p1_ROLE=2

but this is not really easy to exploit since I need to know the disk
names in order to poke the devices used by the array :-/

why not simply using ?

MD_DEVICE_DEV_1=/dev/loop0p1
MD_DEVICE_ROLE_1=0

Thanks

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

* Re: Some info given by 'mdadm --detail --export' are not convenient to use
  2014-04-11 11:01 Some info given by 'mdadm --detail --export' are not convenient to use Francis Moreau
@ 2014-04-11 23:43 ` NeilBrown
  2014-04-12  8:22   ` Francis Moreau
  0 siblings, 1 reply; 4+ messages in thread
From: NeilBrown @ 2014-04-11 23:43 UTC (permalink / raw)
  To: Francis Moreau; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]

On Fri, 11 Apr 2014 13:01:49 +0200 Francis Moreau <francis.moro@gmail.com>
wrote:

> Hello,
> 
> I'm writing a tool that relies udev lib in order to manage block
> devices connected to my computer.
> 
> One thing that I need is to retrieve disks contained by a RAID array.
> 
> The current usefull information exported by udev are, for example:
> 
> MD_DEVICES=3
> MD_DEVICE_loop0p1_DEV=/dev/loop0p1
> MD_DEVICE_loop0p1_ROLE=0
> MD_DEVICE_loop1p1_DEV=/dev/loop1p1
> MD_DEVICE_loop1p1_ROLE=1
> MD_DEVICE_loop2p1_DEV=/dev/loop2p1
> MD_DEVICE_loop2p1_ROLE=2
> 
> but this is not really easy to exploit since I need to know the disk
> names in order to poke the devices used by the array :-/
> 
> why not simply using ?
> 
> MD_DEVICE_DEV_1=/dev/loop0p1
> MD_DEVICE_ROLE_1=0
> 

What number would I use for spare devices?
Certainly something like this could be done, but it wasn't.

Maybe what you are really asking is:

"Could we please have another record which lists all the devices, e.g.
  MD_DEVICE_LIST=loop0p1 loop1p1 loop2p1
??"

Obviously you can extract that from the output above, but it might be easier
to have it explicitly.

Would that meet your need, or have I misunderstood you completely?

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: Some info given by 'mdadm --detail --export' are not convenient to use
  2014-04-11 23:43 ` NeilBrown
@ 2014-04-12  8:22   ` Francis Moreau
  2014-04-12 16:34     ` bobzer
  0 siblings, 1 reply; 4+ messages in thread
From: Francis Moreau @ 2014-04-12  8:22 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

On 04/12/2014 01:43 AM, NeilBrown wrote:
> On Fri, 11 Apr 2014 13:01:49 +0200 Francis Moreau <francis.moro@gmail.com>
> wrote:
> 
>> Hello,
>>
>> I'm writing a tool that relies udev lib in order to manage block
>> devices connected to my computer.
>>
>> One thing that I need is to retrieve disks contained by a RAID array.
>>
>> The current usefull information exported by udev are, for example:
>>
>> MD_DEVICES=3
>> MD_DEVICE_loop0p1_DEV=/dev/loop0p1
>> MD_DEVICE_loop0p1_ROLE=0
>> MD_DEVICE_loop1p1_DEV=/dev/loop1p1
>> MD_DEVICE_loop1p1_ROLE=1
>> MD_DEVICE_loop2p1_DEV=/dev/loop2p1
>> MD_DEVICE_loop2p1_ROLE=2
>>
>> but this is not really easy to exploit since I need to know the disk
>> names in order to poke the devices used by the array :-/
>>
>> why not simply using ?
>>
>> MD_DEVICE_DEV_1=/dev/loop0p1
>> MD_DEVICE_ROLE_1=0
>>
> 
> What number would I use for spare devices?
> Certainly something like this could be done, but it wasn't.
> 
> Maybe what you are really asking is:
> 
> "Could we please have another record which lists all the devices, e.g.
>   MD_DEVICE_LIST=loop0p1 loop1p1 loop2p1
> ??"
> 

Yes please, that's what I was asking for: there's currently no easy way
to retrieve the list of disks that is part of an array. Currently we have:

MD_DEVICE_loop0p1_DEV=/dev/loop0p1

The name of the property involves the value of the property.

> Obviously you can extract that from the output above, but it might be easier
> to have it explicitly.

Yes I can but it's not very convenient.

> 
> Would that meet your need, or have I misunderstood you completely?
> 

Yes, it would.

Thanks.


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

* Re: Some info given by 'mdadm --detail --export' are not convenient to use
  2014-04-12  8:22   ` Francis Moreau
@ 2014-04-12 16:34     ` bobzer
  0 siblings, 0 replies; 4+ messages in thread
From: bobzer @ 2014-04-12 16:34 UTC (permalink / raw)
  To: Francis Moreau; +Cc: NeilBrown, linux-raid

Hi
If i can give my thoughts
I like the idea of having a MD device list
But I also think the francis's idea is good and for the spare you
could enumerate with letter ?

we could get :

MD_DEVICES=4
MD_DEVICE_LIST=loop0p1 loop1p1 loop2p1 loop3p1
MD_DEVICE_DEV_1=/dev/loop0p1
MD_DEVICE_ROLE_1=0
MD_DEVICE_DEV_2=/dev/loop1p1
MD_DEVICE_ROLE_2=1
MD_DEVICE_DEV_3=/dev/loop2p1
MD_DEVICE_ROLE_3=2
MD_DEVICE_DEV_A=/dev/loop3p1
MD_DEVICE_ROLE_A=spare

like that it's really easy to parse what ever you need :-)

or maybe just continue normal increment since we have the role...

On Sat, Apr 12, 2014 at 4:22 AM, Francis Moreau <francis.moro@gmail.com> wrote:
> On 04/12/2014 01:43 AM, NeilBrown wrote:
>> On Fri, 11 Apr 2014 13:01:49 +0200 Francis Moreau <francis.moro@gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> I'm writing a tool that relies udev lib in order to manage block
>>> devices connected to my computer.
>>>
>>> One thing that I need is to retrieve disks contained by a RAID array.
>>>
>>> The current usefull information exported by udev are, for example:
>>>
>>> MD_DEVICES=3
>>> MD_DEVICE_loop0p1_DEV=/dev/loop0p1
>>> MD_DEVICE_loop0p1_ROLE=0
>>> MD_DEVICE_loop1p1_DEV=/dev/loop1p1
>>> MD_DEVICE_loop1p1_ROLE=1
>>> MD_DEVICE_loop2p1_DEV=/dev/loop2p1
>>> MD_DEVICE_loop2p1_ROLE=2
>>>
>>> but this is not really easy to exploit since I need to know the disk
>>> names in order to poke the devices used by the array :-/
>>>
>>> why not simply using ?
>>>
>>> MD_DEVICE_DEV_1=/dev/loop0p1
>>> MD_DEVICE_ROLE_1=0
>>>
>>
>> What number would I use for spare devices?
>> Certainly something like this could be done, but it wasn't.
>>
>> Maybe what you are really asking is:
>>
>> "Could we please have another record which lists all the devices, e.g.
>>   MD_DEVICE_LIST=loop0p1 loop1p1 loop2p1
>> ??"
>>
>
> Yes please, that's what I was asking for: there's currently no easy way
> to retrieve the list of disks that is part of an array. Currently we have:
>
> MD_DEVICE_loop0p1_DEV=/dev/loop0p1
>
> The name of the property involves the value of the property.
>
>> Obviously you can extract that from the output above, but it might be easier
>> to have it explicitly.
>
> Yes I can but it's not very convenient.
>
>>
>> Would that meet your need, or have I misunderstood you completely?
>>
>
> Yes, it would.
>
> 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] 4+ messages in thread

end of thread, other threads:[~2014-04-12 16:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-11 11:01 Some info given by 'mdadm --detail --export' are not convenient to use Francis Moreau
2014-04-11 23:43 ` NeilBrown
2014-04-12  8:22   ` Francis Moreau
2014-04-12 16:34     ` bobzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.