Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
    • Remove PV from VG
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid
#
# Create test LV
#
for i in {1..3}; do
    truncate -s 1G disk${i}.img
    losetup /dev/loop${i} disk${i}.img
    pvcreate /dev/loop${i}
done

pvs

vgcreate vg0 /dev/loop1 /dev/loop2 /dev/loop3

vgs

lvcreate -n lv0 -l 100%FREE vg0

lvs

mkfs.ext4 /dev/vg0/lv0

mount /dev/vg0/lv0 /mnt/

df -h /mnt/

for i in {1..15}; do
    dd if=/dev/urandom of=/mnt/file${i} bs=1M count=100
done

md5sum /mnt/file? > /mnt/file.md5

(cd /mnt && md5sum -c file.md5)


#
# Reduce LV and remove PV from VG
#
umount /mnt/

#e2fsck -f -v -C 0 /dev/vg0/lv0
e2fsck -f /dev/vg0/lv0

resize2fs /dev/vg0/lv0 1800M

lvreduce -L 1900M /dev/vg0/lv0
vgs

vgreduce vg0 /dev/loop3

vgs
pvs

pvremove /dev/loop3
pvs



#
# Check filesystem
#
mount /dev/vg0/lv0 /mnt/
(cd /mnt && md5sum -c file.md5)
umount /mnt/

# Links
https://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/VG_remove_PV.html
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/logical_volume_manager_administration/vg_remove_pv
Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung