ESXi

 View Only
  • 1.  Unable to delete file

    Posted Dec 23, 2013 07:37 PM

    I have a .vswp file from a long-dead View desktop that I am unable to delete through the datastore browser. All ESXi servers hosting View have been rebooted at least once. The View desktop that the vswp file belonged to does not exist any more. I am able to rename the file and/or move it to another directory but it refuses to let me delete it. When I try to delete it, I get the following error:

    "Cannot delete file [datastore] Bad_vswp/Old.vswp"

    Any ideas? I thought if there were a lock on it, it would not let me rename or move, but it does. I simply can't delete it.



  • 2.  RE: Unable to delete file

    Posted Dec 23, 2013 07:58 PM

    What if you do it via SSH, using rm -f?



  • 3.  RE: Unable to delete file

    Posted Dec 23, 2013 08:38 PM

    Via WinSCP I get:

    Command 'rm -f -r "Old.vswp"'

    failed with return code 1 and error message

    rm: cannot remove 'Old.vswp': No such file or directory.

    Via PuTTy I get:

    rm: cannot remove 'Old.vswp': No such file or directory



  • 4.  RE: Unable to delete file

    Posted Dec 23, 2013 08:39 PM

    Can you do an ls -allh via PuTTY in the datastore directory?



  • 5.  RE: Unable to delete file

    Posted Dec 23, 2013 08:44 PM

    Returns the following:

    /vmfs/volumes/VolGUID/Bad_vswp # ls -allh

    drwxr-xr-x    1 root     root          420 Dec 23 19:16 .

    drwxr-xr-t    1 root     root         5.1k Dec 23 19:16 ..

    -rw-------    1 root     root         2.0G May 31  2013 Old.vswp



  • 6.  RE: Unable to delete file

    Posted Dec 23, 2013 08:47 PM

    rm -rf Old.vswp should remove the file. Otherwise, I could help you via some kind of remote session, since further troubleshooting is needed.

    Hope this helps,



  • 7.  RE: Unable to delete file

    Posted Dec 23, 2013 08:52 PM

    rm -rf Old.vswp gives the same error: "rm: cannot remove 'Old.vswp': No such file or directory"

    Thanks for your assistance thus far. I am going to poke around a bit more and will get back with you after the beginning of the year as we will be out for a few days.



  • 8.  RE: Unable to delete file

    Posted Dec 24, 2013 08:38 AM

    Just a guess try it out...

    dd if=/dev/zero of=Old.vswp bs=1M count=2048 conv=notrunc

    After this try to delete it.

    -A



  • 9.  RE: Unable to delete file
    Best Answer

    Posted Jan 13, 2014 07:25 PM

    Got help on this from VMware. The solution is to do "rm -i <file>". For some reason the interactive prompt caused it to work.Here is the site he pointed me to:

    https://access.redhat.com/site/discussions/461023



  • 10.  RE: Unable to delete file

    Posted Dec 08, 2017 12:02 PM

    Just to bump this thread.

    I had a nightmare with metadata and datastore corruption warnings, vm's would not start, iso's would sometimes not mount, could not delete datastore, could not delete partitions.  It was on an HPE Proliant G9 server, flattened the RAID array and rebuilt it, re-installed ESXi (6.5) to the USB stick and the datastore was still there!  Performed a delete on the disks from the HP IP utility, reinstalled ESXi again and the datastore was still there!  Booted from a Linux live usb (gparted) and it showed no partitions (perhaps cannot see vmfs).

    So it would seem that rebuilding an array and deleting the disks on HPE servers does not get rid of the datastore.

    Anyway, I traced the issue to an iso and a vmdk that would not delete. Tried every method mentioned here to no avail.  What eventually worked was to move the files to a newly mounted NFS datastore.  The files actually remained on the original datastore but a rm 'file.ext' deleted them.