Re: *RE: How to get Volume/Partition type( Simple, Striped, Spanned...)?

I also use IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,
and I also use it for basic volumes in W2K/XP to have identical handlin=
g
for both kinds of volumes.
At least, if a basic volume has only one extent, it’s a “normal” basic
volume.
I do not agree with 3.:
my extents for a certain volume are all of the same size to simplify
creation
of extents for testing.
To see if it is spanned, compare the
PVOLUME_DISK_EXTENTS->DISK_EXTENT[index].DiskNumber(s).

Regards
Else

=
=20
“Benoit FAURE” =
=20
evelopers" =20
.com> cc: <kristian.traik>xxxxx@atia.com> =20
Sent by: Subject: *[ntfsd] R=
E: How to get Volume/Partition type( Simple, =20
xxxxx@lis Striped, Spanned…)? =
=20
ts.osr.com =
=20
=
=20
=
=20
26.11.2002 11:13 =
=20
Please respond to =
=20
“File Systems =
=20
Developers” =
=20
=
=20
=
=20

Under W2K, there are no IOCTL.
I think I have a solution for dynamic disks.

The following algorithm works for many cases, buy it cannot distinguish=

between a “Striped”
volume and a “Spanned” volume when every extent is the same size.
1. Call IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS for the volume.
2. If there is only one extent then the volume is “Simple”.
3. Otherwise, if the extents are not all the same size, then the
volume is “Spanned”.
4. Otherwise, if there are two extents, but the volume size is equal
to one extent, then the volume is “Mirrored”.
5. Otherwise, if there are N extents, and the volume size is the sum
of N-1 extents, then the volume is “RAID-5”.
6. Otherwise, the volume is “Spanned” or “Striped”.

An (undocumented) idea to solve #6 would be to call
IOCTL_MOUNTDEV_QUERY_DEVICE_NAME (mountmgr.h)
on the volume handle. For stripes the name looks like
\Device\HarddiskDmVolumes<diskgroupname>\StripeN.

And, after discussions with MICROSOFT, they answered me :
"we do not recommend or support any attempt to bypass our volume
manager. "
"We strongly urge customers not to try such tricks. "
"So do not really have a permenant solution now. "

Let me know if you have a better solution or a solution for basic disks=
.

Benoit

-----Original Message-----
From: Kristian Traikov [mailto:xxxxx@atia.com]
Sent: Thursday, November 07, 2002 3:57 PM
To: File Systems Developers
Subject: [ntfsd] How to get Volume/Partition type( Simple, Striped,
Spanned…)?

Hi all,

I just need to create two “simple” UserMode functions like these:

///////////////////////////////////////////////////////////////////////=
/
/
// For DYNAMIC volumes
//
BOOL GetDynamicVolumeType( LPCTSTR lpRootPathName, LPDWORD
lpVolumeType);

Where volume types are:
typedef enum {
Mirror,
Stripe,
RAID5,
Spanned,
Simple,

} VOLUME_TYPE;

///////////////////////////////////////////////////////////////////////=
/
/
// For BASIC partitions
//
BOOL GetBasicPartitionType( LPCTSTR lpRootPathName, LPDWORD
lpPartitionType);

Where partition types are:
typedef enum {
Mirror,
Stripe,
ParityStripe,
VolumeSet,
NonFT,
WholeDisk
} PARTITION_TYPE;

BASIC partitions

I found that W2K recognizes multipartition volumes created under
NT(stripe, volume set…) IF there is at least one “RESTORE disk
configuration” on these disks (it could be from different W2K
workstation).

For example:
1. You create stripe set under NT workstation (A) and save disk
configuration diskette.
2. Move disks on W2K workstation (B) and restore disk configuration fro=
m
the diskette. Disk Manager creates registry disk key on local W2K
computer
and writes some sectors on NTFT disks.
3. Now, move disk on different W2K workstation (C) and you can use the
stripe set whithout restoring disk configuration.

I have to get this type of information for both dynamic and basic
volumes
without digging into Veritas LDM database records NOR DiskKey registry
key.

Are there some undocumented functions or IOCTLS??

Kristian

__________________________________________________
Modem offert : 150,92 euros rembours=E9s sur le Pack eXtense de Wanadoo=
!
Haut d=E9bit =E0 partir de 30 euros/mois : http://www.ifrance.com/_relo=
c/w


You are currently subscribed to ntfsd as: xxxxx@utimaco.de
To unsubscribe send a blank email to %%email.unsub%%

=</kristian.traik>

The 3. is always true. Besides, you have to do the 6. for spanned
volumes with extents with same size. And, you have to analyze the name
returned by IOCTL_MOUNTDEV_QUERY_DEVICE_NAME.

Question :
With basic disks (case in disks are imported from WinNT), how do you see
the difference between Spanned volume (Volume Set) and Striped volume
(Stripe Set) ?

Ragards
Benoit

-----Original Message-----
From: Else Kluger [mailto:xxxxx@utimaco.de]
Sent: Tuesday, November 26, 2002 2:28 PM
To: File Systems Developers
Subject: [ntfsd] Re: *RE: How to get Volume/Partition type( Simple,
Striped, Spanned…)?

I also use IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,
and I also use it for basic volumes in W2K/XP to have identical handling
for both kinds of volumes.
At least, if a basic volume has only one extent, it’s a “normal” basic
volume.
I do not agree with 3.:
my extents for a certain volume are all of the same size to simplify
creation
of extents for testing.
To see if it is spanned, compare the
PVOLUME_DISK_EXTENTS->DISK_EXTENT[index].DiskNumber(s).

Regards
Else

“Benoit FAURE”

Developers"
.com> cc:

Sent by: Subject: *[ntfsd]
RE: How to get Volume/Partition type( Simple,
xxxxx@lis Striped, Spanned…)?

ts.osr.com

26.11.2002 11:13

Please respond to

“File Systems

Developers”

Under W2K, there are no IOCTL.
I think I have a solution for dynamic disks.

The following algorithm works for many cases, buy it cannot distinguish
between a “Striped”
volume and a “Spanned” volume when every extent is the same size.
1. Call IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS for the volume.
2. If there is only one extent then the volume is “Simple”.
3. Otherwise, if the extents are not all the same size, then the
volume is “Spanned”.
4. Otherwise, if there are two extents, but the volume size is equal
to one extent, then the volume is “Mirrored”.
5. Otherwise, if there are N extents, and the volume size is the sum
of N-1 extents, then the volume is “RAID-5”.
6. Otherwise, the volume is “Spanned” or “Striped”.

An (undocumented) idea to solve #6 would be to call
IOCTL_MOUNTDEV_QUERY_DEVICE_NAME (mountmgr.h)
on the volume handle. For stripes the name looks like
\Device\HarddiskDmVolumes<diskgroupname>\StripeN.

And, after discussions with MICROSOFT, they answered me :
"we do not recommend or support any attempt to bypass our volume
manager. "
"We strongly urge customers not to try such tricks. "
"So do not really have a permenant solution now. "

Let me know if you have a better solution or a solution for basic disks.

Benoit

-----Original Message-----
From: Kristian Traikov [mailto:xxxxx@atia.com]
Sent: Thursday, November 07, 2002 3:57 PM
To: File Systems Developers
Subject: [ntfsd] How to get Volume/Partition type( Simple, Striped,
Spanned…)?

Hi all,

I just need to create two “simple” UserMode functions like these:

////////////////////////////////////////////////////////////////////////
/
// For DYNAMIC volumes
//
BOOL GetDynamicVolumeType( LPCTSTR lpRootPathName, LPDWORD
lpVolumeType);

Where volume types are:
typedef enum {
Mirror,
Stripe,
RAID5,
Spanned,
Simple,

} VOLUME_TYPE;

////////////////////////////////////////////////////////////////////////
/
// For BASIC partitions
//
BOOL GetBasicPartitionType( LPCTSTR lpRootPathName, LPDWORD
lpPartitionType);

Where partition types are:
typedef enum {
Mirror,
Stripe,
ParityStripe,
VolumeSet,
NonFT,
WholeDisk
} PARTITION_TYPE;

BASIC partitions

I found that W2K recognizes multipartition volumes created under
NT(stripe, volume set…) IF there is at least one “RESTORE disk
configuration” on these disks (it could be from different W2K
workstation).

For example:
1. You create stripe set under NT workstation (A) and save disk
configuration diskette.
2. Move disks on W2K workstation (B) and restore disk configuration from
the diskette. Disk Manager creates registry disk key on local W2K
computer
and writes some sectors on NTFT disks.
3. Now, move disk on different W2K workstation (C) and you can use the
stripe set whithout restoring disk configuration.

I have to get this type of information for both dynamic and basic
volumes
without digging into Veritas LDM database records NOR DiskKey registry
key.

Are there some undocumented functions or IOCTLS??

Kristian

__________________________________________________
Modem offert : 150,92 euros rembours?s sur le Pack eXtense de Wanadoo !
Haut d?bit ? partir de 30 euros/mois : http://www.ifrance.com/_reloc/w

Hi,
Thank you for answers.

I have believed that there is a simple way of doing that, but it seems
that it is a problem…
Currently, I have test solutions for both basic and dynamic volumes.

* Dynamic volumes
My current test solution for dynamic volumes is based on reading and
analysing the LDM database records. The detailed description of LDM
database can be found at:

http://linux-ntfs.sourceforge.net/ldm/overview/index.html

There is a good utility from SysInternals named LDMDump (unfortunately
without source code):

http://www.sysinternals.com/ntw2k/freeware/ldmdump.shtml

* Basic partitions
The solution is based on reading and analysing the registry disk key. It
works for NT & W2K. On XP you can’t create Basic stripes, volume sets,
etc. and you can’t import saved disk configuration.
You can find detailed information and source code at SysInternals site
again ;-))

http://www.sysinternals.com/ntw2k/info/diskkey.shtml

Hope this helps…

I just wonder what is the reason of hiding this kind of information!

Now, I’m really happy from the existence of API’s like
GetDriveType()
GetVolumeInformation()

Kristian