LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

vgreduce

Remove physical volumes from volume groups

TLDR

Remove physical volume from volume group
$ sudo vgreduce [vg_name] [/dev/sdb]
copy
Remove all empty physical volumes
$ sudo vgreduce -a [vg_name]
copy
Remove missing physical volumes
$ sudo vgreduce --removemissing [vg_name]
copy
Force remove missing PVs with partial LVs
$ sudo vgreduce --removemissing --force [vg_name]
copy
Test removal without making changes
$ sudo vgreduce -t [vg_name] [/dev/sdb]
copy

SYNOPSIS

vgreduce [options] volumegroup [physicalvolume...]

DESCRIPTION

vgreduce removes physical volumes from a volume group, reducing its capacity. The removed physical volumes can then be used in other volume groups or removed from the system entirely.Before removal, ensure the physical volume contains no data by checking with pvdisplay. If data exists, use pvmove to migrate it to other physical volumes first. After vgreduce, use pvremove to clean LVM metadata from the disk.The --removemissing option handles failed disks that are no longer present. Combined with --force, it removes any logical volumes that had data on the missing disk.

PARAMETERS

-a, --all

Remove all empty physical volumes.
--removemissing
Remove missing (failed) physical volumes.
--mirrorsonly
Only remove missing PVs from mirror LVs.
-f, --force
Force removal, removing partial LVs if needed.
-t, --test
Test mode; don't make changes.
-v, --verbose
Verbose output.
-y, --yes
Answer yes to prompts.

INSTALL

sudo apt install lvm2
copy
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

Cannot remove PV with active data without pvmove. Force removal destroys data on affected LVs. Test mode recommended before force operations. Removed PVs need pvremove for reuse.

HISTORY

vgreduce is part of LVM2 (Logical Volume Manager), which evolved from the original LVM in Linux 2.4. LVM2 provides flexible disk management allowing dynamic resizing of storage. The vgreduce command enables non-destructive removal of storage from volume groups.

SEE ALSO

vgextend(8), vgdisplay(8), pvmove(8), pvremove(8), lvm(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