Can't remove open logical volume

Solution 1:

What does the logical volume contain? Is it a filesystem (I accidentally wrote partition)? Could it be it's mounted? In that case:

umount /dev/my-volumes/volume-1

Does it have any active snapshots?

Edit: try lvchange -an -v /dev/my-volumes/volume-1 and lvremove -vf /dev/my-volumes/volume-1.

Edit 2: please post 'lvs'.

Edit 3: Try this with some other problematic volume. It's not the cleanest option but according to this site it may work, and it's less problematic than rebooting anyway.

dmsetup remove my--volumes-volume--number
lvremove /dev/my-volumes/volume-number

Solution 2:

If you are unable to unmount or lvremove a logical volume, verify that there are no processes holding the LV

Locate the major/minor numbers for the logical volume you’re trying to remove eg:vol0

# dmsetup info -c | grep vol0

Take note of the 5th column, which indicates if a volume is “open,” and the 2nd and 3rd columns, which are the major and minor IDs, respectively.

Find any process attached to this volume by searching on the major and minor IDs discovered above:

# lsof | grep "major,minor"

Shut down or kill any process still accessing the volume to continue unmounting and removal.

then try lvremove