0

My /tmp directory got corrupted. Things got scary for a while and I was unable to boot :-(. I have now got myself back to a working system by renaming the corrupt /tmp to /tmp.old, and creating a new /tmp:

drwxrwxrwt   6 root root       4096 Nov 29 13:44 tmp
drwxrwxrwt   4 root root 1013628928 Nov 29 13:49 tmp.old

I forced an fsck at reboot, and I expected that might fix things. It seemed to go ok, but if I attempt to look at or remove /tmp.old, ls or rm commands just hang and don't return any thing. How do I get rid of /tmp.old and make sure there are no other problems?

2

The solution to this turned out to be a little different to what I was expecting. After I asked this question my /tmp directory "corrupted" two more times.

I finally figured out that actually it wasn't corrupt at all. It was just full of an enormous number of files (symlinks actually). So full in fact that ls would hang for a considerable time (over a minute) whilst it was processing the index before it would start doing anything. My system wouldn't boot because part of the start up process is to clear out /tmp, and it was getting stuck at this point. I never got the rm command to return at all even after waiting for a very long period of time. After doing some online research I eventually came across this command:

cd /tmp
sudo find . ! -path . -delete

This seemed to work faster and only took an hour or so!!

That sorted out the /tmp directory. The reason it was filling up was to do with printing. If I attempted to print something then that triggered the problem (although this wasn't immediately obvious as it took a while for /tmp to fill up). However looking at the symlinks that were being created, I noticed that they were all pointing at a ppd file for my printer. I deleted and reinstalled my printer using the hp-setup program (it's an HP printer) - but that didn't solve the problem. However deleting and manually setting up the printer without using hp-setup did. Not sure if this is a problem with hp-setup, my printer driver or cups...but it now works.

0

Live boot into Ubuntu and remove it

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.