LDM - Logical Disk Manager (Dynamic Disks)

Author:Originally Written by FlatCap - Richard Russon <ldm@flatcap.org>.
Last Updated:Anton Altaparmakov on 30 March 2007 for Windows Vista.

Overview

Windows 2000, XP, and Vista use a new partitioning scheme. It is a completereplacement for the MSDOS style partitions. It stores its information in a1MiB journalled database at the end of the physical disk. The size ofpartitions is limited only by disk space. The maximum number of partitions isnearly 2000.

Any partitions created under the LDM are called “Dynamic Disks”. There are nolonger any primary or extended partitions. Normal MSDOS style partitions arenow known as Basic Disks.

If you wish to use Spanned, Striped, Mirrored or RAID 5 Volumes, you must useDynamic Disks. The journalling allows Windows to make changes to thesepartitions and filesystems without the need to reboot.

Once the LDM driver has divided up the disk, you can use the MD driver toassemble any multi-partition volumes, e.g. Stripes, RAID5.

To prevent legacy applications from repartitioning the disk, the LDM creates adummy MSDOS partition containing one disk-sized partition. This is what issupported with the Linux LDM driver.

A newer approach that has been implemented with Vista is to put LDM on top of aGPT label disk. This is not supported by the Linux LDM driver yet.

Example

Below we have a 50MiB disk, divided into seven partitions.

Note

The missing 1MiB at the end of the disk is where the LDM database isstored.

Device Offset BytesSectorsMiB Size BytesSectorsMiB
hda 000 5242880010240050
hda1 5138022410035249 104857620481
hda2 16384320 6979584136326
hda3 6995968136646 104857602048010
hda4 174817283414416 419430481924
hda5 216760324233620 5242880102405
hda6 269189125257625 104857602048010
hda7 374046727305635 139591682726413

The LDM Database may not store the partitions in the order that they appear ondisk, but the driver will sort them.

When Linux boots, you will see something like:

hda: 102400 sectors w/32KiB Cache, CHS=50/64/32hda: [LDM] hda1 hda2 hda3 hda4 hda5 hda6 hda7

Compiling LDM Support

To enable LDM, choose the following two options:

  • “Advanced partition selection” CONFIG_PARTITION_ADVANCED
  • “Windows Logical Disk Manager (Dynamic Disk) support” CONFIG_LDM_PARTITION

If you believe the driver isn’t working as it should, you can enable the extradebugging code. This will produce a LOT of output. The option is:

  • “Windows LDM extra logging” CONFIG_LDM_DEBUG

N.B. The partition code cannot be compiled as a module.

As with all the partition code, if the driver doesn’t see signs of its type ofpartition, it will pass control to another driver, so there is no harm inenabling it.

If you have Dynamic Disks but don’t enable the driver, then all you will seeis a dummy MSDOS partition filling the whole disk. You won’t be able to mountany of the volumes on the disk.

Booting

If you enable LDM support, then lilo is capable of booting from any of thediscovered partitions. However, grub does not understand the LDM partitioningand cannot boot from a Dynamic Disk.

More Documentation

There is an Overview of the LDM together with complete Technical Documentation.It is available for download.

If you have any LDM questions that aren’t answered in the documentation, emailme.

Cheers,
FlatCap - Richard Russonldm@flatcap.org