vCenter

 View Only
  • 1.  Unable to delete file on Data Store

    Posted Mar 02, 2019 04:58 PM

    VMware ESXI 6.5

    I just migrated all my VM's from internal data stores to NAS NFS datastores all went well.

    Now I went thru all the local data stores and I found folders of some of the VMS's I moved still lingering.

    I had six of 60 VM's

    I was able to verify non of the files are required and deleted the files and folder and they are all clear except for one file I can not delete

    This VM is up and running and the new location has a vmdk  and this server only has one disk drive assigned.

    File locked maybe?

    Any ideas?

    Thank you

    Tom



  • 2.  RE: Unable to delete file on Data Store

    Posted Mar 03, 2019 08:27 PM

    Hi,

    Did you try to access via SSH from an ESXi host and delete the file from it?

    You should be able to see who is locking that file and hence, you can't delete it.



  • 3.  RE: Unable to delete file on Data Store

    Posted Mar 03, 2019 08:36 PM

    No do not use ssh option that often.

    What is the command line I need to use ?



  • 4.  RE: Unable to delete file on Data Store

    Posted Mar 04, 2019 02:06 AM

    He means manually deleted as my perspective ( rm -rf ). If VMs vmdk is on another datastore, it will be Ok.

    Enter ssh. Then /vmfs/volumes then you need to enter your datastore where it was exist.

    Cheers.



  • 5.  RE: Unable to delete file on Data Store

    Posted Mar 04, 2019 02:18 AM

    How about using powercl?



  • 6.  RE: Unable to delete file on Data Store

    Posted Mar 04, 2019 05:10 AM

    Guys

    I enabled SSH on the Host.

    SSH'd into the host using ROOT account and password.

    [root@TGCSESXI-4:~] /vmfs/volumes

    -sh: /vmfs/volumes: Permission denied



  • 7.  RE: Unable to delete file on Data Store

    Posted Mar 04, 2019 02:55 PM

    I had to use cd\vmfs  now I can see the datastores   the rm -rf did not remove the file either    see below.

    [root@TGCSESXI-4:/vmfs/volumes] cd Datastore-SSD-480

    [root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5] ls

    [root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5] cd TGCS003-2

    012R2

    [root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R                                                                                                              2] ls

    TGCS003-2012R2-000001.vmdk~  TGCS003-2012R2-000001.vmdk~

    [root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R                                                                                                              2] rm -rf

    [root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R                                                                                                              2] ls

    TGCS003-2012R2-000001.vmdk~  TGCS003-2012R2-000001.vmdk~

    [root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R 2] ls -ltr

    total 0

    -rw-------    1 root     root           420 Jan 11 02:02 TGCS003-2012R2-000001.v                                                                                                              mdk~

    -rw-------    1 root     root           420 Jan 11 02:02 TGCS003-2012R2-000001.v                                                                                                              mdk~

    [root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R2] rm -rf

    [root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R2] ls

    TGCS003-2012R2-000001.vmdk~  TGCS003-2012R2-000001.vmdk~

    [root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R2]

    Any ideas on why I ca not delete this file

    Thank you



  • 8.  RE: Unable to delete file on Data Store
    Best Answer

    Broadcom Employee
    Posted Mar 04, 2019 03:18 PM

    I don't see any arguments when you call rm -rf, so the command doesn't know what to delete.

    Invoke it with a parameters, eg. something like:

      rm -rf *

    the above will delete everything in the current folder.



  • 9.  RE: Unable to delete file on Data Store

    Posted Mar 04, 2019 03:40 PM

    Thanks adding the * deleted the files

    Stange how you could not delete the same file using the GUI



  • 10.  RE: Unable to delete file on Data Store

    Posted Mar 04, 2019 12:04 AM

    Also

    How do I find this using powercli?