我不能将空目录移除为用户根目录。我查过拿撒特了。这个目录是由btrfs文件系统上的opensuse15上的kiwi映像生成器创建的。
#pwd
/tmp/myimage/build/image-root/var/lib
#whoami
root
#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
#lsattr
------------------- ./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: -
发布于 2020-04-19 18:22:42
用这个答案解决:如何删除空目录(btrfs文件系统)?
我能够使用以下命令删除我的目录:
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'
https://unix.stackexchange.com/questions/581153
复制相似问题