1LVMDEVICES(8) System Manager's Manual LVMDEVICES(8)
2
3
4
6 lvmdevices — Manage the devices file
7
9 lvmdevices option_args
10 [ option_args ]
11
12 --adddev PV
13 --addpvid String
14 --check
15 --commandprofile String
16 --config String
17 -d|--debug
18 --deldev String
19 --delpvid String
20 --deviceidtype String
21 --devices PV
22 --devicesfile String
23 --driverloaded y|n
24 -h|--help
25 --journal String
26 --lockopt String
27 --longhelp
28 --nohints
29 --nolocking
30 --profile String
31 -q|--quiet
32 -t|--test
33 --update
34 -v|--verbose
35 --version
36 -y|--yes
37
39 The LVM devices file lists devices that lvm can use. The default file
40 is /etc/lvm/devices/system.devices, and the lvmdevices(8) command is
41 used to add or remove device entries. If the file does not exist, or
42 if lvm.conf includes use_devicesfile=0, then lvm will not use a devices
43 file.
44
45 To use a device with lvm, add it to the devices file with the command
46 lvmdevices --adddev, and to prevent lvm from seeing or using a device,
47 remove it from the devices file with lvmdevices --deldev. The vgim‐
48 portdevices(8) command adds all PVs from a VG to the devices file, and
49 updates the VG metadata to include device IDs of the PVs.
50
51 Commands that add new devices to the devices file necessarily look out‐
52 side the existing devices file to find the devices being added. pvcre‐
53 ate, vgcreate, and vgextend also look outside the devices file to cre‐
54 ate new PVs and add those PVs to the devices file.
55
56 LVM records devices in the devices file using hardware-specific IDs,
57 such as the WWID, and attempts to use subsystem-specific IDs for vir‐
58 tual device types (which also aim to be as unique and stable as possi‐
59 ble.) These device IDs are also written in the VG metadata. When no
60 hardware or virtual ID is available, lvm falls back using the unstable
61 device name as the device ID. When devnames are used as IDs, lvm per‐
62 forms extra scanning to find devices if their devname changes, e.g. af‐
63 ter reboot.
64
65 When proper device IDs are used, an lvm command will not look at de‐
66 vices outside the devices file, but when devnames are used as a fall‐
67 back, lvm will scan devices outside the devices file to locate PVs on
68 renamed devices. A config setting search_for_devnames can be used to
69 control the scanning for renamed devname entries.
70
71 Related to the devices file, the new command option --devices <dev‐
72 names> allows a list of devices to be specified for the command to use,
73 overriding the devices file. The listed devices act as a sort of de‐
74 vices file in terms of limiting which devices lvm will see and use.
75 Devices that are not listed will appear to be missing to the lvm com‐
76 mand.
77
78 Multiple devices files can be kept /etc/lvm/devices, which allows lvm
79 to be used with different sets of devices. For example, system devices
80 do not need to be exposed to a specific application, and the applica‐
81 tion can use lvm on its own devices that are not exposed to the system.
82 The option --devicesfile <filename> is used to select the devices file
83 to use with the command. Without the option set, the default system
84 devices file is used.
85
86 Setting --devicesfile "" causes lvm to not use a devices file.
87
88 With no devices file, lvm will use any device on the system, and ap‐
89 plies the filter to limit the full set of system devices. With a de‐
90 vices file, the regex filter is not used, and the filter settings in
91 lvm.conf or the command line are ignored. The vgimportdevices command
92 is one exception which does apply the regex filter when looking for a
93 VG to import.
94
95 If a devices file exists, lvm will use it, even if it's empty. An
96 empty devices file means lvm will see no devices.
97
98 If the system devices file does not yet exist, the pvcreate or vgcreate
99 commands will create it if they see no existing VGs on the system.
100 lvmdevices --addev and vgimportdevices will always create a new devices
101 file if it does not yet exist.
102
103 It is recommended to use lvm commands to make changes to the devices
104 file to ensure proper updates.
105
106 The device ID and device ID type are included in the VG metadata and
107 can be reported with pvs -o deviceid,deviceidtype. (Note that the
108 lvmdevices command does not update VG metadata, but subsequent lvm com‐
109 mands modifying the metadata will include the device ID.)
110
111 Possible device ID types are:
112
113 • sys_wwid uses the wwid reported by sysfs. This is the first choice
114 for non-virtual devices.
115
116 • sys_serial uses the serial number reported by sysfs. This is the
117 second choice for non-virtual devices.
118
119 • mpath_uuid is used for dm multipath devices, reported by sysfs.
120
121 • crypt_uuid is used for dm crypt devices, reported by sysfs.
122
123 • md_uuid is used for md devices, reported by sysfs.
124
125 • lvmlv_uuid is used if a PV is placed on top of an lvm LV, reported by
126 sysfs.
127
128 • loop_file is used for loop devices, the backing file name repored by
129 sysfs.
130
131 • devname the device name is used if no other type applies.
132
133 The default choice for device ID type can be overriden using lvmdevices
134 --addev --deviceidtype <type>. If the specified type is available for
135 the device it will be used, otherwise the device will be added using
136 the type that would otherwise be chosen.
137
139 Print devices in the devices file.
140
141 lvmdevices
142 [ COMMON_OPTIONS ]
143
144 —
145
146 Check the devices file and report incorrect values.
147
148 lvmdevices --check
149 [ COMMON_OPTIONS ]
150
151 —
152
153 Update the devices file to fix incorrect values.
154
155 lvmdevices --update
156 [ COMMON_OPTIONS ]
157
158 —
159
160 Add a device to the devices file.
161
162 lvmdevices --adddev PV
163 [ --deviceidtype String ]
164 [ COMMON_OPTIONS ]
165
166 —
167
168 Remove a device from the devices file.
169
170 lvmdevices --deldev String|PV
171 [ --deviceidtype String ]
172 [ COMMON_OPTIONS ]
173
174 —
175
176 Find the device with the given PVID and add it to the devices file.
177
178 lvmdevices --addpvid String
179 [ --deviceidtype String ]
180 [ COMMON_OPTIONS ]
181
182 —
183
184 Remove the devices file entry for the given PVID.
185
186 lvmdevices --delpvid String
187 [ COMMON_OPTIONS ]
188
189 —
190
191 Common options for lvm:
192 [ -d|--debug ]
193 [ -h|--help ]
194 [ -q|--quiet ]
195 [ -t|--test ]
196 [ -v|--verbose ]
197 [ -y|--yes ]
198 [ --commandprofile String ]
199 [ --config String ]
200 [ --devices PV ]
201 [ --devicesfile String ]
202 [ --driverloaded y|n ]
203 [ --journal String ]
204 [ --lockopt String ]
205 [ --longhelp ]
206 [ --nohints ]
207 [ --nolocking ]
208 [ --profile String ]
209 [ --version ]
210
212 --adddev PV
213 Add a device to the devices file.
214
215 --addpvid String
216 Find a device with the PVID and add the device to the devices
217 file.
218
219 --check
220 Checks the content of the devices file. Reports incorrect de‐
221 vice names or PVIDs for entries.
222
223 --commandprofile String
224 The command profile to use for command configuration. See
225 lvm.conf(5) for more information about profiles.
226
227 --config String
228 Config settings for the command. These override lvm.conf(5) set‐
229 tings. The String arg uses the same format as lvm.conf(5), or
230 may use section/field syntax. See lvm.conf(5) for more informa‐
231 tion about config.
232
233 -d|--debug ...
234 Set debug level. Repeat from 1 to 6 times to increase the detail
235 of messages sent to the log file and/or syslog (if configured).
236
237 --deldev String
238 Remove a device from the devices file. When used alone,
239 --deldev specifies a device name. When used with --deviceid‐
240 type, --deldev specifies a device id.
241
242 --delpvid String
243 Remove a device with the PVID from the devices file.
244
245 --deviceidtype String
246 The type of device ID to use for the device. If the specified
247 type is available for the device, then it will override the de‐
248 fault type that lvm would use.
249
250 --devices PV
251 Restricts the devices that are visible and accessible to the
252 command. Devices not listed will appear to be missing. This op‐
253 tion can be repeated, or accepts a comma separated list of de‐
254 vices. This overrides the devices file.
255
256 --devicesfile String
257 A file listing devices that LVM should use. The file must exist
258 in /etc/lvm/devices/ and is managed with the lvmdevices(8) com‐
259 mand. This overrides the lvm.conf(5) devices/devicesfile and
260 devices/use_devicesfile settings.
261
262 --driverloaded y|n
263 If set to no, the command will not attempt to use device-mapper.
264 For testing and debugging.
265
266 -h|--help
267 Display help text.
268
269 --journal String
270 Record information in the systemd journal. This information is
271 in addition to information enabled by the lvm.conf log/journal
272 setting. command: record information about the command. out‐
273 put: record the default command output. debug: record full com‐
274 mand debugging.
275
276 --lockopt String
277 Used to pass options for special cases to lvmlockd. See lvm‐
278 lockd(8) for more information.
279
280 --longhelp
281 Display long help text.
282
283 --nohints
284 Do not use the hints file to locate devices for PVs. A command
285 may read more devices to find PVs when hints are not used. The
286 command will still perform standard hint file invalidation where
287 appropriate.
288
289 --nolocking
290 Disable locking. Use with caution, concurrent commands may pro‐
291 duce incorrect results.
292
293 --profile String
294 An alias for --commandprofile or --metadataprofile, depending on
295 the command.
296
297 -q|--quiet ...
298 Suppress output and log messages. Overrides --debug and --ver‐
299 bose. Repeat once to also suppress any prompts with answer
300 'no'.
301
302 -t|--test
303 Run in test mode. Commands will not update metadata. This is
304 implemented by disabling all metadata writing but nevertheless
305 returning success to the calling function. This may lead to un‐
306 usual error messages in multi-stage operations if a tool relies
307 on reading back metadata it believes has changed but hasn't.
308
309 --update
310 Update the content of the devices file.
311
312 -v|--verbose ...
313 Set verbose level. Repeat from 1 to 4 times to increase the de‐
314 tail of messages sent to stdout and stderr.
315
316 --version
317 Display version information.
318
319 -y|--yes
320 Do not prompt for confirmation interactively but always assume
321 the answer yes. Use with extreme caution. (For automatic no,
322 see -qq.)
323
325 String See the option description for information about the string con‐
326 tent.
327
328 Size[UNIT]
329 Size is an input number that accepts an optional unit. Input
330 units are always treated as base two values, regardless of capi‐
331 talization, e.g. 'k' and 'K' both refer to 1024. The default
332 input unit is specified by letter, followed by |UNIT. UNIT rep‐
333 resents other possible input units: b|B is bytes, s|S is sectors
334 of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB,
335 p|P is PiB, e|E is EiB. (This should not be confused with the
336 output control --units, where capital letters mean multiple of
337 1000.)
338
340 See lvm(8) for information about environment variables used by lvm.
341 For example, LVM_VG_NAME can generally be substituted for a required VG
342 parameter.
343
345 lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8),
346
347 pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8),
348 pvremove(8), pvresize(8), pvs(8), pvscan(8),
349
350 vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8),
351 vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8),
352 vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8),
353 vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8),
354
355 lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8),
356 lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8),
357
358 lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8),
359
360 dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), cmirrord(8),
361 lvmdbusd(8), fsadm(8),
362
363 lvmsystemid(7), lvmreport(7), lvmraid(7), lvmthin(7), lvmcache(7)
364
365
366
367Red Hat, Inc. LVM TOOLS 2.03.18(2)-git (2022-11-10) LVMDEVICES(8)