Re: Bug? Determining the holders of partitions shadowed by dm-multipath.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 11, 2009 at 08:32:20AM +0100, Hannes Reinecke wrote:
> Hi Joel,
>
> Joel Becker wrote:
>> On Tue, Feb 10, 2009 at 09:49:58AM -0500, Romanowski, John (OFT) wrote:
>>> my sles10sp2 at 2.6.16.60-0.29-default doesn't have the /sys/block/.../holders but
>>> I've used major:minor device numbers from commands
>>> dmsetup ls
>>> and
>>> dmsetup deps
>>> to resolve such device relationships.
>>>
>>> A 'dmsetup ls' device number that isn't listed in 'dmsetup deps' device numbers is a top-level device. Example below: mproot-part1 (dev 253:3, a partition of mp device 253:2) isn't listed as a dependency of any device. Likewise each listed LVM volume isn't listed as a dependency of any device; example- rootvg-tmp 253:10
>>
>> 	Sure, but a /dev/sda2 won't show up in dmsetup output anywhere.
>> That's kind of my point.
>>
> Well, yes.
> That's because you have _two_ parent-child relationship in sysfs.
>
> The one (as you already noted) is the holders / slaves directories in sysfs.
> However, partitions are handled differently; they are listed under
>
> /sys/block/sda/sda2
>
> (note the subdir) and do not appear under holders / slaves. So the correct algorithm
> is to
> a) check the holders / slaves
> and
> b) check if the parent directory starts with the same name and if so, check for
> the holders / slaves relationship there.

	Why not just setup holders in sda2?  It's held, after all.
It's just very counterintuitive to look at an empty holders and discover
that it's empty yet held.
	Btw, do we absolutely guarantee that all block devices, forever,
will have partitions in sysfs named
"/sys/block/<parent>/<parent><more>"?

Joel

-- 

Life's Little Instruction Book #139

	"Never deprive someone of hope; it might be all they have."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@xxxxxxxxxx
Phone: (650) 506-8127

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux