1LDMTOOL(1) User Commands LDMTOOL(1)
2
3
4
6 ldmtool - A tool to manage Microsoft Windows dynamic disks
7
9 ldmtool [options]
10
11 ldmtool [options] scan [device...]
12
13 ldmtool [options] show diskgroup {disk group GUID}
14
15 ldmtool [options] show {volume | partition | disk} {disk group GUID}
16 {object name}
17
18 ldmtool [options] {create | remove} all
19
20 ldmtool [options] {create | remove} volume {disk group GUID}
21 {volume name}
22
24 -d|--device device
25 Automatically scan device.
26
28 ldmtool is a tool for managing Microsoft Windows dynamic disks, which
29 use Microsoft's LDM metadata. It can inspect them, and also create and
30 remove device-mapper block devices which can be mounted.
31
32 Although a filesystem can be mounted read-write and its contents
33 modified, ldmtool is not able to modify the LDM metadata itself. That
34 is, it cannot create, remove or edit dynamic disks.
35
36 It is also not able to mount RAID5 volumes which have a partition
37 missing, although it can mount mirrored volumes with a partition
38 missing. However, mounting a volume with a missing partition is not
39 recommended, as ldmtool does not update the LDM metadata in any way.
40 This means Windows will have no way to determine that the partitions
41 are not synchronised when it subsequently mounted, which may result in
42 corruption.
43
45 ldmtool can be invoked either as a shell to run multiple actions, or to
46 run a single action and return. If an action is given on the command
47 line it will run in single action mode. If no action is given it will
48 launch a shell.
49
50 Shell mode
51 When invoked as a shell, ldmtool will not scan any block devices by
52 default. If any block devices are given on the command line with the -d
53 option, these will be scanned. Otherwise, block devices must be scanned
54 explicitly with the scan action.
55
56 Exit shell mode by sending an EOF, or with the quit or exit actions.
57
58 Single action mode
59 When invoked to run a single action all block devices will be scanned
60 by default. In this case, if any block devices are specified with the
61 -d option, only those block devices will be scanned.
62
64 ldmtool returns results as JSON-formatted data. The precise data
65 returned is described in detail below. If a command fails it will not
66 return any JSON data, but will instead display an error message. In
67 shell mode, failure can be detected by the lack of a JSON-formatted
68 result. In single action mode the caller can additionally check the
69 exit code of the command.
70
72 scan [device...]
73 Scan all [device]s for LDM metadata.
74
75 Returns a list of all known disk group GUIDs. Note that it doesn't just
76 return newly discovered disk groups.
77
78 show diskgroup {GUID}
79 Return detailed information about a single disk group.
80
81 Returns:
82
83 name
84 The human-readable name of the disk group
85
86 guid
87 The Windows-assigned GUID of the disk group
88
89 volumes
90 A list of the names of all volumes in the disk group
91
92 disks
93 A list of the name of all disks in the disk group
94
95 show volume {disk group GUID} {volume name}
96 Return detailed information about a volume.
97
98 Returns:
99
100 name
101 The name of the volume
102
103 type
104 The volume type. One of: simple , spanned , striped , mirrored ,
105 raid5
106
107 size
108 The size of the volume in sectors
109
110 chunk-size
111 The chunk size, in sectors, used by striped and raid5 volumes. For
112 other volume types it will be 0.
113
114 hint
115 The volume mounting hint. This value specifies how Windows expects
116 the volume to be mounted. For a volume with an assigned drive
117 letter, it might be 'E:'.
118
119 partitions
120 A list of the names of the partitions which constitute this volume.
121
122 show partition {disk group GUID} {partition name}
123 Return detailed information about a partition.
124
125 Returns:
126
127 name
128 The name of the partition
129
130 start
131 The offset, in sectors, of the start of the partition from the
132 beginning of the disk
133
134 size
135 The size of the partition in sectors
136
137 disk
138 The name of the disk the partition is on
139
140 show disk {disk group GUID} {disk name}
141 Return detailed information about a disk.
142
143 Returns:
144
145 name
146 The human-readable name of the disk
147
148 guid
149 The GUID of the disk
150
151 present
152 Whether the disk has been discovered during scanning: true or false
153
154 If the disk is present, additionally returns:
155
156 device
157 The name of the host device (e.g. /dev/sda)
158
159 data-start
160 The start sector of the data portion of the disk
161
162 data-size
163 The size, in sectors, of the data portion of the disk
164
165 metadata-start
166 The start sector of the metadata portion of the disk
167
168 metadata-size
169 The size, in sectors, of the metadata portion of the disk
170
171 create {volume { disk group GUID } { volume name } | all}
172 Create a device-mapper device for either the specified volume or all
173 volumes in all detected disk groups.
174
175 Returns a list of the device-mapper device names which were created by
176 this action. Note that if a device already existed for a volume it will
177 not be returned in this list.
178
179 remove {volume { disk group GUID } { volume name } | all}
180 Remove device-mapper devices for either the specified volume or all
181 volumes in all detected disk groups.
182
183 Returns a list of the device-mapper device names which were removed by
184 this action. Note that if no device existed for a volume it will not be
185 returned in this list.
186
188 The following examples form a sequence from a single session of ldmtool
189 running in shell mode.
190
191 Scan all loop devices for LDM metadata:
192
193
194 ldm> scan /dev/loop[0-9]*
195 [
196 "03c0c4fc-8b6f-402b-9431-4be2e5823b1c",
197 "06495a84-fbfd-11e1-8cf9-52540061f5db"
198 ]
199
200
201
202 Two disk groups were detected. The list contains their GUIDs.
203
204 Show detailed information about one of the disk groups:
205
206
207 ldm> show diskgroup 06495a84-fbfd-11e1-8cf9-52540061f5db
208 {
209 "name" : "WIN-ERRDJSBDAVF-Dg0",
210 "guid" : "06495a84-fbfd-11e1-8cf9-52540061f5db",
211 "volumes" : [
212 "Volume4",
213 "Volume1",
214 "Volume2",
215 "Volume3",
216 "Volume5"
217 ],
218 "disks" : [
219 "Disk1",
220 "Disk2",
221 "Disk3",
222 "Disk4",
223 "Disk5",
224 "Disk6",
225 "Disk7",
226 "Disk8",
227 "Disk9"
228 ]
229 }
230
231
232
233 Show detailed information about one of the volumes in the disk group:
234
235
236 ldm> show volume 06495a84-fbfd-11e1-8cf9-52540061f5db Volume1
237 {
238 "name" : "Volume1",
239 "type" : "spanned",
240 "size" : 129024,
241 "chunk-size" : 0,
242 "hint" : "E:",
243 "partitions" : [
244 "Disk1-01",
245 "Disk2-01"
246 ]
247 }
248
249
250
251 Show detailed information about one of the partitions in the volume:
252
253
254 ldm> show partition 06495a84-fbfd-11e1-8cf9-52540061f5db Disk1-01
255 {
256 "name" : "Disk1-01",
257 "start" : 65,
258 "size" : 96256,
259 "disk" : "Disk1"
260 }
261
262
263
264 Show detailed information about the disk containing the partition:
265
266
267 ldm> show disk 06495a84-fbfd-11e1-8cf9-52540061f5db Disk1
268 {
269 "name" : "Disk1",
270 "guid" : "06495a85-fbfd-11e1-8cf9-52540061f5db",
271 "present" : true,
272 "device" : "/dev/loop15",
273 "data-start" : 63,
274 "data-size" : 100289,
275 "metadata-start" : 100352,
276 "metadata-size" : 2048
277 }
278
279
280
281 Create a device-mapper device for a volume:
282
283
284 ldm> create volume 06495a84-fbfd-11e1-8cf9-52540061f5db Volume1
285 [
286 "ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume1"
287 ]
288
289
290
291 A new device-mapper device has been created, called
292 ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume1. Depending on how udev is
293 configured, it will probably now be available as
294 /dev/mapper/ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume1.
295
296 Create device-mapper devices for all volumes in both disk groups:
297
298
299 ldm> create all
300 [
301 "ldm_vol_Red-nzv8x6obywgDg0_Volume2",
302 "ldm_vol_Red-nzv8x6obywgDg0_Volume1",
303 "ldm_vol_Red-nzv8x6obywgDg0_Volume4",
304 "ldm_vol_Red-nzv8x6obywgDg0_Stripe1",
305 "ldm_vol_Red-nzv8x6obywgDg0_Raid1",
306 "ldm_vol_Red-nzv8x6obywgDg0_Volume3",
307 "ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume4",
308 "ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume2",
309 "ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume3",
310 "ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume5"
311 ]
312
313
314
315 Note that ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume1 is not in the list of
316 devices which were created as it already existed.
317
318 Remove the device-mapper device for a single volume:
319
320
321 ldm> remove volume 06495a84-fbfd-11e1-8cf9-52540061f5db Volume2
322 [
323 "ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume2"
324 ]
325
326
327
328
329 ldm> remove all
330 [
331 "ldm_vol_Red-nzv8x6obywgDg0_Volume2",
332 "ldm_vol_Red-nzv8x6obywgDg0_Volume1",
333 "ldm_vol_Red-nzv8x6obywgDg0_Volume4",
334 "ldm_vol_Red-nzv8x6obywgDg0_Stripe1",
335 "ldm_vol_Red-nzv8x6obywgDg0_Raid1",
336 "ldm_vol_Red-nzv8x6obywgDg0_Volume3",
337 "ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume4",
338 "ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume1",
339 "ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume3",
340 "ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume5"
341 ]
342
343
344
345 Note that ldm_vol_WIN-ERRDJSBDAVF-Dg0_Volume2 is not in the list of
346 devices which were removed, as it was removed previously.
347
349 Matthew Booth <mbooth@redhat.com>
350
351
352
353ldmtool 01/26/2021 LDMTOOL(1)