Deleting problem files from VMFS data stores

Following up from my issues yesterday, I had a bunch of files (old, bad snapshot deltas) that I needed to delete. Problem was, I couldn’t:

/vmfs/volumes/datastore/vm/badsnapshots # rm -rf *
rm: cannot remove 'foghorn-000101-ctk.vmdk': Invalid argument
rm: cannot remove 'foghorn-000101-delta.vmdk': Invalid argument

Try as I might, I couldn’t get rid of them. Via lsof I couldn’t see that the files weren’t locked; indeed, I was able to move them, just not delete them. So I cheated, by echoing a character to the file (to verify its sanity and update it’s mtime):

echo "a" > *

Then, rm worked. Victory!

Advertisements

6 thoughts on “Deleting problem files from VMFS data stores

  1. Hi bitpushr,
    I am also facng the same issue, can please explain in detail how to echo a character to the file (to verify its sanity and update it’s mtime). can please send the step by step process to delte this -ctk.vmdk file.

    Reply
  2. I face this issue often and use “Long Path Tool” to solve this problem. Its a handy tool and proved very helpful for most of my friends too.

    Reply
  3. I’ve been looking for a fix for this problem for 2 weeks. I finally stumbled across this post and it worked like a charm! Thank you!

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s