How to map a logical volume to physical drive(s)

Hi guys,

I need to find all physical disks related to a given logical volume.
Or in other words I need to find all logical volumes that store their data
on a given physical drive.
(The method should work in Win2000+)

I know it’s possible to open the volume and send
IOCTL_VOLUME_LOGICAL_TO_PHYSICAL.
But as I see this operation should be repeated for all the volume’s offsets
(maybe with little step).
This looks like a good overhead. ((
And I doubt if this method will work good with software RAID volumes or
mirror volumes?

The main question:
Is there any way to find all the physical drives corresponding to a logical
volume and vice versa?

Thank you in advance.

Best regards,
Valeriy Glushkov

It seems IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS does exactly what I need. ))

Best regards,
Valeriy Glushkov

----- Original Message -----
From: “Valeriy Glushkov”
To: “Windows System Software Devs Interest List”
Sent: Thursday, October 14, 2004 6:41 PM
Subject: [ntdev] How to map a logical volume to physical drive(s)

> Hi guys,
>
> I need to find all physical disks related to a given logical volume.
> Or in other words I need to find all logical volumes that store their data
> on a given physical drive.
> (The method should work in Win2000+)
>
> I know it’s possible to open the volume and send
> IOCTL_VOLUME_LOGICAL_TO_PHYSICAL.
> But as I see this operation should be repeated for all the volume’s offsets
> (maybe with little step).
> This looks like a good overhead. ((
> And I doubt if this method will work good with software RAID volumes or
> mirror volumes?
>
> The main question:
> Is there any way to find all the physical drives corresponding to a logical
> volume and vice versa?
>
> Thank you in advance.
>
> Best regards,
> Valeriy Glushkov