$ sudo pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 lubuntu-vg lvm2 a-- <465.26g 0
$ sudo vgs
VG #PV #LV #SN Attr VSize VFree
lubuntu-vg 1 3 0 wz--n- <465.26g 0
$ sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home lubuntu-vg -wi-a----- <413.26g
root lubuntu-vg -wi-a----- 48.00g
swap lubuntu-vg -wi-a----- 4.00g
$ sudo lvremove lubuntu-vg/home
Do you really want to remove and DISCARD active logical volume lubuntu-vg/home? [y/n]: y
Logical volume "home" successfully removed
$ sudo lvremove lubuntu-vg/root
Do you really want to remove and DISCARD active logical volume lubuntu-vg/root? [y/n]: y
Logical volume "root" successfully removed
$ sudo lvremove lubuntu-vg/swap
Do you really want to remove and DISCARD active logical volume lubuntu-vg/swap? [y/n]: y
Logical volume "swap" successfully removed
$ sudo vgreduce lubuntu-vg /dev/sda2
Can't remove final physical volume "/dev/sda2" from volume group "lubuntu-vg"
为什么我无法从 VG 中删除 PV?
谢谢。
答案1
正如评论中已经提到的,这是 VG 中的最后一个 PV,因此您无法删除,因为这会破坏 VG,并且 LVM 软件将没有地方存储 VG 的元信息。从这一点来说你的操作就有点无稽之谈了。它仅在其他 LVM 系统/软件中才有意义。
根据您的情况,正确的操作是销毁 VG:
vgremove lubuntu-vg