0

I try to delete a file that is left in a directory, but even an ls -i will not give me an inode to remove it. Deleting/removing the directory won't work even with the inode.

$ ls -ila
ls: cannot access 'Mieterh'$'\3.webarchive': No such file or directory
total 0
1477265 drwxr-xr-x 1 99 99 3 Feb 18 08:49  .
1477260 drwxr-xr-x 1 99 99 3 Feb  2  2023  ..
      ? -????????? ? ?  ?  ?            ? 'Mieterh

This is an external drive mounted using a USB connection.

filesystem: HFS+ 
OpSys: Ubuntu 22.04.03
Size: 5TB
Space left: about 1 TB
Vendor: Toshiba

thanks in advance for any help/advice.

Probably it's the easiest to delete the directory with the including "garbage"... but how?

4
  • I removed the screenshot of text that you added. Please, don't post images of text. Commented Feb 21, 2024 at 14:45
  • 2
    There's no such thing as deleting a file through an inode number, all the relevant system calls only accept filenames. If the filename is found in a listing, but can't be accessed, then the filesystem is broken one way or the other. At least from the point of view of the OS on that system. HFS+ seems it might hint at a Mac, so maybe the drive and FS will work better on one instead. Commented Feb 21, 2024 at 16:23
  • 1
    fsck_hfs is probably worth a try, but this directory entry may be of a type not understood by Ubuntu. Commented Feb 22, 2024 at 6:52
  • This file does have an inode, it's just ls cannot access it (it has an invalid name), thus it cannot read the inode number. To me the filesystem just looks corrupted. Please run fsck. Commented Feb 22, 2024 at 8:40

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.