We help IT Professionals succeed at work.

rm: cannot remove "filename" device or resource busy

usts-pw asked
Medium Priority
Last Modified: 2013-12-16
I am trying to delete files at the command line on my esx server and I keep getting the error:

rm: cannot remove /vmfs/volumes/filename.vmdk: Device or resource busy
Watch Question

I'm thinking that you need to stop the VM that is using that file in order to delete it.  It is being used by at least one of your VM's.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Please check for 2 things,

1.The VM whose file you are trying to delete should not be suspended and
2.The VM should be shutdown so that the lock file is removed on the VMDKs which then enables the VM and its files to be deleted.
nociSoftware Engineer
Distinguished Expert 2019

In general lockfiles have little to do with the actual file, they are more a flag so other software knowns that there another process interested in the set of files. Many lockfiles contain a PID of the owning process.
So it certainly won't block deleting a file, it does indicate that there might be a process around that does keep the file open.


I am soooo glad that I didn't do this.  I didn't realize that I would have toasted everything had I done it.  Thanks for the suggestion!


Thanks all for participating.   Sorry it took so long to respond.  I am busier than ever and I didn't remember that I hadn't remembered to complete this!  Age sucks sometimes~


Thanks to all who participated.  Sorry I took so long to complete this.  I am very busy and forgot to complete this.  Thanks again!!


Thanks for the help.  Ya know, I can't even close this!!  This is my third try and the screen jumps back to this.  Hope this doesn't show up as my third reply!!  I will hit submit one more time.....


Ha.....Ha....LOL.....what a dope!  I see the entries above!  And I have no way to delete them!!  I should go home!!

you can use the following:

1.   fuser -km /vmfs/volumes/filename.vmdk
2.   rm -rf  /vmfs/volumes/filename.vmdk

npglobal: Thank you very much!

Worked like a charm :)

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.