1LVMDEVICES(8)               System Manager's Manual              LVMDEVICES(8)
2
3
4

NAME

6       lvmdevices — Manage the devices file
7

SYNOPSIS

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           --delnotfound
20           --delpvid String
21           --deviceidtype String
22           --devices PV
23           --devicesfile String
24           --driverloaded y|n
25        -h|--help
26           --journal String
27           --lockopt String
28           --longhelp
29           --nohints
30           --nolocking
31           --profile String
32        -q|--quiet
33        -t|--test
34           --update
35        -v|--verbose
36           --version
37        -y|--yes
38

DESCRIPTION

40       The  LVM devices file lists devices that lvm can use.  The default file
41       is /etc/lvm/devices/system.devices, and the  lvmdevices(8)  command  is
42       used  to  add or remove device entries.  If the file does not exist, or
43       if lvm.conf includes use_devicesfile=0, then lvm will not use a devices
44       file.
45
46       To  use  a device with lvm, add it to the devices file with the command
47       lvmdevices --adddev, and to prevent lvm from seeing or using a  device,
48       remove  it  from  the devices file with lvmdevices --deldev.  The vgim‐
49       portdevices(8) command adds all PVs from a VG to the devices file,  and
50       updates the VG metadata to include device IDs of the PVs.
51
52       Commands that add new devices to the devices file necessarily look out‐
53       side the existing devices file to find the devices being added.  pvcre‐
54       ate,  vgcreate, and vgextend also look outside the devices file to cre‐
55       ate new PVs and add those PVs to the devices file.
56
57       LVM records devices in the devices file  using  hardware-specific  IDs,
58       such  as  the WWID, and attempts to use subsystem-specific IDs for vir‐
59       tual device types (which also aim to be as unique and stable as  possi‐
60       ble.)  These  device  IDs are also written in the VG metadata.  When no
61       hardware or virtual ID is available, lvm falls back using the  unstable
62       device  name as the device ID.  When devnames are used as IDs, lvm per‐
63       forms extra scanning to find devices if their devname changes, e.g. af‐
64       ter reboot.
65
66       When  proper  device  IDs are used, an lvm command will not look at de‐
67       vices outside the devices file, but when devnames are used as  a  fall‐
68       back,  lvm  will scan devices outside the devices file to locate PVs on
69       renamed devices.  A config setting search_for_devnames can be  used  to
70       control the scanning for renamed devname entries.
71
72       Related  to  the  devices  file, the new command option --devices <dev‐
73       names> allows a list of devices to be specified for the command to use,
74       overriding  the  devices file.  The listed devices act as a sort of de‐
75       vices file in terms of limiting which devices lvm  will  see  and  use.
76       Devices  that  are not listed will appear to be missing to the lvm com‐
77       mand.
78
79       Multiple devices files can be kept /etc/lvm/devices, which  allows  lvm
80       to be used with different sets of devices.  For example, system devices
81       do not need to be exposed to a specific application, and  the  applica‐
82       tion can use lvm on its own devices that are not exposed to the system.
83       The option --devicesfile <filename> is used to select the devices  file
84       to  use  with  the command.  Without the option set, the default system
85       devices file is used.
86
87       Setting --devicesfile "" causes lvm to not use a devices file.
88
89       With no devices file, lvm will use any device on the  system,  and  ap‐
90       plies  the  filter to limit the full set of system devices.  With a de‐
91       vices file, the regex filter is not used, and the  filter  settings  in
92       lvm.conf  or the command line are ignored.  The vgimportdevices command
93       is one exception which does apply the regex filter when looking  for  a
94       VG to import.
95
96       If  a  devices  file  exists,  lvm will use it, even if it's empty.  An
97       empty devices file means lvm will see no devices.
98
99       If the system devices file does not yet exist, the pvcreate or vgcreate
100       commands  will  create  it  if  they see no existing VGs on the system.
101       lvmdevices --addev and vgimportdevices will always create a new devices
102       file if it does not yet exist.
103
104       It  is  recommended  to use lvm commands to make changes to the devices
105       file to ensure proper updates.
106
107       The device ID and device ID type are included in the  VG  metadata  and
108       can  be  reported  with  pvs  -o deviceid,deviceidtype.  (Note that the
109       lvmdevices command does not update VG metadata, but subsequent lvm com‐
110       mands modifying the metadata will include the device ID.)
111
112       Possible device ID types are:
113
114sys_wwid  uses  the wwid reported by sysfs.  This is the first choice
115         for non-virtual devices.
116
117sys_serial uses the serial number reported by  sysfs.   This  is  the
118         second choice for non-virtual devices.
119
120mpath_uuid is used for dm multipath devices, reported by sysfs.
121
122crypt_uuid is used for dm crypt devices, reported by sysfs.
123
124md_uuid is used for md devices, reported by sysfs.
125
126lvmlv_uuid is used if a PV is placed on top of an lvm LV, reported by
127         sysfs.
128
129loop_file is used for loop devices, the backing file name repored  by
130         sysfs.
131
132devname the device name is used if no other type applies.
133
134       The  default  choice  for device ID type can be overridden using lvmde‐
135       vices --addev --deviceidtype <type>.  If the specified type  is  avail‐
136       able for the device it will be used, otherwise the device will be added
137       using the type that would otherwise be chosen.
138

USAGE

140       Print devices in the devices file.
141
142       lvmdevices
143           [ COMMON_OPTIONS ]
144
145
146
147       Check the devices file and report incorrect values.
148
149       lvmdevices --check
150           [ COMMON_OPTIONS ]
151
152
153
154       Update the devices file to fix incorrect values.
155
156       lvmdevices --update
157           [    --delnotfound ]
158           [ COMMON_OPTIONS ]
159
160
161
162       Add a device to the devices file.
163
164       lvmdevices --adddev PV
165           [    --deviceidtype String ]
166           [ COMMON_OPTIONS ]
167
168
169
170       Remove a device from the devices file.
171
172       lvmdevices --deldev String|PV
173           [    --deviceidtype String ]
174           [ COMMON_OPTIONS ]
175
176
177
178       Find the device with the given PVID and add it to the devices file.
179
180       lvmdevices --addpvid String
181           [    --deviceidtype String ]
182           [ COMMON_OPTIONS ]
183
184
185
186       Remove the devices file entry for the given PVID.
187
188       lvmdevices --delpvid String
189           [ COMMON_OPTIONS ]
190
191
192
193       Common options for lvm:
194           [ -d|--debug ]
195           [ -h|--help ]
196           [ -q|--quiet ]
197           [ -t|--test ]
198           [ -v|--verbose ]
199           [ -y|--yes ]
200           [    --commandprofile String ]
201           [    --config String ]
202           [    --devices PV ]
203           [    --devicesfile String ]
204           [    --driverloaded y|n ]
205           [    --journal String ]
206           [    --lockopt String ]
207           [    --longhelp ]
208           [    --nohints ]
209           [    --nolocking ]
210           [    --profile String ]
211           [    --version ]
212

OPTIONS

214       --adddev PV
215              Add a device to the devices file.
216
217       --addpvid String
218              Find a device with the PVID and add the device  to  the  devices
219              file.
220
221       --check
222              Checks  the  content of the devices file.  Reports incorrect de‐
223              vice names or PVIDs for entries.
224
225       --commandprofile String
226              The command profile  to  use  for  command  configuration.   See
227              lvm.conf(5) for more information about profiles.
228
229       --config String
230              Config settings for the command. These override lvm.conf(5) set‐
231              tings.  The String arg uses the same format as  lvm.conf(5),  or
232              may use section/field syntax.  See lvm.conf(5) for more informa‐
233              tion about config.
234
235       -d|--debug ...
236              Set debug level. Repeat from 1 to 6 times to increase the detail
237              of messages sent to the log file and/or syslog (if configured).
238
239       --deldev String
240              Remove  a  device  from  the  devices  file.   When  used alone,
241              --deldev specifies a device name.  When  used  with  --deviceid‐
242              type, --deldev specifies a device id.
243
244       --delnotfound
245              Remove devices file entries with no matching device.
246
247       --delpvid String
248              Remove a device with the PVID from the devices file.
249
250       --deviceidtype String
251              The  type  of device ID to use for the device.  If the specified
252              type is available for the device, then it will override the  de‐
253              fault type that lvm would use.
254
255       --devices PV
256              Restricts  the  devices  that  are visible and accessible to the
257              command.  Devices not listed will appear to be missing. This op‐
258              tion  can  be repeated, or accepts a comma separated list of de‐
259              vices. This overrides the devices file.
260
261       --devicesfile String
262              A file listing devices that LVM should use.  The file must exist
263              in  /etc/lvm/devices/ and is managed with the lvmdevices(8) com‐
264              mand.  This overrides the  lvm.conf(5)  devices/devicesfile  and
265              devices/use_devicesfile settings.
266
267       --driverloaded y|n
268              If set to no, the command will not attempt to use device-mapper.
269              For testing and debugging.
270
271       -h|--help
272              Display help text.
273
274       --journal String
275              Record information in the systemd journal.  This information  is
276              in  addition  to information enabled by the lvm.conf log/journal
277              setting.  command: record information about the  command.   out‐
278              put: record the default command output.  debug: record full com‐
279              mand debugging.
280
281       --lockopt String
282              Used to pass options for special cases to  lvmlockd.   See  lvm‐
283              lockd(8) for more information.
284
285       --longhelp
286              Display long help text.
287
288       --nohints
289              Do  not  use the hints file to locate devices for PVs. A command
290              may read more devices to find PVs when hints are not  used.  The
291              command will still perform standard hint file invalidation where
292              appropriate.
293
294       --nolocking
295              Disable locking. Use with caution, concurrent commands may  pro‐
296              duce incorrect results.
297
298       --profile String
299              An alias for --commandprofile or --metadataprofile, depending on
300              the command.
301
302       -q|--quiet ...
303              Suppress output and log messages. Overrides --debug  and  --ver‐
304              bose.   Repeat  once  to  also  suppress any prompts with answer
305              'no'.
306
307       -t|--test
308              Run in test mode. Commands will not update  metadata.   This  is
309              implemented  by  disabling all metadata writing but nevertheless
310              returning success to the calling function. This may lead to  un‐
311              usual  error messages in multi-stage operations if a tool relies
312              on reading back metadata it believes has changed but hasn't.
313
314       --update
315              Update the content of the devices file.
316
317       -v|--verbose ...
318              Set verbose level. Repeat from 1 to 4 times to increase the  de‐
319              tail of messages sent to stdout and stderr.
320
321       --version
322              Display version information.
323
324       -y|--yes
325              Do  not  prompt for confirmation interactively but always assume
326              the answer yes. Use with extreme caution.   (For  automatic  no,
327              see -qq.)
328

VARIABLES

330       String See the option description for information about the string con‐
331              tent.
332
333       Size[UNIT]
334              Size is an input number that accepts an  optional  unit.   Input
335              units are always treated as base two values, regardless of capi‐
336              talization, e.g. 'k' and 'K' both refer to  1024.   The  default
337              input unit is specified by letter, followed by |UNIT.  UNIT rep‐
338              resents other possible input units: b|B is bytes, s|S is sectors
339              of  512  bytes,  k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB,
340              p|P is PiB, e|E is EiB.  (This should not be confused  with  the
341              output  control  --units, where capital letters mean multiple of
342              1000.)
343

ENVIRONMENT VARIABLES

345       See lvm(8) for information about environment  variables  used  by  lvm.
346       For example, LVM_VG_NAME can generally be substituted for a required VG
347       parameter.
348

SEE ALSO

350       lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8),
351
352       pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8),
353       pvremove(8), pvresize(8), pvs(8), pvscan(8),
354
355       vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8),
356       vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8),
357       vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8),
358       vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8),
359
360       lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8),
361       lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8),
362
363       lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8),
364
365       dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), cmirrord(8),
366       lvmdbusd(8), fsadm(8),
367
368       lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7),
369       lvmvdo(7), lvmautoactivation(7)
370
371
372
373
374Red Hat, Inc.          LVM TOOLS 2.03.22(2) (2023-08-02)         LVMDEVICES(8)
Impressum