I cannot remove an empty directory as user root. I checked lsattr. This directory was created by the kiwi-ng image builder on opensuse15 on a btrfs filesystem.

#ls -l
total 0
drwx------ 1 root root 0 Apr 19 02:00 machines
#rmdir machines
rmdir: failed to remove 'machines': Operation not permitted
#rm -rf machines/
rm: cannot remove 'machines/': Operation not permitted
------------------- ./machines
#df -h .
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        57G  3.5G   52G   7% /tmp
#btrfs filesystem show
Label: none  uuid: 57deb065-dd4d-4dea-b139-d7f0dff27eb9
        Total devices 1 FS bytes used 3.31GiB
        devid    1 size 56.37GiB used 9.02GiB path /dev/sda2

#stat machines
  File: machines
  Size: 0               Blocks: 0          IO Block: 4096   directory
Device: 39h/57d Inode: 256         Links: 1
Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-04-19 13:16:36.108001140 -0400
Modify: 2020-04-19 02:00:28.431710719 -0400
Change: 2020-04-19 13:12:54.397531588 -0400
 Birth: -

1 Answer 1


Solved with this answer: How to remove an empty directory (btrfs filesystem)?

I was able to delete my directory using these commands:

linux-9xyc:/tmp/myimage # rm -rf *
rm: cannot remove 'build/image-root/var/lib/machines': Operation not permitted
linux-9xyc:/tmp/myimage # btrfs subvolume delete build/image-root/var/lib/machines
Delete subvolume (no-commit): '/tmp/myimage/build/image-root/var/lib/machines'

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.