Thursday, March 12, 2015

pvremove/pcreate fails with "Can't open exclusively - not removing. Mounted filesystem?"

 I had this problem:
root@erd:~# pvremove -ff /dev/sdb1
Really WIPE LABELS from physical volume "/dev/sdb1" of volume group "wsp" [y/n]? y
  WARNING: Wiping physical volume label from /dev/sdb1 of volume group "wsp"
  Can't open /dev/sdb1 exclusively - not removing. Mounted filesystem?

Try this:
root@my_machine:~# pvscan
  PV /dev/sdb1   VG my_volume   lvm2 [362.55 GiB / 148.36 GiB free]
  Total: 1 [362.55 GiB] / in use: 1 [362.55 GiB] / in no VG: 0 [0   ]

root@my_machine:~# lvremove my_volume

Now pvremove should work

  • Book reviews