I stupidly created a reasonably deep tree (4 folders deep) with the leaf folders containing a large amount of smallish files (over 1 million files around 200kb to 1mb in size). In total the count would be over 80 GB of files. This was created in the /tmp/ directory of a Ubuntu Server 14.04 box running inside Hetzner (relevant to come up with way to connect to it possibly).

From memory running a "find . | wc -l" took over 12 hours to run.

I then needed to reboot the server. This is not normally an issue as it has been rebooted multiple times over the last few weeks without issue. No config changes have taken place nor additional software installed.

In this case however it is not coming back online. I can ping the box but I cannot ssh or connect to any port I would expect to come back online.

I suspect the issue is that the script that mounts and clears tmp on boot /etc/init/mounted-tmp.conf is struggling to clear the files, causing the box to be stuck in the init boot phase.

I don't suppose there is any way to speed this process up? I know if I could disable the tmp clean somehow I could use the rsync trick to clean the folders but I have no idea how to even do this.

  • If this is the problem you can' speed it up. Do you have console access ? Are there any messages there ? – Iain Oct 2 '15 at 5:54
  • The speed is a problem. I would like to have it back up ASAP. No messages. However I am not even sure if that is the problem at this point. I suspect it may be but not 100% sure. – Ben Boyter Oct 2 '15 at 5:58

Found a solution.

Booted the machine using a rescue system as offered by hetzer http://wiki.hetzner.de/index.php/Hetzner_Rescue-System/en

Then mounted the filesystem and used the tips from here https://unix.stackexchange.com/questions/37329/efficiently-delete-large-directory-containing-thousands-of-files on how to delete the files in a more efficient manner.

Rebooted and now all is fine.


I see you answered your own question, but here's my 2 cents.

What about this booting into single user mode? Do you have access to grub? On boot, edit the boot parameters to include the "single" option, then boot straight to a root command prompt. From there you can clean up your files.

  • Did not have the ability to do that through the tools they provided. That would work well on a home system though I would think. – Ben Boyter Oct 12 '15 at 23:28

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.