0
$ 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"

Why can't I remove the PV from the VG?

Thanks.

  • 1
    It's already been told, it's the last PV of the VG. If you don't want the whole LVM system anymore, why bother these steps? You removed all the LV, so I guess you don't want any data anymore, so why bother? – 炸鱼薯条德里克 Feb 24 at 2:17
  • (1) "If you don't want the whole LVM system anymore, why bother these steps?" What do you suggest to do instead? (2) "You removed all the LV, so I guess you don't want any data anymore". When I remove a LV by lvremove, does it also remove all the data on the LV? – Tim Feb 24 at 2:23
  • (2)Data is not something floating on the disk, it's part of the status of your disk. When we say a byte with value x is on the offset 0xbbbb on the disk, it means we get a information about the status of the disk -- the byte at offset 0xbbbb is of value x. If you don't want the data, means you don't care about any status at any offset. – 炸鱼薯条德里克 Feb 24 at 2:30
  • (1) based on what you have done, simply remove the VG. Then reboot, do anything you want with sda2. – 炸鱼薯条德里克 Feb 24 at 2:33
  • So, after removing LV, you wiped(or changed) some metadata which was used to indicate which PEs ate used as LV. Now you lost them, so although data in the LV is not wiped, you can't find it using normal methods anymore. – 炸鱼薯条德里克 Feb 24 at 3:26
1

As already mentioned in comments this is the last PV in VG so you can't remove is because this will destroy VG and LVM software will have no place to store meta info of VG. From this point your operation is a bit nonsense. It will make sense only in other LVM systems/software.

The right action in your case is to destroy the VG:

vgremove lubuntu-vg

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.