Volume/Partition/Disk

Hello all.

I try to figure out role of partition driver in storage stacks.

Volume is something that gets a letter and file system over it. One or more volumes may reside on the same disk and a volume may reside on different physical drives. It is possible to query volume with IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS to find which disks service it. This is about physical back end. But when the partition driver comes to play? What is its role? I found that querying volume with IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS and IOCTL_DISK_GET_PARTITION_INFO_EX give the same results: partition offset and extent offset are the same. As I understand, extents describe physical regions of different disks that belong to a volume. A volume can not be split at logical level (it gets only one letter and FS at a time). So what are PartMgr.sys’s and partition’s roles in this scheme?


Thanking In Advance,
Mikae.

>volume with IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS and

IOCTL_DISK_GET_PARTITION_INFO_EX give the same results:

Only for single-partition volumes, i.e. not DynDisks.

DynDisk volume is a set of partitions, merged in some stripe/span/mirror.

Non-DynDisk simple volume is actually a partition.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

But what is partition in this case? Extent is something about physical drive and region on it, volume is kind of logical subject that hides hardware implementation. While partition looks kinda superfluous. I understand that it is not true, but still don’t get what partition is. Also another question is how to distinguish between Dynamic disk and Basic disk? Thank you.

Hi,

IOCTL_VOLUME_IS_DYNAMIC tells you whether a volume is dynamic or not.
As Max said, if IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns multiple
xxtents again this is an indication for being dynamic.
(Also, an MBR dynamic disk has a partition type of PARTTION_LDM in the MBR.)
The IOCTL naming tells you where this information is derived from.

To further distinct dynamic or basic (GPT & MBR too) you need the _EX variants of
IOCTL_DISK_GET_DRIVE_LAYOUT / IOCTL_DISK_GET_PARTITION_INFO.
You need to find “clever” combinations of these IOCTLs to collect
information that fits your purpose.

Probably you could regard a partition as base object to build various types
of volume (like dynamic or basic).
AFAIR in XP removable devices had no volume DeviceObject at all but a single
partition only.

Regards
Else

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Mittwoch, 14. Dezember 2011 01:21
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Volume/Partition/Disk

But what is partition in this case? Extent is something about physical drive and region on it, volume is kind of logical subject that hides hardware implementation. While partition looks kinda superfluous. I understand that it is not true, but still don’t get what partition is. Also another question is how to distinguish between Dynamic disk and Basic disk? Thank you.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Utimaco Safeware AG - A member of the Sophos Group

Sitz: Oberursel - Registergericht Bad Homburg HRB 5302
WEEE-Reg.Nr.: DE39805015
Vorstandsmitglieder: Steve Munford (Vorsitzender), Malte Pollmann
Aufsichtsratsvorsitzender: Dr. Peter Lammer

Maxim, it looks like that a partition represents RAID-oriented essence, that I miss due to lack of RAID organization details.

Else, so what is the best way? I think that it is enough to check number of disks returned from IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS to consider a volume as dynamic or not.

Also I’m going to check partition/extent relations in a dynamic volume on two disks (hope it is enough to add a disk in VMWare) and in two volumes on the same disk.

I’ve heard that a single partition may have multiple volumes (that sounds very strange). Is it true? Another question is where RAID controller drivers usually reside in storage stack?

Thank you.

Partition is the entity in the MBR or GPT table.

A physical disk can have several.

Partition belongs to the volume, always to 1 volume. Partition cannot span across disks.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

> I’ve heard that a single partition may have multiple volumes (that sounds very strange). Is it true?

No.

RAID controller drivers like Promise are lowest-level storage miniports. So the rest of the OS (except the mgmt tool of the RAID controller) knows nothing on phys disks, only on LUNs.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Maxim, thank you for reply. One more question: in which case a dynamic volume may have several partitions? Will it have one driver letter in this case? Thank you.

Volumes have drive letters and not partitions.

So a dynamic volume that spans multiple partitions is just one volume
and hence in simple terms will only have one drive letter. More
precisely it can only have one mount point. Mount points can be mounted
as links inside other mount points, so there may be no drive letter. On
the other hand, there can be multiple drive letters to a mount point,
e.g. the subst command can create a new drive letter reference to the
same mount point.

Mark

On 15/12/2011 10:35, xxxxx@yahoo.com wrote:

Maxim, thank you for reply. One more question: in which case a dynamic volume may have several partitions? Will it have one driver letter in this case? Thank you.

>partitions? Will it have one driver letter in this case?

Yes. All naming is per-volume, not per-partition.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Mark, thank you for the explanation. But anyway I would like to get an example when a volume has multiple partitions. It will help me to understand why partitions are needed at all.

Simple case:

A volume spans two or more disks by using 1 partition off each disk to
create a logical volume that concatenates the two partitions to create
one large volume. Say each partition is 100GB in size, the size of the
volume will be 200GB and the file system formatted on it will assume
200GB of contiguous blocks. When the file system access a logical block
within the volume, the LVM has to work out which disk and which
partition the I/O has to be sent and uses the partition information to
calculate the actual addresses in the I/O request to the physical media.

Read up on RAID for more complex cases. This is ok for quick diagrams -
http://www.thegeekstuff.com/2010/08/raid-levels-tutorial/. With dynamic
disks Windows can support software RAID levels 0, 1, 5 and 10. That can
be a lot of disks/partitions hidden under a single volume mount point.

Mark.

On 15/12/2011 13:36, xxxxx@yahoo.com wrote:

Mark, thank you for the explanation. But anyway I would like to get an example when a volume has multiple partitions. It will help me to understand why partitions are needed at all.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

>multiple partitions. It will help me to understand why partitions are needed at all.

Because you have MBR or GPT table, and it has entries.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

> disks Windows can support software RAID levels 0, 1, 5 and 10

RAID 10 with DynDisk? starting from what version?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

On 16/12/2011 08:00, Maxim S. Shatskih wrote:

> disks Windows can support software RAID levels 0, 1, 5 and 10
>
RAID 10 with DynDisk? starting from what version?

Perhaps not RAID 10, too long since I played in that space and had the
disks available to check. I had a lingering memory of reading it as
added, but was probably just dreaming.

However, software RAID 0, 1 & 5 are still examples for the OP of dynamic
disks with multiple partitions under the single volume.

> However, software RAID 0, 1 & 5 are still examples for the OP of dynamic

disks with multiple partitions under the single volume.

Well, in Windows storage stack architecture, “partition” is more like the SW representation of the on disk MBR or GPT entry.

Usually it is a device object, but a very special one not seen by any other entity then volume managers - DynDisk or volmgr/FtDisk.

volmgr/FtDisk create 1-to-1 volume DOs to the partition DOs and pass all requests down to the partition DOs.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Well, I just tried to figure out WHY OS needs partitions. Driver letters are assigned to volumes, volumes have extents, so partitions are kinda useless. Now I think that partitions in dynamic disks are used to separate RAID’s internal structures like parity data and user data. Not sure about it, have to convert my VMWare disks to dynamic disk and setup RAID. Will do it later. If a disk is not dynamic, then partitions in MBR/GPT describe different volumes.

Suppose the user wants C,D,E&F drives to all use one physical disk. This is
what using partitions allows and this goes back to the beginning of DOS

wrote in message news:xxxxx@ntdev…

Well, I just tried to figure out WHY OS needs partitions. Driver letters are
assigned to volumes, volumes have extents, so partitions are kinda useless.
Now I think that partitions in dynamic disks are used to separate RAID’s
internal structures like parity data and user data. Not sure about it, have
to convert my VMWare disks to dynamic disk and setup RAID. Will do it later.
If a disk is not dynamic, then partitions in MBR/GPT describe different
volumes.