lvremove fails with "can't remove open logical volume" on Red Hat Enterprise Linux 5

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux 5
  • A third party software "Backup Exec" running "beremote" daemon

Issue

  • Sometimes the lvremove fails with 'Can't remove open logical volume "VolumeName"'

    # lvremove /dev/VG0/LV4 
      Can't remove open logical volume "LV4" 
    
  • The 'mount' command shows it is unmounted

  • The 'lsof' command shows no files open from the snapshot mount point
  • The 'dmsetup info -c' command shows the LV is still opened.

Resolution

Stop the beremote process.

Root Cause

  • The Backup exec daemon (beremote) was holding the snapshots opened leading lvremove to fail.

Diagnostic Steps

  1. check the major and the minor for the volume.

    # dmsetup_info_-c | grep LV4
    VG0-LV4 252   4 L--w    1    1      0 LVM-oLlI7fxWpX5fIx8M2mNFCQVyMsAoSmgHPvdQfEY39C95xWHtVcaEQ9nlcucj0Rtl
    
  2. check which process is referencing the device.

    # lsof | grep 253,3
    beremote   2308        0   10r      BLK              252,4             8880186 /tmp/filexVRTwQ(deleted)
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.