Technology Tales

Adventures & experiences in contemporary technology

The peril of /tmp

19th July 2008

By default, I think that Windows plants its temporary files in c:\windows\temp. In Linux or in Ubuntu at least, the equivalent area is /tmp. However,  not realising that /tmp when you shut down and start your PC could cause the silly blunder that I made today. I was doing a spot of reorganisation on my spare PC when I dumped some files in /tmp from a hard drive that I had added. I was reformatting the drive as ext3 following its NTFS former life. As part of this, I was editing fstab to automount the thing and a system restart ensued. I ended up losing whatever I put into /tmp, a very silly blunder. Luckily, I had the good sense not to put anything critical in there so nothing of consequence has been lost. Nevertheless, a lesson has been learnt: Windows allows its temporary area to pick up all kinds of clutter until you clear it while Linux clears the thing regularly. It’s amazing how Windows thinking can cause a howler when you have a lapse of concentration using a *NIX operating system, even for someone who uses the latter every day.

Comment:

  • Fitzcarraldo says:

    I’m not sure of the file to edit in the case of Ubuntu, which you’re using, but for Gentoo it is possible to specify whether or not /tmp/ is emptied automatically by assigning the environment variable WIPE_TMP in the file /etc/conf.d/bootmisc. I made WIPE_TMP=”yes” so that the /tmp/ directory is cleared on each boot, otherwise the contents of this directory can build up over time as with Windows.

  • All the views that you find expressed on here in postings and articles are mine alone and not those of any organisation with which I have any association, through work or otherwise. As regards editorial policy, whatever appears here is entirely of my own choice and not that of any other person or organisation.

  • Please note that everything you find here is copyrighted material. The content may be available to read without charge and without advertising but it is not to be reproduced without attribution. As it happens, a number of the images are sourced from stock libraries like iStockPhoto so they certainly are not for abstraction.

  • With regards to any comments left on the site, I expect them to be civil in tone of voice and reserve the right to reject any that are either inappropriate or irrelevant. Comment review is subject to automated processing as well as manual inspection but whatever is said is the sole responsibility of the individual contributor.