Attempt to remove LVM storage device after migration of SolusVM KVM virtual machines fails: Logical volume is used by another device.

Have more questions? Submit a request

Applicable to:

  • SolusVM


Attempt to remove manually LVM storage device for KVM VPS on the source server after successful migration fails:

CONFIG_TEXT: lvremove /dev/oldservervg/kvm101_img
Logical volume oldservervg/kvm101_img is used by another device.


Partition mapping is not removed for the device completely


  1. Access the node via SSH
  2. Remove the partition mapping for the VPS LVM on the server:

    # kpartx -d /dev/oldservervg/kvm101_img

  3. Check the partition mapping on the server using the below command.

    # dmsetup info -c | grep kvm101
    oldserver962-kvm101_img 253 65 L--w 0 1 0 LVM-ASQ03eu39rsFa1GbQUJzmUfSoGPH91j4vRXZTbOhtw4lI4iprNPZDlAeMcZdaVhW

  4. Find the major,minor number in ‘lsof’ command output.

    # lsof | grep "major,minor"

    For Example:

    # lsof
    bckup 102585 0 19r BLK 253,65 0v12160 163622 /dev/dm-65 (deleted)

  5. Stop the application corresponding to the PID or kill the process. The PID as per above example is 102585. You could stop the application using that PID or kill the PID directly using kill command:

    # kill -9 [PID]

  6. Remove the dm-65 with dmsetup

    # dmsetup remove /dev/dm-65

  7. Remove the VPS HDD on the server using the lvremove command on the server.

    # lvremove /dev/vg_server962/kvm460_img
    Do you really want to remove active logical volume kvm460_img? [y/n]: y
    Logical volume "kvm460_img" successfully removed

Articles in this section

Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.