神秘不可删除目录

神秘不可删除目录

该目录不会删除。

gentooserver ~ # rmdir /ceph
rmdir: failed to remove '/ceph': Operation not permitted

我是根。

gentooserver ~ # whoami
root

该目录归 root 所有,我有权写入该目录。

gentooserver ~ # ls -la /ceph
total 16
drwxrwx--x 1 root root   0 Jan 11  2018 .
drwxr-xr-x 1 root root 176 Sep 28 16:51 ..

目录上没有设置属性。

gentooserver ~ # lsattr -d /ceph
------------------ /ceph

没有进程正在使用该目录。

gentooserver ~ # fuser /ceph

那里没有安装任何东西。

gentooserver ~ # umount /ceph
umount: /ceph: not mounted.

SELinux 已禁用。挂载命令:

gentooserver ~ # mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
none on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=2039250,mode=755)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
/dev/sda3 on / type btrfs (rw,relatime,lazytime,compress=lzo,ssd,discard,space_cache,subvolid=5,subvol=/)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=1717)
mqueue on /dev/mqueue type mqueue (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
/dev/sda2 on /boot type vfat (rw,relatime,lazytime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sdf on /mnt/store type btrfs (rw,noatime,space_cache,autodefrag,subvolid=5,subvol=/)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1632152k,mode=700,uid=1000,gid=1000)

答案1

该目录是 btrfs 子卷。 Linux 内核 4.18 之前的版本(具体来说,提交a79a464),这些只能通过 删除btrfs subvol del /ceph,而不能通过rmdir.看https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-subvolume更多细节。

相关内容