After an incorrect udev rule was applied, the device-mapper nodes and the /dev/myvg/* symbolic links for several active logical volumes disappeared. The udev rule has been fixed and the block devices are visible again. You must rescan every disk for volume groups and recreate any missing LVM special files in /dev without stopping the volumes. Which single command accomplishes this task?
The vgscan utility searches every block device for physical volumes and volume groups. When it is combined with the --mknodes option, vgscan also verifies that each active logical volume has the correct device-mapper node and symbolic link under /dev, creating any that are missing and removing stale entries. Because both the rescan and node-recreation are done in one command, vgscan --mknodes resolves the problem without deactivating the volumes.
vgmknodes only checks and recreates device nodes; it does not scan disks for new or changed volume groups.
pvscan --cache updates the LVM metadata daemon (lvmetad) with physical-volume information but neither rebuilds /dev nodes nor directly discovers volume groups.
vgchange -ay activates logical volumes that are already known; it does not rescan hardware or regenerate device nodes.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the vgscan command in LVM?
Open an interactive chat with Bash
What is the difference between --mknodes and vgmknodes?
Open an interactive chat with Bash
Why doesn't pvscan --cache address the issue in the question?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access