I think something generated millions of files or folders in my /tmp on Ubuntu 18.04, as I'm unable to run ls /tmp
or even rm -rf /tmp/*
. So I tried rebooting, but now my machine's stuck at the step:
A start job is running for Create Volatile Files and Directories
I let it run for 10 hours, and it's still going, so it's likely swapping to disk and will never complete. What do I do? How do I clear my /tmp folder if I can't even boot the system?
Edit: I appended "systemd.debug-shell=1 systemd.show_status=false" so I could get to a shell. Then I killed the systemd-tmpfiles
process and then ran mkdir /empty; time rsync -a --delete /empty/ /tmp/
to do a fast delete as suggested here. However, after 30 minutes, it's still running.
You can boot in single user mode, move the tmp folder, create a new clean one, set the permissions and reboot. Then you can do whatever needs to be done with the old tmp.
in the single user session do:
and reboot.