Folks:
This is a variant on the typical "my disk is full" problem.
An application goes nuts and is generates a 850 GB log file within a day or two, which completely fills the root partition. By the time I notice this, the box is having some issues due to lack of file space, but it's still up and running. Unfortunately, even though I delete the offending file using "rm filename.log", the disk space is not actually cleared. I'm pretty sure that the space is being orphaned -- the inode is still marked as in use, even though the file system as deleted all reference to the file.
The result is that bash, File Manager, etc., cannot find the file -- and it's not in the trash, or lost and found -- but the kernel thinks that the disc is still full. Compare:
Code:
root@box:/# find / -type f -size +10000000k -exec ls -lh {} \;
find: `/proc/10245/task/10245/fd/5': No such file or directory
find: `/proc/10245/task/10245/fdinfo/5': No such file or directory
find: `/proc/10245/fd/5': No such file or directory
find: `/proc/10245/fdinfo/5': No such file or directory
with . . .
Code:
root@box:/# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md0 912G 866G 0 100% /
tmpfs 1008M 0 1008M 0% /lib/init/rw
udev 1004M 180K 1004M 1% /dev
tmpfs 1008M 0 1008M 0% /dev/shm
On reboot, the disc is repaired. This snippet from the syslog pretty much sums it up:
Code:
Aug 21 12:24:52 faf kernel: [ 3.094316] EXT4-fs (md0): INFO: recovery required on readonly filesystem
Aug 21 12:24:52 faf kernel: [ 3.094325] EXT4-fs (md0): write access will be enabled during recovery
Aug 21 12:24:52 faf kernel: [ 9.335591] EXT4-fs (md0): orphan cleanup on readonly fs
Aug 21 12:24:52 faf kernel: [ 9.335622] EXT4-fs (md0): ext4_orphan_cleanup: deleting unreferenced inode 786856
Aug 21 12:24:52 faf kernel: [ 9.335699] EXT4-fs (md0): ext4_orphan_cleanup: deleting unreferenced inode 786688
Aug 21 12:24:52 faf kernel: [ 20.158834] EXT4-fs (md0): 2 orphan inodes deleted
Aug 21 12:24:52 faf kernel: [ 20.158845] EXT4-fs (md0): recovery complete
Aug 21 12:24:52 faf kernel: [ 22.791091] EXT4-fs (md0): mounted filesystem with ordered data mode
(This is a RAID 1 volume.)
What I'd like to know is whether there is any way to find and re-allocate these orphaned inodes on a running system, without a reboot?
Many thanks, in advance.
root@box:/# uname -a
Linux box 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux
Bookmarks