LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

lvmdevices

manages the LVM devices file that controls which block devices LVM can

TLDR

Show which devices LVM is currently allowed to use
$ sudo lvmdevices
copy
Authorize a disk so LVM will scan it
$ sudo lvmdevices --adddev [/dev/sdb1]
copy
Revoke a disk
$ sudo lvmdevices --deldev [/dev/sdb1]
copy
Record a physical volume by its PVID, which survives renaming
$ sudo lvmdevices --addpvid [PVID]
copy
Drop a physical volume by PVID
$ sudo lvmdevices --delpvid [PVID]
copy
Repair stale entries after disks were renamed or replaced
$ sudo lvmdevices --update
copy
Prune entries whose devices are no longer present
$ sudo lvmdevices --update --delnotfound
copy
Report inconsistencies without changing anything
$ sudo lvmdevices --check
copy
Work on a named devices file instead of the default
$ sudo lvmdevices --devicesfile [vg_backup] --check
copy

SYNOPSIS

lvmdevices [options]

DESCRIPTION

lvmdevices manages the LVM devices file that controls which block devices LVM can use as physical volumes. Located at /etc/lvm/devices/system.devices, this file restricts LVM to scanning only listed devices, improving performance and preventing accidental use of unintended disks.When devices are added or removed, or when device names change (e.g., after hardware changes), lvmdevices can update the devices file accordingly. The --check option validates that listed devices exist and are accessible.The devices file uses stable device identifiers (WWID, serial numbers) rather than potentially changing paths like /dev/sdX, ensuring consistent behavior across reboots.

PARAMETERS

--adddev _device_

Add a device to the LVM devices file by path
--deldev _device_
Remove a device from the devices file by path
--addpvid _PVID_
Add a physical volume by its unique PVID
--delpvid _PVID_
Remove a physical volume by its PVID
--update
Update the devices file to reflect changed device names
--check
Verify the devices file and report problems
--version
Display version information

INSTALL

sudo dnf install lvm2
copy
sudo pacman -S lvm2
copy
sudo apk add lvm2
copy
sudo zypper install lvm2
copy
nix profile install nixpkgs#lvm2
copy

CAVEATS

Requires root privileges. If the devices file is enabled but a device isn't listed, LVM will ignore that device even if it contains valid PV metadata. Use --update after hardware changes to ensure device paths are current.

SEE ALSO

lvm(8), lvmconfig(8), pvcreate(8), pvs(8), vgchange(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid