vgimport
Make inactive volume groups accessible
SYNOPSIS
vgimport [-a|--all] [-d|--debug] [-h|--help] [-v|--verbose] VG_NAME...
PARAMETERS
VG_NAME...
The name(s) of the Volume Group(s) to be imported. Multiple VG names can be specified.
-a, --all
Import all exported Volume Groups found by scanning the system's physical volumes.
-d, --debug
Enable verbose debugging messages during the import process, useful for troubleshooting.
-h, --help
Display a brief help message and exit, showing command usage and options.
-v, --verbose
Enable verbose messages, providing more detailed output about the import operation.
DESCRIPTION
The vgimport command is used to make an LVM (Logical Volume Manager) Volume Group (VG) known to the current system. This operation involves reading the LVM metadata from the physical volumes (PVs) that constitute the specified VG and adding it to the system's LVM cache. It is a critical command for various scenarios, including recovering a VG whose metadata might have been lost or corrupted, re-adding a VG that was previously exported using vgexport for migration purposes, or making a VG from a different system accessible.
While vgimport makes the VG visible to the LVM daemon, it does not automatically activate its logical volumes (LVs). After importing, it's typically necessary to activate the LVs using commands like vgchange -a y VG_NAME or lvchange -a y VG_NAME/LV_NAME to make them accessible for mounting or other operations. It is essential that all physical volumes belonging to the VG are present and accessible by the system for a successful import operation.
CAVEATS
vgimport only makes the Volume Group known to the system; it does not automatically activate its Logical Volumes. Manual activation using vgchange -a y or lvchange -a y is usually required afterward.
All physical volumes (PVs) belonging to the Volume Group must be present and accessible by the system for the import to succeed.
Ensure that the VG name is unique on the system if importing a VG from another system to avoid potential naming conflicts.
TYPICAL USAGE SCENARIOS
vgimport is commonly used in several key scenarios:
1. Migrating VGs: After exporting a VG from one system using vgexport, it can be imported to another system.
2. System Recovery: If LVM metadata on the system's cache or configuration files becomes corrupted or is accidentally deleted, vgimport can rebuild the VG's knowledge from the metadata on the physical volumes.
3. Adding Pre-existing VGs: When connecting disks containing LVM VGs from another system, vgimport makes them recognized and usable by the new system.
HISTORY
The vgimport command is an integral part of the LVM2 (Logical Volume Manager version 2) suite, which represents a significant evolution in Linux's storage management capabilities. Its development, alongside other LVM commands, aimed at providing robust, flexible, and portable methods for managing disk partitions.
The concept of importing and exporting Volume Groups was introduced to facilitate the migration of storage between systems or to manage shared storage arrays, enhancing the portability of LVM configurations. Its usage is fundamental in disaster recovery scenarios and system migrations, ensuring that LVM metadata, which resides on the physical volumes themselves, can be re-integrated into a system's active LVM configuration reliably. It has been a stable component of LVM2 since its inception, continually refined to ensure metadata consistency and system stability.