I have jumped into this strange problem when I tried to remove a logical volume.

Things would have been easy if I had used lsof command

The logical volume was named /dev/lvols/ubuntu64

At first


$lvremove /dev/lvols/ubuntu64

This command couldn’t remove the logical volume the next command I tried was


root@manager-desktop:~# dmsetup remove --force /dev/lvols/ubuntu64
device-mapper: remove ioctl failed: Device or resource busy
Command failed

So some process is using this logical volume and to find the process id the next command was


root@manager-desktop:~# lsof /dev/lvols/ubuntu64
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
vblade  31213 root    3u   BLK  252,4      0t0 115749 /dev/lvols/../mapper/lvols-ubuntu64


root@manager-desktop:~# kill -9 31213

Now issued the commands


root@manager-desktop:~# dmsetup remove --force /dev/lvols/ubuntu64

root@manager-desktop:~# lvremove /dev/lvols/ubuntu64
 Logical volume "ubuntu64" successfully removed

Voila.. simple fix and point to remember is never forget lsof command :)

VN:F [1.9.6_1107]
Rating: 6.3/10 (23 votes cast)
VN:F [1.9.6_1107]
Rating: +4 (from 4 votes)
device-mapper: remove ioctl failed: Device or resource busy, 6.3 out of 10 based on 23 ratings
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Live
  • StumbleUpon
  • Twitter
  • Yahoo! Buzz
  • Reddit
  • Technorati