4

I have a file system mounted btrfs. I have one directory in particular, that I can't remove, because it's listed as non-empty. In that directory, there's one file, which I can see the name of, but no other information.
Here's the output of ls:

bminton:/var/spool/exim4/input# ls --escape -la
ls: cannot access '1eumbt-0001A6-KQ-J': No such file or directory
total 0
drwxr-x--- 1 Debian-exim Debian-exim 36 Jul  2 14:41 .
drwxr-x--- 1 Debian-exim Debian-exim 88 Jun 10 05:32 ..
-????????? ? ?           ?            ?            ? 1eumbt-0001A6-KQ-J

I tried rm, cp, mv, stat, unlink, etc on the file, including trying find . -print0 | xargs -0 rm -v just in case it was a strange filename. However, everything gives the same error, no such file or directory. (using strace on the unlink process for example, I see the unlink system call returns ENOENT).

I ran btrfs scrub start ., which ran, and waited until btrfs scrub status . showed it as finished, with 0 errors. Is there any way to manually remove the directory entry?

  • Assuming the directory you want to delete is /var/spool/exim4/input, try a forced delete on the directory: rm -f /var/spool/exim4/input – Emmanuel Rosa Jul 4 '18 at 20:46
  • I tried that too, @EmmanuelRosa. bminton:/var/spool/exim4# rm -rf input rm: cannot remove 'input': Directory not empty – Brian Minton Jul 6 '18 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.