I have a small fileserver running busybox (very small linux distro with most essential stuff on it) and I am trying to remove some unused directories on it.
The drive I am trying to remove this folder from is /mnt_sdb1. There is still plenty of space left there, so I am at a loss here what the cause could be. I can still copy files to the drive as well, so I believe it cannot be an inode-problem as well.
When trying to remove the folder by referring to its inode number:
-bash-3.2# find . -inum 7888609 -exec rm -r -i {} \;
rm: descend into directory './test'? y
rm: remove directory './test'? y
rm: cannot remove './test': No space left on device
So what could be the cause and how can I remove obsolete folder or files from the filesystem?
Something is not Kosher here. /tmp is often not a physical device in Linux, it is the equivalent of a RAMDISK, or a filesystem in memory not on a disk. It is interesting that your problem filesystem seems to be mounted there.
Let's clarify:
As root - what is the exact output of this command?
I have been able to solve the problem. I checked the drive with fsck and it seemed that a superblock of the drive was broken. Fsck needed a few hours to fix things, and now everything is working again.
So basically the Filesystem was all messed up, which caused not being able to delete stuff.
Thanks for your help people. This topic can be closed now.
I read this thread a couple days ago and took a look at the busybox code. Before I could post, something more pressing came up and I forgot about it.
Only three paths in the Busybox rm implementation lead to a "cannot remove" message, and the gateway to each is a system call which should not return ENOSPC: lstat, rmdir, and unlink.
Now that you've gone and fixed the issue, we'll never know where the system's error handling went off the rails. Damn you.
By the way, Busybox isn't a Linux distro. It's just a single binary executable. If in the future you have another issue, please be more specific. At the very least, identify the distro, kernel, and busybox versions.