VGIMPORTDEVICES(8)
β¨ NAME β¨
vgimportdevices β bestie, this is the one that adds devices for a VG to the devices file π (and yeah, it's section 8 of the System Manager's Manual, we're in the big-leagues admin pages now π)
π¦ SYNOPSIS π¦
vgimportdevices option_args position_args
[ option_args ]
-a|--all
--auto
--commandprofile String
--config String
-d|--debug ...
--devices PV
--devicesfile String
--driverloaded y|n
--foreign
-h|--help
--journal String
--lockopt String
--longhelp
--nohints
--nolocking
--profile String
-q|--quiet ...
--reportformat basic|json|json_std
--rootvg
-S|--select String
-t|--test
-v|--verbose ...
--version
-y|--yes
That's the whole flag menu upfront, no gatekeeping here π
π« DESCRIPTION π«
Okay so vgimportdevices takes the PVs from a VG and adds them to the devices file. It's basically the same energy as running lvmdevices --adddev on every single PV one by one, except you're doing it in one go like a main character β¨
It also updates the VG metadata so it includes the device IDs of each PV. And if there's no devices file at all yet? It creates a new one. Iconic, honestly.
π«Ά Big important lore: when a devices file is in use, the regex filter is ignored β except in the case of vgimportdevices, which will apply the regex filter when it's looking for the VGs to import to the devices file. So that's the lil exception, iykyk.
And if you want literally every VG on the system in the devices file, hit it with vgimportdevices -a. No cap π
π USAGE π
Add devices from specific VGs to the devices file.
vgimportdevices VG|Tag|Select ...
[ -S|--select String ]
[ --foreign ]
[ COMMON_OPTIONS ]
β
Add devices from all accessible VGs to the devices file.
vgimportdevices -a|--all
[ --foreign ]
[ COMMON_OPTIONS ]
β
Add devices from root VG to the devices file.
vgimportdevices --rootvg
[ --auto ]
[ COMMON_OPTIONS ]
β
Common options for command:
[ --reportformat basic|json|json_std ]
Common options for lvm:
[ -d|--debug ... ][ -h|--help ][ -q|--quiet ... ][ -t|--test ][ -v|--verbose ... ][ -y|--yes ][ --commandprofile String ][ --config String ][ --devices PV ][ --devicesfile String ][ --driverloaded y|n ][ --journal String ][ --lockopt String ][ --longhelp ][ --nohints ][ --nolocking ][ --profile String ][ --version ]
β¨ OPTIONS β¨
-a,--allβ the "do it for all of them" flag πΈ (no blurb of its own in the source, but you can see exactly how it's used up in USAGE)--autoβ this one's for when devices are being automatically imported for the root VG. The auto import is meant to happen once, on first boot, to create an initialsystem.devicesfile for the root VG. When you use this option, thevgimportdevices --rootvgcommand does nothing ifsystem.devicesexists, or if the fileauto-import-rootvgdoes not exist β both of those live in the/etc/lvm/devices/directory π--commandprofile Stringβ the command profile to use for command config. Peeplvm.conf(5)for more info about profiles π--config Stringβ config settings for the command, and these override whatlvm.conf(5)says. The String arg uses the exact same format aslvm.conf(5), or you can use thesection/fieldsyntax. More deets inlvm.conf(5)β¨-d,--debug ...β sets the debug level. Repeat it from 1 to 6 times to crank up the detail of messages sent to the log file and/or syslog (if configured). Go off π--devices PVβ restricts which devices are visible and accessible to the command. Devices that aren't listed will look like they're just... missing π You can repeat this option, or hand it a comma-separated list of devices. This overrides the devices file, jsyk.--devicesfile Stringβ a file that lists the devices LVM should use. It has to exist in/etc/lvm/devices/and it's managed with thelvmdevices(8)command. This overrides thelvm.conf(5)settingsdevices/devicesfileanddevices/use_devicesfileπ--driverloaded y|nβ if you set it to no, the command won't even attempt to use device-mapper. It's a testing-and-debugging thing π§--foreignβ report/display foreign VGs that would otherwise be skipped. Seelvmsystemid(7)for more about foreign VGs π¦-h,--helpβ display help text. The bare minimum and we love her for it π--journal Stringβ record info in the systemd journal. This is in addition to whatever thelvm.conflog/journalsetting already enables. Your choices:commandrecords information about the command;outputrecords the default command output;debugrecords full command debugging π--lockopt Stringβ used to pass options for special cases over tolvmlockd. Seelvmlockd(8)for more π--longhelpβ display long help text, i.e. the extended director's cut π--nohintsβ don't use the hints file to locate devices for PVs. Heads up: without hints, a command may read more devices to find PVs. It'll still do the standard hint file invalidation where that's appropriate, so no chaos πΈ--nolockingβ disable locking. Use with caution, bestie β concurrent commands may produce incorrect results π--profile Stringβ an alias for--commandprofileor--metadataprofile, depending on the command π-q,--quiet ...β suppress output and log messages. It overrides--debugand--verbose. Repeat it once and it'll also suppress any prompts with the answer 'no' π€«--reportformat basic|json|json_stdβ overrides the current output format for reports, which is otherwise set globally by thereport/output_formatsetting inlvm.conf(5).basicis the original format with columns and rows β if there's more than one report per command, each report gets prefixed with the report name so you can tell them apart.jsongives you report output in JSON format.json_stdgives you report output in JSON format that's more compliant with the JSON standard. Seelvmreport(7)for more β--rootvgβ import devices used for the root VG π«Ά-S,--select Stringβ select objects for processing and reporting based on specified criteria. The criteria syntax is described by--select helpandlvmreport(7). For reporting commands, one row is displayed for each object matching the criteria. See--options helpfor selectable object fields. Rows can be displayed with an additional"selected"field (-o selected) showing1if the row matches the selection and0otherwise. For non-reporting commands that process LVM entities, the selection is used to choose the items to process π―-t,--testβ run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but still returning success to the calling function, and that may lead to unusual error messages in multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't π-v,--verbose ...β set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr π£οΈ--versionβ display version information π-y,--yesβ don't prompt for confirmation interactively, just always assume the answer is yes. Use with extreme caution. (For automatic no, see-qq.) π¨
πΈ VARIABLES πΈ
VGβ Volume Group name. Seelvm(8)for valid names.Tagβ Tag name. Seelvm(8)for info about tag names and using tags in place of a VG, LV or PV.Selectβ Select indicates that a required positional parameter can be omitted if the--selectoption is used. No arg appears in this position.Stringβ see the option description for info about the string content.Size[UNIT]β Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization β e.g.'k'and'K'both refer to1024. The default input unit is specified by letter, followed by|UNIT.UNITrepresents other possible input units:b|Bis bytes,s|Sis sectors of 512 bytes,k|Kis KiB,m|Mis MiB,g|Gis GiB,t|Tis TiB,p|Pis PiB,e|Eis EiB. (Don't confuse this with the output control--units, where capital letters mean a multiple of1000.) π’
π ENVIRONMENT VARIABLES π
See lvm(8) for info about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter π«Ά
π SEE ALSO π
lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8),
pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8), pvremove(8), pvresize(8), pvs(8), pvscan(8),
vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8), vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8), vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8),
lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8), lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8),
lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8),
dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), lvmdbusd(8), fsadm(8),
lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7)
okay that's the whole page, you read all of it, I'm so proud of you π₯Ήπ and for the credits: this one's brought to you by Red Hat, Inc., running LVM TOOLS 2.03.44(2), dated 2026-10-27. slay, go import those devices bestie π β¨
π¦ where this page comes from
- arch rolling: lvm2 2.03.44-1 Β· GPL-2.0-only AND LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms