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 initial system.devices file for the root VG. When you use this option, the vgimportdevices --rootvg command does nothing if system.devices exists, or if the file auto-import-rootvg does not exist β€” both of those live in the /etc/lvm/devices/ directory πŸ‘€
  • --commandprofile String β€” the command profile to use for command config. Peep lvm.conf(5) for more info about profiles πŸŽ€
  • --config String β€” config settings for the command, and these override what lvm.conf(5) says. The String arg uses the exact same format as lvm.conf(5), or you can use the section/field syntax. More deets in lvm.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 the lvmdevices(8) command. This overrides the lvm.conf(5) settings devices/devicesfile and devices/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. See lvmsystemid(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 the lvm.conf log/journal setting already enables. Your choices: command records information about the command; output records the default command output; debug records full command debugging πŸ““
  • --lockopt String β€” used to pass options for special cases over to lvmlockd. See lvmlockd(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 --commandprofile or --metadataprofile, depending on the command πŸŽ€
  • -q, --quiet ... β€” suppress output and log messages. It overrides --debug and --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 the report/output_format setting in lvm.conf(5). basic is 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. json gives you report output in JSON format. json_std gives you report output in JSON format that's more compliant with the JSON standard. See lvmreport(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 help and lvmreport(7). For reporting commands, one row is displayed for each object matching the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. 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. See lvm(8) for valid names.
  • Tag β€” Tag name. See lvm(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 --select option 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 to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (Don't confuse this with the output control --units, where capital letters mean a multiple of 1000.) πŸ”’

🌈 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