xref: /OK3568_Linux_fs/kernel/Documentation/admin-guide/ldm.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun==========================================
2*4882a593SmuzhiyunLDM - Logical Disk Manager (Dynamic Disks)
3*4882a593Smuzhiyun==========================================
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun:Author: Originally Written by FlatCap - Richard Russon <ldm@flatcap.org>.
6*4882a593Smuzhiyun:Last Updated: Anton Altaparmakov on 30 March 2007 for Windows Vista.
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunOverview
9*4882a593Smuzhiyun--------
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunWindows 2000, XP, and Vista use a new partitioning scheme.  It is a complete
12*4882a593Smuzhiyunreplacement for the MSDOS style partitions.  It stores its information in a
13*4882a593Smuzhiyun1MiB journalled database at the end of the physical disk.  The size of
14*4882a593Smuzhiyunpartitions is limited only by disk space.  The maximum number of partitions is
15*4882a593Smuzhiyunnearly 2000.
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunAny partitions created under the LDM are called "Dynamic Disks".  There are no
18*4882a593Smuzhiyunlonger any primary or extended partitions.  Normal MSDOS style partitions are
19*4882a593Smuzhiyunnow known as Basic Disks.
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunIf you wish to use Spanned, Striped, Mirrored or RAID 5 Volumes, you must use
22*4882a593SmuzhiyunDynamic Disks.  The journalling allows Windows to make changes to these
23*4882a593Smuzhiyunpartitions and filesystems without the need to reboot.
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunOnce the LDM driver has divided up the disk, you can use the MD driver to
26*4882a593Smuzhiyunassemble any multi-partition volumes, e.g.  Stripes, RAID5.
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunTo prevent legacy applications from repartitioning the disk, the LDM creates a
29*4882a593Smuzhiyundummy MSDOS partition containing one disk-sized partition.  This is what is
30*4882a593Smuzhiyunsupported with the Linux LDM driver.
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunA newer approach that has been implemented with Vista is to put LDM on top of a
33*4882a593SmuzhiyunGPT label disk.  This is not supported by the Linux LDM driver yet.
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun
36*4882a593SmuzhiyunExample
37*4882a593Smuzhiyun-------
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunBelow we have a 50MiB disk, divided into seven partitions.
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun.. note::
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun   The missing 1MiB at the end of the disk is where the LDM database is
44*4882a593Smuzhiyun   stored.
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun+-------++--------------+---------+-----++--------------+---------+----+
47*4882a593Smuzhiyun|Device || Offset Bytes | Sectors | MiB || Size   Bytes | Sectors | MiB|
48*4882a593Smuzhiyun+=======++==============+=========+=====++==============+=========+====+
49*4882a593Smuzhiyun|hda    ||            0 |       0 |   0 ||     52428800 |  102400 |  50|
50*4882a593Smuzhiyun+-------++--------------+---------+-----++--------------+---------+----+
51*4882a593Smuzhiyun|hda1   ||     51380224 |  100352 |  49 ||      1048576 |    2048 |   1|
52*4882a593Smuzhiyun+-------++--------------+---------+-----++--------------+---------+----+
53*4882a593Smuzhiyun|hda2   ||        16384 |      32 |   0 ||      6979584 |   13632 |   6|
54*4882a593Smuzhiyun+-------++--------------+---------+-----++--------------+---------+----+
55*4882a593Smuzhiyun|hda3   ||      6995968 |   13664 |   6 ||     10485760 |   20480 |  10|
56*4882a593Smuzhiyun+-------++--------------+---------+-----++--------------+---------+----+
57*4882a593Smuzhiyun|hda4   ||     17481728 |   34144 |  16 ||      4194304 |    8192 |   4|
58*4882a593Smuzhiyun+-------++--------------+---------+-----++--------------+---------+----+
59*4882a593Smuzhiyun|hda5   ||     21676032 |   42336 |  20 ||      5242880 |   10240 |   5|
60*4882a593Smuzhiyun+-------++--------------+---------+-----++--------------+---------+----+
61*4882a593Smuzhiyun|hda6   ||     26918912 |   52576 |  25 ||     10485760 |   20480 |  10|
62*4882a593Smuzhiyun+-------++--------------+---------+-----++--------------+---------+----+
63*4882a593Smuzhiyun|hda7   ||     37404672 |   73056 |  35 ||     13959168 |   27264 |  13|
64*4882a593Smuzhiyun+-------++--------------+---------+-----++--------------+---------+----+
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunThe LDM Database may not store the partitions in the order that they appear on
67*4882a593Smuzhiyundisk, but the driver will sort them.
68*4882a593Smuzhiyun
69*4882a593SmuzhiyunWhen Linux boots, you will see something like::
70*4882a593Smuzhiyun
71*4882a593Smuzhiyun  hda: 102400 sectors w/32KiB Cache, CHS=50/64/32
72*4882a593Smuzhiyun  hda: [LDM] hda1 hda2 hda3 hda4 hda5 hda6 hda7
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun
75*4882a593SmuzhiyunCompiling LDM Support
76*4882a593Smuzhiyun---------------------
77*4882a593Smuzhiyun
78*4882a593SmuzhiyunTo enable LDM, choose the following two options:
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun  - "Advanced partition selection" CONFIG_PARTITION_ADVANCED
81*4882a593Smuzhiyun  - "Windows Logical Disk Manager (Dynamic Disk) support" CONFIG_LDM_PARTITION
82*4882a593Smuzhiyun
83*4882a593SmuzhiyunIf you believe the driver isn't working as it should, you can enable the extra
84*4882a593Smuzhiyundebugging code.  This will produce a LOT of output.  The option is:
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun  - "Windows LDM extra logging" CONFIG_LDM_DEBUG
87*4882a593Smuzhiyun
88*4882a593SmuzhiyunN.B. The partition code cannot be compiled as a module.
89*4882a593Smuzhiyun
90*4882a593SmuzhiyunAs with all the partition code, if the driver doesn't see signs of its type of
91*4882a593Smuzhiyunpartition, it will pass control to another driver, so there is no harm in
92*4882a593Smuzhiyunenabling it.
93*4882a593Smuzhiyun
94*4882a593SmuzhiyunIf you have Dynamic Disks but don't enable the driver, then all you will see
95*4882a593Smuzhiyunis a dummy MSDOS partition filling the whole disk.  You won't be able to mount
96*4882a593Smuzhiyunany of the volumes on the disk.
97*4882a593Smuzhiyun
98*4882a593Smuzhiyun
99*4882a593SmuzhiyunBooting
100*4882a593Smuzhiyun-------
101*4882a593Smuzhiyun
102*4882a593SmuzhiyunIf you enable LDM support, then lilo is capable of booting from any of the
103*4882a593Smuzhiyundiscovered partitions.  However, grub does not understand the LDM partitioning
104*4882a593Smuzhiyunand cannot boot from a Dynamic Disk.
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun
107*4882a593SmuzhiyunMore Documentation
108*4882a593Smuzhiyun------------------
109*4882a593Smuzhiyun
110*4882a593SmuzhiyunThere is an Overview of the LDM together with complete Technical Documentation.
111*4882a593SmuzhiyunIt is available for download.
112*4882a593Smuzhiyun
113*4882a593Smuzhiyun  http://www.linux-ntfs.org/
114*4882a593Smuzhiyun
115*4882a593SmuzhiyunIf you have any LDM questions that aren't answered in the documentation, email
116*4882a593Smuzhiyunme.
117*4882a593Smuzhiyun
118*4882a593SmuzhiyunCheers,
119*4882a593Smuzhiyun    FlatCap - Richard Russon
120*4882a593Smuzhiyun    ldm@flatcap.org
121*4882a593Smuzhiyun
122