3

I'm trying to delete two folders on a drive on an Ubuntu server which were created by Windows (drive previously mounted on Windows and their content is just garbage now).

I've tried everything I can think of, with the errors returned being very different:

  • chmod 777 the directories (No such file or directory)
  • rm with sudo and correct options (Permission denied)
  • Tried to delete by inode number via find (Directory not empty or Permission denied)


Hierarchy structure:

  • /media/mattgeek/programmi/WindowsApps/
    - SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/
      - Apps/
          (Unknown content not visible with ls -al)
      - AppxMetadata/
          CodeIntegrity.cat
      - Assets/
          (Unknown content not visible with ls -al)
        chrome_elf.dll
      - locales/
          (Unknown content not visible with ls -al)
      - swiftshader/
          libEGL.dll
          libDLESv2.dll
    
  • /media/mattgeek/programmi/WpSystems/S-1-5-21-2951927762-82725512-1342253419-1001/
    - AppData/
      - Local/
        - Packages/
          - SpotifyAB.SpotifyMusic_zpdnekdrzrea0/
            - Settings/
              (contains an inaccessible file with unknown inode and unknown permissions)
    


These are the outputs of the commands I've tried (in root mode):

  • rm -f /media/mattgek/programmi/WindowsApps
    

    rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/chrome_elf.dll': No such file or directory rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/Apps': Directory not empty rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/AppxMetadata/CodeIntegrity.cat': Permission denied rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/Assets': Directory not empty rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/locales': Directory not empty rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/swiftshader/libEGL.dll': Permission denied rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/swiftshader/libGLESv2.dll': Permission denied

  • rm -rvf /media/mattgek/programmi/WindowsApps
    

    rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/Apps': Directory not empty rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/AppxMetadata/CodeIntegrity.cat': Permission denied rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/Assets': Directory not empty rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/locales': Directory not empty rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/swiftshader/libEGL.dll': Permission denied rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/swiftshader/libGLESv2.dll': Permission denied

  • rm --recursive -f /media/mattgek/programmi/WindowsApps
    

    rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/Apps': Directory not empty rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/AppxMetadata/CodeIntegrity.cat': Permission denied rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/Assets': Directory not empty rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/locales': Directory not empty rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/swiftshader/libEGL.dll': Permission denied rm: cannot remove '/media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/swiftshader/libGLESv2.dll': Permission denied

  • # Directory inode number: 479380
    find . -inum 479380 -delete
    

    find: cannot delete './media/mattgeek/programmi/WindowsApps': Directory not empty

  • # Directory inode number: 479380
    find . -inum 479380 -exec rm -rf {} \;
    

    rm: cannot remove './media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/Apps': Directory not empty rm: cannot remove './media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/AppxMetadata/CodeIntegrity.cat': Permission denied rm: cannot remove './media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/Assets': Directory not empty rm: cannot remove './media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/locales': Directory not empty rm: cannot remove './media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/swiftshader/libEGL.dll': Permission denied rm: cannot remove './media/mattgeek/programmi/WindowsApps/SpotifyAB.SpotifyMusic_1.112.449.0_x86__zpdnekdrzrea0/swiftshader/libGLESv2.dll': Permission denied


Commands give similar results for /media/mattgeek/WpSystems, its subdirectories, and files.

  • rm -rvf /media/mattgek/programmi/WpSystem
    

    Output Log

MattGeek
  • 131

1 Answers1

0

Due to corrupted ownership, to be able to delete the stated directories, it's necessary to attach the drive to a Windows system and fix ownership via the security panel of those directories.

To do so the owner of the folder must be assigned to the administrator account of the computer on which the drive is mounted. Then you must delete all the previous access rules that are corrupted and replace them with new ones. It is suggested to have a look to Auditing and Effective Access tabs.

You can finally delete the folder!

MattGeek
  • 131