473,624 Members | 2,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic vs Basic Partitions

I don't care what .net language this come in but I really need to determine
if a disk is dynamic or basic. I have posted something in the WMI group but
no one knows how to do it. Does anyone have any idea how I can determine
this? At this point I don't care if it is a third plugin freeware app I use
that writes it to a text file that I could read out.

Thanks!
Sep 19 '06 #1
7 10741
Hi,

Dyanamic disks are partitioned using Logical Disk Manager (LDM)
partitioning. The LDM subsystem in Windows, which consists of user-mode and
device driver components, oversees dynamic disks. LDM maintains one unified
database that stores partitioning information for all the dynamic disks on
a system--including multipartition-volume configuration.

As far as I know, there're no API for calling LDM service.

The LDM database resides in a 1-MB reserved space at the end of each
dynamic disk. Unfortunately this database's format is not officially
documented.

Sysinternals.co m has a freeware called ldmdump.exe
(http://www.sysinternals.com/Utilities/LdmDump.html) which can display the
database content.

For a basic disk, the output will be:
Logical Disk Manager Configuration Dump v1.03
Copyright (C) 2000-2002 Mark Russinovich

Disk does not have LDM database.

For a dynamic disk, the output will be:

Logical Disk Manager Configuration Dump v1.03
Copyright (C) 2000-2002 Mark Russinovich

PRIVATE HEAD:
Signature : PRIVHEAD
Version : 2.11
Disk Id : 49448001-f838-447d-836d-85002666e401
Host Id : 1b77da20-c717-11d0-a5be-00a0c91db73c
Disk Group Id : 158f43d4-430b-4c1e-b6ad-43254e9c27d8
Disk Group Name : Sha-wawang-v5Dg0
Logical disk start : 3F
Logical disk size : 9C25FE (4996 MB)
Configuration start: 9C3520
Configuration size : 800 (1 MB)
Number of TOCs : 1
TOC size : 7FE (1023 KB)
Number of Configs : 1
Config size : 5AC (726 KB)
Number of Logs : 1
Log size : DC (110 KB)

...

So as a workaround, you may use this tool to output the information and
check for string "Disk does not have LDM database" to determine whether or
not this is a basic disk.

Please reply to let me know whether or not you need further information.
Thanks.

Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 20 '06 #2
That will work perfect. I will just run that in a command prompt and read it
out one by one and remove the dynamic disks from my array.

Thanks!

"Walter Wang [MSFT]" wrote:
Hi,

Dyanamic disks are partitioned using Logical Disk Manager (LDM)
partitioning. The LDM subsystem in Windows, which consists of user-mode and
device driver components, oversees dynamic disks. LDM maintains one unified
database that stores partitioning information for all the dynamic disks on
a system--including multipartition-volume configuration.

As far as I know, there're no API for calling LDM service.

The LDM database resides in a 1-MB reserved space at the end of each
dynamic disk. Unfortunately this database's format is not officially
documented.

Sysinternals.co m has a freeware called ldmdump.exe
(http://www.sysinternals.com/Utilities/LdmDump.html) which can display the
database content.

For a basic disk, the output will be:
Logical Disk Manager Configuration Dump v1.03
Copyright (C) 2000-2002 Mark Russinovich

Disk does not have LDM database.

For a dynamic disk, the output will be:

Logical Disk Manager Configuration Dump v1.03
Copyright (C) 2000-2002 Mark Russinovich

PRIVATE HEAD:
Signature : PRIVHEAD
Version : 2.11
Disk Id : 49448001-f838-447d-836d-85002666e401
Host Id : 1b77da20-c717-11d0-a5be-00a0c91db73c
Disk Group Id : 158f43d4-430b-4c1e-b6ad-43254e9c27d8
Disk Group Name : Sha-wawang-v5Dg0
Logical disk start : 3F
Logical disk size : 9C25FE (4996 MB)
Configuration start: 9C3520
Configuration size : 800 (1 MB)
Number of TOCs : 1
TOC size : 7FE (1023 KB)
Number of Configs : 1
Config size : 5AC (726 KB)
Number of Logs : 1
Log size : DC (110 KB)

...

So as a workaround, you may use this tool to output the information and
check for string "Disk does not have LDM database" to determine whether or
not this is a basic disk.

Please reply to let me know whether or not you need further information.
Thanks.

Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 20 '06 #3
Walter,

I thought I was golden with that program but I actually came across a
computer that show LDM information for a basic disk. When I run it on other
comps it gives me the no LDM database for all the basic disks but this one
server does have LDM info on the basic disk. Not sure how that is possible
but I am going to need a different solution. I know it is possible because I
have other programs that run and only show basic disks on the comp.

Thanks again!

"Walter Wang [MSFT]" wrote:
Hi,

Dyanamic disks are partitioned using Logical Disk Manager (LDM)
partitioning. The LDM subsystem in Windows, which consists of user-mode and
device driver components, oversees dynamic disks. LDM maintains one unified
database that stores partitioning information for all the dynamic disks on
a system--including multipartition-volume configuration.

As far as I know, there're no API for calling LDM service.

The LDM database resides in a 1-MB reserved space at the end of each
dynamic disk. Unfortunately this database's format is not officially
documented.

Sysinternals.co m has a freeware called ldmdump.exe
(http://www.sysinternals.com/Utilities/LdmDump.html) which can display the
database content.

For a basic disk, the output will be:
Logical Disk Manager Configuration Dump v1.03
Copyright (C) 2000-2002 Mark Russinovich

Disk does not have LDM database.

For a dynamic disk, the output will be:

Logical Disk Manager Configuration Dump v1.03
Copyright (C) 2000-2002 Mark Russinovich

PRIVATE HEAD:
Signature : PRIVHEAD
Version : 2.11
Disk Id : 49448001-f838-447d-836d-85002666e401
Host Id : 1b77da20-c717-11d0-a5be-00a0c91db73c
Disk Group Id : 158f43d4-430b-4c1e-b6ad-43254e9c27d8
Disk Group Name : Sha-wawang-v5Dg0
Logical disk start : 3F
Logical disk size : 9C25FE (4996 MB)
Configuration start: 9C3520
Configuration size : 800 (1 MB)
Number of TOCs : 1
TOC size : 7FE (1023 KB)
Number of Configs : 1
Config size : 5AC (726 KB)
Number of Logs : 1
Log size : DC (110 KB)

...

So as a workaround, you may use this tool to output the information and
check for string "Disk does not have LDM database" to determine whether or
not this is a basic disk.

Please reply to let me know whether or not you need further information.
Thanks.

Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 21 '06 #4
I'm interested in the case that ldmdump.exe reports information on a basic
disk. Would you please post the output here or send it to me?

Another approach is to use diskpart.exe, its command "list disk"
(http://www.microsoft.com/resources/d...ll/proddocs/en
-us/diskpart.mspx?m fr=true) can show current disk list:
Disk ### Status Size Free Dyn Gpt
-------- ---------- ------- ------- --- ---
Disk 0 Online 149 GB 0 B *

If the disk is a dynamic disk, the field "Dyn" will be marked as "*".

You can create a text file with content "list disk" and pass the file to
diskpart.exe /s:

diskpart.exe /s 1.txt

Fore more information about dynamic disk, refer to
http://technet2.microsoft.com/Window...c-949c-4105-90
14-e3252e4edb27103 3.mspx?mfr=true

Sep 22 '06 #5
That might work. Thanks again. I would be glad to send you the info. How
can I get it to you?

"Walter Wang [MSFT]" wrote:
I'm interested in the case that ldmdump.exe reports information on a basic
disk. Would you please post the output here or send it to me?

Another approach is to use diskpart.exe, its command "list disk"
(http://www.microsoft.com/resources/d...ll/proddocs/en
-us/diskpart.mspx?m fr=true) can show current disk list:
Disk ### Status Size Free Dyn Gpt
-------- ---------- ------- ------- --- ---
Disk 0 Online 149 GB 0 B *

If the disk is a dynamic disk, the field "Dyn" will be marked as "*".

You can create a text file with content "list disk" and pass the file to
diskpart.exe /s:

diskpart.exe /s 1.txt

Fore more information about dynamic disk, refer to
http://technet2.microsoft.com/Window...c-949c-4105-90
14-e3252e4edb27103 3.mspx?mfr=true

Sep 22 '06 #6
You can send the information to me via my email (see my signature). Please
let me know whether diskpart.exe works or not. Thank you.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 25 '06 #7
Hi Joey,

I've done more researching and consulting recently. If you're interested,
we can use DeviceIoControl with IOCTL_DISK_GET_ DRIVE_LAYOUT_EX to get the
partition types on the drive. As long as we can find one partition with LDM
related information, we know the disk is a Dynamic disk.

Here's the sample code of a C++ Win32 Console application which prints out
is the first disk Dynamic/Basic disk:

#include "stdafx.h"
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <winioctl.h>
// #include <diskguid.h>
const GUID PARTITION_LDM_D ATA_GUID = {0xAF9B60A0L, 0x1431, 0x4F62, 0xBC,
0x68, 0x33, 0x11, 0x71, 0x4A, 0x69, 0xAD}; // Logical Disk Manager data
partition
#define PHYSICALDRIVE TEXT("PhysicalD rive")

void ErrorExit(LPTST R lpszFunction)
{
LPVOID lpMsgBuf;
DWORD dw = GetLastError();

FormatMessage(
FORMAT_MESSAGE_ ALLOCATE_BUFFER |
FORMAT_MESSAGE_ FROM_SYSTEM,
NULL,
dw,
MAKELANGID(LANG _NEUTRAL, SUBLANG_DEFAULT ),
(LPTSTR) &lpMsgBuf,
0, NULL );

wprintf(TEXT("% s failed with error %d: %s\n"),
lpszFunction, dw, lpMsgBuf);

LocalFree(lpMsg Buf);
ExitProcess(dw) ;
}

bool IsPartitionDyna mic(PARTITION_I NFORMATION_EX *pPie)
{
bool ret = false;
if (pPie->PartitionSty le == PARTITION_STYLE _MBR)
{
ret = pPie->Mbr.PartitionT ype == PARTITION_LDM;
} else if (pPie->PartitionSty le == PARTITION_STYLE _GPT)
{
ret = IsEqualGUID(pPi e->Gpt.PartitionT ype, PARTITION_LDM_D ATA_GUID);
}
return ret;
}

bool IsDiskDynamic(i nt nDiskNo)
{
bool ret = false;
TCHAR szDiskPath[MAX_PATH];
wsprintf(szDisk Path, TEXT("\\\\.\\%s %u"), PHYSICALDRIVE, nDiskNo);
HANDLE hDisk = CreateFile(szDi skPath, GENERIC_READ, FILE_SHARE_READ |
FILE_SHARE_WRIT E, NULL, OPEN_EXISTING, 0, NULL);
if (hDisk != INVALID_HANDLE_ VALUE) {
DRIVE_LAYOUT_IN FORMATION_EX *pInfo;
DWORD dwBytesReturn = 0;
int estimatedPartit ionCount = 4;
loop:
DWORD dwSize = sizeof(DRIVE_LA YOUT_INFORMATIO N_EX) +
estimatedPartit ionCount * sizeof(PARTITIO N_INFORMATION_E X);
pInfo = (DRIVE_LAYOUT_I NFORMATION_EX *) new BYTE[dwSize];
if (DeviceIoContro l(hDisk, IOCTL_DISK_GET_ DRIVE_LAYOUT_EX , NULL, 0,
(LPVOID) pInfo,
dwSize,
&dwBytesRetu rn,
NULL))
{
for (DWORD i = 0; i < pInfo->PartitionCount ; i++)
{
if (IsPartitionDyn amic(pInfo->PartitionEnt ry + i))
{
ret = true;
break;
}
}
} else {
if (GetLastError() == ERROR_INSUFFICI ENT_BUFFER)
{
estimatedPartit ionCount *= 2;
delete pInfo;
goto loop;
} else {
ErrorExit(TEXT( "DeviceIoContro l"));
}
}
CloseHandle(hDi sk);
delete pInfo;
} else {
ErrorExit(TEXT( "CreateFile "));
}
return ret;
}

int _tmain(int argc, _TCHAR* argv[])
{
wprintf(TEXT("D isk 0 is %s disk.\n"), IsDiskDynamic(0 ) ? TEXT("Dynamic") :
TEXT("Basic"));
return 0;
}

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 28 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2952
by: jasper | last post by:
hi, i am trying to make a very simple program that will just detect and output your currently connected IDE devices. It will look something like this: IDE PRIMARY MASTER: IDE PRIMARY SLAVE: IDE SECONDARY MASTER:
7
2209
by: Steve | last post by:
This post has two parts. First is my feedback on sets. (Hello? Last summer called, they want their discussion thread back...) Second is some questions about my implementation of a partition function for sets. Part 1. --- >From: Raymond Hettinger (vze4rx4y@verizon.net) >Subject: Py2.3: Feedback on Sets >Newsgroups: comp.lang.python >Date: 2003-08-11 23:02:18 PST
5
4296
by: Nick J Chackowsky | last post by:
Wrote a python script to find the partitions of an integer (a list of all the ways you can express n as a sum of integers). For example, the partitions of 5 are 5 4+1 3+2 2+2+1 3+1+1 2+1+1+1 1+1+1+1+1
3
2462
by: jcgeorge | last post by:
I have a Windows DPF (v8.2.2) environment. 2 Nodes 5 Partitions Server1 - Cat (0) Data (1) Data (2) Server2 - Data (3) Data (4) I want to use block-based IO, but I do not want the same size block area of the bufferpool in each partition, I want a smaller value in the catalog partition - because the bufferpool size is much smaller.
8
1640
by: arunrocks | last post by:
Hi I am having a requirement to create a db in 2 out of 8 partitiones. I have the following doubts. 1. should I create a new instance in 2 partitions alone (the present instance spans 8 nodes) 2. or is there a way to create the db in 2 out of 8. If I have to create a new instance, (its a BCU from IBM) I;d be happy if someone would link a material (1st time I am working in a partitioned env) Should I execute db2icrt in each of the...
3
4869
by: m.smith_1999 | last post by:
Hello, I'm a student software developer. As a part of an excerise I'm doing I'm trying to build a program to create "mount files" and mount them. Something like Sarah Dean's OTFE but really really basic, just to create partitions and mount them. Nothing else. All I want to do is be able to create a hidden partition inside an existing partition (by providing an offset just like in FreeOTFE) and be able to mount and dismount it. Without...
3
18700
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however, working with complex reports is tricky Assumption: Reader of this article have basic knowledge of creating data reports. Creating a Parent-Child Command and create a DataReport Suppose we have a database called company with two tables ...
1
27774
Nepomuk
by: Nepomuk | last post by:
In most modern distributions of Linux and Unix (at least ones with graphical environments like KDE, Gnome or XFCE), you get to mount your partitions easily from the desktop. In some cases however, it isn't that easy. Note, that all of these commands have to be run in a terminal as root user. To open a terminal (sometimes called a console), either press ALT+F2 and type xterm (alternatives could be konsole or terminal) or press CRTL+ALT+F1 to...
3
7063
by: Justin | last post by:
Is there a way to attach a partition to an existing table that already has partitions (without loading data)? For example, the syntax of the attach partition is documented below: alter table <tablenameattach partition P_data_2009Q1 STARTING FROM ('01/01/2009') INCLUSIVE ENDING AT ('03/31/2009') INCLUSIVE from <tableload> The goal is to set-up the partition but not actually load any data into it.
0
8251
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8688
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8352
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7178
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2614
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1800
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.