1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730
|
<refentry id="ldmtool" lang="en">
<info>
<productname>ldmtool</productname>
<author>
<personname>
<firstname>Matthew</firstname>
<surname>Booth</surname>
</personname>
<email>mbooth@redhat.com</email>
<personblurb>Primary developer</personblurb>
</author>
</info>
<refmeta>
<refentrytitle>ldmtool</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">User Commands</refmiscinfo>
</refmeta>
<refnamediv>
<refname>ldmtool</refname>
<refpurpose>A tool to manage Microsoft Windows dynamic disks</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>ldmtool</command>
<arg choice='opt'>options</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>ldmtool</command>
<arg choice='opt'>options</arg>
<arg choice='plain'>scan</arg>
<arg choice='opt' rep='repeat'><replaceable>device</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>ldmtool</command>
<arg choice='opt'>options</arg>
<arg choice='plain'>show</arg>
<arg choice='plain'>diskgroup</arg>
<arg choice='req'><replaceable>disk group GUID</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>ldmtool</command>
<arg choice='opt'>options</arg>
<arg choice='plain'>show</arg>
<group choice='req'>
<arg choice='plain'>volume</arg>
<arg choice='plain'>partition</arg>
<arg choice='plain'>disk</arg>
</group>
<arg choice='req'><replaceable>disk group GUID</replaceable></arg>
<arg choice='req'><replaceable>object name</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>ldmtool</command>
<arg choice='opt'>options</arg>
<group choice='req'>
<arg choice='plain'>create</arg>
<arg choice='plain'>remove</arg>
</group>
<arg choice='plain'>all</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>ldmtool</command>
<arg choice='opt'>options</arg>
<group choice='req'>
<arg choice='plain'>create</arg>
<arg choice='plain'>remove</arg>
</group>
<arg choice='plain'>volume</arg>
<arg choice='req'><replaceable>disk group GUID</replaceable></arg>
<arg choice='req'><replaceable>volume name</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Options</title>
<variablelist>
<varlistentry>
<term>
<option>-d|--device</option> <replaceable>device</replaceable>
</term>
<listitem>
<para>
Automatically scan <replaceable>device</replaceable>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
<command>ldmtool</command> is a tool for managing Microsoft Windows dynamic
disks, which use Microsoft's LDM metadata. It can inspect them, and also
create and remove device-mapper block devices which can be mounted.
</para>
<para>
Although a filesystem can be mounted read-write and its contents modified,
<command>ldmtool</command> is not able to modify the LDM metadata itself.
That is, it cannot create, remove or edit dynamic disks.
</para>
<para>
It is also not able to mount RAID5 volumes which have a partition missing,
although it can mount mirrored volumes with a partition missing. However,
mounting a volume with a missing partition is not recommended, as ldmtool
does not update the LDM metadata in any way. This means Windows will have no
way to determine that the partitions are not synchronised when it
subsequently mounted, which may result in corruption.
</para>
</refsect1>
<refsect1>
<title>Invocation</title>
<para>
<command>ldmtool</command> can be invoked either as a shell to run multiple
actions, or to run a single action and return. If an action is given on the
command line it will run in single action mode. If no action is given it
will launch a shell.
</para>
<refsect2>
<title>Shell mode</title>
<para>
When invoked as a shell, <command>ldmtool</command> will not scan any
block devices by default. If any block devices are given on the command
line with the <option>-d</option> option, these will be scanned.
Otherwise, block devices must be scanned explicitly with the
<option>scan</option> action.
</para>
<para>
Exit shell mode by sending an <literal>EOF</literal>, or with the
<literal>quit</literal> or <literal>exit</literal> actions.
</para>
</refsect2>
<refsect2>
<title>Single action mode</title>
<para>
When invoked to run a single action all block devices will be scanned by
default. In this case, if any block devices are specified with the
<option>-d</option> option, only those block devices will be scanned.
</para>
</refsect2>
</refsect1>
<refsect1>
<title>Results</title>
<para>
<command>ldmtool</command> returns results as JSON-formatted data. The
precise data returned is described in detail below. If a command fails it
will not return any JSON data, but will instead display an error message. In
shell mode, failure can be detected by the lack of a JSON-formatted result.
In single action mode the caller can additionally check the exit code of the
command.
</para>
</refsect1>
<refsect1>
<title>Actions</title>
<refsect2>
<title>
<command>scan</command>
<arg choice='opt' rep='repeat'>device</arg>
</title>
<para>
Scan all <arg>device</arg>s for LDM metadata.
</para>
<para>
Returns a list of all known disk group GUIDs. Note that it doesn't just
return newly discovered disk groups.
</para>
</refsect2>
<refsect2>
<title>
<command>show</command> diskgroup
<arg choice='req'><replaceable>GUID</replaceable></arg>
</title>
<para>
Return detailed information about a single disk group.
</para>
<variablelist>
<title>Returns:</title>
<varlistentry>
<term>name</term>
<listitem>
<para>The human-readable name of the disk group</para>
</listitem>
</varlistentry>
<varlistentry>
<term>guid</term>
<listitem>
<para>The Windows-assigned GUID of the disk group</para>
</listitem>
</varlistentry>
<varlistentry>
<term>volumes</term>
<listitem>
<para>
A list of the names of all volumes in the disk group
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>disks</term>
<listitem>
<para>A list of the name of all disks in the disk group</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2>
<title>
<command>show</command> volume
<arg choice='req'><replaceable>disk group GUID</replaceable></arg>
<arg choice='req'><replaceable>volume name</replaceable></arg>
</title>
<para>
Return detailed information about a volume.
</para>
<variablelist>
<title>Returns:</title>
<varlistentry>
<term>name</term>
<listitem>
<para>The name of the volume</para>
</listitem>
</varlistentry>
<varlistentry>
<term>guid</term>
<listitem>
<para>The Windows-assigned GUID of the volume</para>
</listitem>
</varlistentry>
<varlistentry>
<term>type</term>
<listitem>
<para>
The volume type. One of:
<simplelist type='inline'>
<member>
<literal>simple</literal>
</member>
<member>
<literal>spanned</literal>
</member>
<member>
<literal>striped</literal>
</member>
<member>
<literal>mirrored</literal>
</member>
<member>
<literal>raid5</literal>
</member>
</simplelist>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>size</term>
<listitem>
<para>The size of the volume in sectors</para>
</listitem>
</varlistentry>
<varlistentry>
<term>chunk-size</term>
<listitem>
<para>
The chunk size, in sectors, used by
<literal>striped</literal> and <literal>raid5</literal>
volumes. For other volume types it will be
<literal>0</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>hint</term>
<listitem>
<para>
The volume mounting hint. This value specifies how Windows
expects the volume to be mounted. For a volume with an
assigned drive letter, it might be 'E:'.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>device</term>
<listitem>
<para>
The host device-mapper device which was created for this
volume if any (e.g. /dev/mapper/ldm_vol_Machine-Dg0_Volume1)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>partitions</term>
<listitem>
<para>
A list of the names of the partitions which constitute this
volume.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2>
<title>
<command>show</command> partition
<arg choice='req'><replaceable>disk group GUID</replaceable></arg>
<arg choice='req'><replaceable>partition name</replaceable></arg>
</title>
<para>
Return detailed information about a partition.
</para>
<variablelist>
<title>Returns:</title>
<varlistentry>
<term>name</term>
<listitem>
<para>The name of the partition</para>
</listitem>
</varlistentry>
<varlistentry>
<term>start</term>
<listitem>
<para>
The offset, in sectors, of the start of the partition from
the beginning of the disk
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>size</term>
<listitem>
<para>The size of the partition in sectors</para>
</listitem>
</varlistentry>
<varlistentry>
<term>disk</term>
<listitem>
<para>The name of the disk the partition is on</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2>
<title>
<command>show</command> disk
<arg choice='req'><replaceable>disk group GUID</replaceable></arg>
<arg choice='req'><replaceable>disk name</replaceable></arg>
</title>
<para>
Return detailed information about a disk.
</para>
<variablelist>
<title>Returns:</title>
<varlistentry>
<term>name</term>
<listitem>
<para>The human-readable name of the disk</para>
</listitem>
</varlistentry>
<varlistentry>
<term>guid</term>
<listitem>
<para>The GUID of the disk</para>
</listitem>
</varlistentry>
<varlistentry>
<term>present</term>
<listitem>
<para>
Whether the disk has been discovered during scanning:
<literal>true</literal> or <literal>false</literal>
</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<title>If the disk is present, additionally returns:</title>
<varlistentry>
<term>device</term>
<listitem>
<para>The name of the host device (e.g. /dev/sda)</para>
</listitem>
</varlistentry>
<varlistentry>
<term>data-start</term>
<listitem>
<para>
The start sector of the data portion of the disk
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>data-size</term>
<listitem>
<para>
The size, in sectors, of the data portion of the disk
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>metadata-start</term>
<listitem>
<para>
The start sector of the metadata portion of the disk
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>metadata-size</term>
<listitem>
<para>
The size, in sectors, of the metadata portion of the disk
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2>
<title>
<command>create</command>
<group choice='req'>
<arg choice='plain'>
<arg choice='plain'>volume</arg>
<arg choice='req'>
<replaceable>disk group GUID</replaceable>
</arg>
<arg choice='req'>
<replaceable>volume name</replaceable>
</arg>
</arg>
<arg choice='plain'>all</arg>
</group>
</title>
<para>
Create a device-mapper device for either the specified volume or all
volumes in all detected disk groups.
</para>
<para>
Returns a list of the device-mapper device names which were created by
this action. Note that if a device already existed for a volume it will
not be returned in this list.
</para>
</refsect2>
<refsect2>
<title>
<command>remove</command>
<group choice='req'>
<arg choice='plain'>
<arg choice='plain'>volume</arg>
<arg choice='req'>
<replaceable>disk group GUID</replaceable>
</arg>
<arg choice='req'>
<replaceable>volume name</replaceable>
</arg>
</arg>
<arg choice='plain'>all</arg>
</group>
</title>
<para>
Remove device-mapper devices for either the specified volume or all
volumes in all detected disk groups.
</para>
<para>
Returns a list of the device-mapper device names which were removed by
this action. Note that if no device existed for a volume it will not be
returned in this list.
</para>
</refsect2>
</refsect1>
<refsect1>
<title>Examples</title>
<para>
The following examples form a sequence from a single session of ldmtool
running in shell mode.
</para>
<para>
Scan all loop devices for LDM metadata:
</para>
<screen>
<![CDATA[
ldm> scan /dev/loop[0-9]*
[
"03c0c4fc-8b6f-402b-9431-4be2e5823b1c",
"06495a84-fbfd-11e1-8cf9-52540061f5db"
]
]]>
</screen>
<para>
Two disk groups were detected. The list contains their GUIDs.
</para>
<para>
Show detailed information about one of the disk groups:
</para>
<screen>
<![CDATA[
ldm> show diskgroup 06495a84-fbfd-11e1-8cf9-52540061f5db
{
"name" : "WIN-ERRDJSBDAVF-Dg0",
"guid" : "06495a84-fbfd-11e1-8cf9-52540061f5db",
"volumes" : [
"Volume4",
"Volume1",
"Volume2",
"Volume3",
"Volume5"
],
"disks" : [
"Disk1",
"Disk2",
"Disk3",
"Disk4",
"Disk5",
"Disk6",
"Disk7",
"Disk8",
"Disk9"
]
}
]]>
</screen>
<para>
Show detailed information about one of the volumes in the disk group:
</para>
<screen>
<![CDATA[
ldm> show volume 06495a84-fbfd-11e1-8cf9-52540061f5db Volume1
{
"name" : "Volume1",
"guid" : "c08309e9-1d30-43e5-8dc3-fcec8be76fcc",
"type" : "spanned",
"size" : 129024,
"chunk-size" : 0,
"hint" : "E:",
"device" : "ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume1",
"partitions" : [
"Disk1-01",
"Disk2-01"
]
}
]]>
</screen>
<para>
Show detailed information about one of the partitions in the volume:
</para>
<screen>
<![CDATA[
ldm> show partition 06495a84-fbfd-11e1-8cf9-52540061f5db Disk1-01
{
"name" : "Disk1-01",
"start" : 65,
"size" : 96256,
"disk" : "Disk1"
}
]]>
</screen>
<para>
Show detailed information about the disk containing the partition:
</para>
<screen>
<![CDATA[
ldm> show disk 06495a84-fbfd-11e1-8cf9-52540061f5db Disk1
{
"name" : "Disk1",
"guid" : "06495a85-fbfd-11e1-8cf9-52540061f5db",
"present" : true,
"device" : "/dev/loop15",
"data-start" : 63,
"data-size" : 100289,
"metadata-start" : 100352,
"metadata-size" : 2048
}
]]>
</screen>
<para>
Create a device-mapper device for a volume:
</para>
<screen>
<![CDATA[
ldm> create volume 06495a84-fbfd-11e1-8cf9-52540061f5db Volume1
[
"ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume1"
]
]]>
</screen>
<para>
A new device-mapper device has been created, called
<literal>ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume1</literal>. Depending on how
udev is configured, it will probably now be available as
<literal>/dev/mapper/ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume1</literal>.
</para>
<para>
Note that returned name of the created device-mapper device is unmangled
and thus can contains not-whitelisted characters. User-space
device-mapper tools (like <literal>dmsetup</literal>) and
<literal>libdevmapper</literal> library accept unmangled names (if
properly configured) but take extra care composing path to a created
device yourself. Consider using <literal>"device"</literal> field of the
<command>show volume</command> command output.
</para>
<para>
Create device-mapper devices for all volumes in both disk groups:
</para>
<screen>
<![CDATA[
ldm> create all
[
"ldm_vol_Red-nzv8x6obywgDg0_Volume2",
"ldm_vol_Red-nzv8x6obywgDg0_Volume1",
"ldm_vol_Red-nzv8x6obywgDg0_Volume4",
"ldm_vol_Red-nzv8x6obywgDg0_Stripe1",
"ldm_vol_Red-nzv8x6obywgDg0_Raid1",
"ldm_vol_Red-nzv8x6obywgDg0_Volume3",
"ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume4",
"ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume2",
"ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume3",
"ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume5"
]
]]>
</screen>
<para>
Note that <literal>ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume1</literal> is not in
the list of devices which were created as it already existed.
</para>
<para>
Remove the device-mapper device for a single volume:
</para>
<screen>
<![CDATA[
ldm> remove volume 06495a84-fbfd-11e1-8cf9-52540061f5db Volume2
[
"ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume2"
]
]]>
</screen>
<screen>
<![CDATA[
ldm> remove all
[
"ldm_vol_Red-nzv8x6obywgDg0_Volume2",
"ldm_vol_Red-nzv8x6obywgDg0_Volume1",
"ldm_vol_Red-nzv8x6obywgDg0_Volume4",
"ldm_vol_Red-nzv8x6obywgDg0_Stripe1",
"ldm_vol_Red-nzv8x6obywgDg0_Raid1",
"ldm_vol_Red-nzv8x6obywgDg0_Volume3",
"ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume4",
"ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume1",
"ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume3",
"ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume5"
]
]]>
</screen>
<para>
Note that <literal>ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume2</literal> is not in
the list of devices which were removed, as it was removed previously.
</para>
</refsect1>
</refentry>
|