6

Transcript:

$ ls -al
total 0
drwxrwxrwx 1 root root 8 Jun 14 05:13 .
drwxrwxrwx 1 root root 6 Jun 14 04:57 ..
drwxrwxrwx 1 root root 0 Jun 12 00:29 DARN
$ ls -al DARN/
total 0
drwxrwxrwx 1 root root 0 Jun 12 00:29 .
drwxrwxrwx 1 root root 8 Jun 14 05:13 ..
$ sudo lsof | grep DARN
$ sudo rmdir DARN
rmdir: failed to remove 'DARN': Operation not permitted

I can rename the directory, I can even move it outside of its parent. Reboot didn't help either.

This is Arch Linux 4.0.5-1-ARCH (current).

Update: Dan suggested extended attributes:

$ sudo lsattr .
---------------- ./DARN
$ sudo lsattr DARN/
$ 

I guess that means there aren't any?

  • 1
    Use chattr/lsattr to check for things like immutable flag – Dan Jun 14 '15 at 6:58
  • 2
    Two questions: on which filesystem is DARN located (ext4, fat32,...), and can you post the output of ls -id * issued in DARN's parent directory. – MariusMatutiae Jun 14 '15 at 8:37
  • @MariusMatutiae: 1) btrfs. 2) 256 DARN – Johannes Ernst Jun 15 '15 at 17:23
  • Pls read my answer and let me know. – MariusMatutiae Jun 15 '15 at 17:36
6

From the BTRFS FAQ:

if you get:

rmdir: failed to remove ‘emptydir’: Operation not permitted

then this is probably because "emptydir" is actually a subvolume. You can check whether this is the case with:

 # btrfs subvolume list -a /mountpoint

To delete the subvolume you'll have to run:

 # btrfs subvolume delete emptydir

This is apparently a well-known problem, with a well-defined solution. If this works, I would also run

  btrfs check --repair /dev/sdXY

just in case.

If all else fails, run

     lsof +D /path/to/DARN

from outside DARN, and see whether anything is actually accessing the directory so fast that you cannot see it.

| improve this answer | |
  • You got it! Must be that systemd-nspawn turned this into a subvolume when I was playing around with it. – Johannes Ernst Jun 15 '15 at 18:03

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.