NTFS 分区上无法删除的目录

NTFS 分区上无法删除的目录

我正在尝试删除 Ubuntu 服务器上驱动器上由 Windows 创建的两个文件夹(该驱动器之前安装在 Windows 上,其内容现在只是垃圾)。

我已经尝试了所有能想到的方法,但返回的错误却大不相同:

  • chmod 777目录 ( No such file or directory)
  • rmsudo正确的选项是(Permission denied
  • find尝试通过(Directory not emptyPermission denied)按 inode 编号删除


层次结构:

  • /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)
    


这些是我尝试过的命令的输出(在根模式下):

  • 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
    


命令给出的结果类似/media/mattgeek/WpSystems、其子目录和文件。

答案1

由于所有权损坏,为了能够删除所述目录,必须将驱动器连接到 Windows 系统并通过这些目录的安全面板修复所有权。

为此,必须将文件夹的所有者分配给安装驱动器的计算机的管理员帐户。然后,您必须删除所有损坏的先前访问规则并将其替换为新规则。建议查看“审核”和“有效访问”选项卡。

您终于可以删除该文件夹了!

相关内容