Unexpected running out of disk space on OS X
 
My powerbook has consistently been low on disk space. Moreover, when I created more space it seemed to disappear just as quickly, for no obvious reason. I discovered that the problem was a set of print files hidden out of site, which amounted to more than 7 GB of space.
Here is how I tracked this down. First I wanted to look at my disk usage, and for this I used the excellent (and free!) WhatSize utility (click on icon on the right). OmniDiskSweeper does something very similar, but you have to pay for it (although you can get a one-day license, and in any case it isn’t expensive). After a certain amount of work, these utilities tell you about all the files you have. You can then add up the core directories and see where you are losing space. Up to a point that is. The thing that stuck me was that in fact I still had some missing space. WhatSize and OmniDiskSweeper returned a usage that was around 7 GB lower than the disk summary.
A note somewhere made me realise that these utilities return information on directories and files that I have some rights to see. But what if there are system files I am prohibited from seeing. So the next task was to create a system administrator account (called ‘root’) using the NetInfo Manager utility. If you have never done this before, under the Security pull down menu you see the option to create the Root user. You must chose a good password (if you haven’t done this before, you need to be aware that an open root account is probably the worst security lapses your system can have). Once accomplished, log in as System Administrator using this new password. You can then run WhatSize or OmniDiskSweeper from this account, and you will see all the files accounted for.
What I discovered was a load of very large files in the directory /private/var/spool/cups/tmp. These mostly seemed to be postscript files, generated (I think) from mistaken attempts to print to the localprint printer queue.
The next task was to remove them. The simplest way was to use the terminal utility, whilst still logged in as System Adminstrator (also called root). I typed the commands
  1. cd /private/var/spool/cups/tmp
  2. ls -l
  3. rm 4*
Let me explain. The cd command takes me to the folder in question. ls lists the files in this folder, and the -l parameter lets me list the file sizes. In my case it turned out that all the files were named by a series of numbers, all beginning with 4, so rm 4* removed them all (you may need to do something else with the file name on your system; beware of not throwing away anything that looks more permanent).
Thus I recovered 7 GB of free disk space. The final action was to log out of the System Administrator account, and for good security reasons I went back to the NetInfo Manager utility and disabled the Root User account.
Tuesday, 10 October 2006