Ubuntu: How to get rid of more than one million ghostfiles?


I periodically run Bleachbit 1.0 on my Lubuntu machine (kernel 3.13.0-35-generic). Last time, I checked the option to wipe free disk space, mainly to try it. The program got stuck on a message saying it would be done in about one minute. I killed it after several hours, but I am afraid my Linux system is messed up. First, I found a new folder containing several hundred thousand files in my home directory (can't remember its name: it looked like a random alphanumeric sequence). I was able to remove it using "rm -rf ", it took almost one hour. The problem is that, when I checked my inodes with "df -i", I got a huge amount for IUsed:

    Filesystem        Inodes   IUsed     IFree IUse% Mounted on      /dev/sda6        2899968 1725783   1174185   60% /      none              220155       2    220153    1% /sys/fs/cgroup      udev              215362     514    214848    1% /dev      tmpfs             220155     521    219634    1% /run      none              220155       3    220152    1% /run/lock      none              220155       1    220154    1% /run/shm      none              220155      16    220139    1% /run/user  

Almost two million inodes? The whole of my filesystem uses some 10 GBytes. I browsed the web and tried to see whether a large amount of little files had been created somewhere.

    ae:/ $≻sudo find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -n      [sudo] password for ae:       15 tmp      88 opt      129 sbin      132 bin      287 boot      1180 etc      3449 home      5519 lib      8101 var      96802 usr      1558827 root  

This is weird. In addition to the listed directories I just have two links in my root dir: to initrd.img and to vmlinuz. Nothing in lost+found:

    sudo ls -l lost+found/       [sudo] password for ae:       total 0  

On the other hand, both ls and "find . -iname \*" don't see any of the million and a half files reported above.

I am very much afraid that my filesystem is in trouble. I created a file forcefsck in my root dir and rebooted, but fsck says the disk is ok. So... have I to shred the partition and recover it from a Clonezilla backup? I'd prefer to find out what the problem exactly is and fix it. I'd be grateful if you can help. I have a suggestion too. I can't be sure that my problem is caused by Bleachbit but I read (too late) that several people complained about Bleachbit getting stuck while attempting to wipe free space. Bleachbit might warn users that the wiping feature is experimental and possibly harmful.


If you want to remove all those mini files, I might suggest running these two commands:

cd /      rm -r 6jF8vak8\ H  

(if "/6jF8vak8 H" is the directory hosting all those files like you mention in the comment.)

If this command fails, it might be because you lack permission to write to that directory, in which case you would need to use sudo - which is potentially dangerous in the root directory.

Use extreme caution and double-check your spacing. In fact, I would recommend typing in the terminal "rm -r 6jF" (or whatever the first few characters are) and hitting tab, which should auto-complete the directory. If it doesn't auto-complete (and you are in the root directory), don't run the command. Using this method will ensure that you don't accidentally run rm -r on the root directory itself.

Other warnings:

  • I have no idea what effect removing those files will have on bleachbit.
  • Running this command on a million files will probably take a significant amount of time.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »