Disk partition (mis)management

25 Jul 2007 in windows |

For many, many years I had the C drive partitioned to 10GB. For many years, this was plenty of space. The last time I installed my Windows, I did it again - the difference being that 10GB is not so much anymore. In other words, I am notoriously running out of space on my C drive.

One example is Google Earth. By default it stores its .5 GB cache in your user profile / application data. For this application you can edit the registry to move the cache. Picasa, on the other hand, also caches a number of things in roughly the same place - the difference being that this location is hard-coded.

While there is the possibility to shrink/grow your hard drives, this is not for the faint-hearted. Additionally, it can take quite a while to move the data such that the hard disk can be repartitioned.

Another way to resolve pressing issues as the one described is to use a feature that has been part of the NTFS (since Windows 2000) but which is hardly exposed through OS-owned tools. Much like the UNIX/linux guys are completely used to set up symbolic links that mount some hard-drive folder in some other location, we can also do that in Windows.

The command line utility that can be used is Junction (ex-sysinternals, now part of Microsoft). It allows to set up a symbolic link such that a folder looks as if it is on a different location on the disk. This should not be confused with shortcuts - symbolic links will appear as normal folders in an explorer window, although their actual location may be quite different.

While you should definitely follow some scheme (because chaos might ensue), I could now shift a number of heavyweight folders from c: to a different drive with more space. I then set up a symbolic link that ‘mounts’ the shifted folder to the old location. For applications accessing the data all still looks the same, but the actual bytes reside somewhere else. Brill.

If junction would start from a startup disk, a nice homework would be to move the complete ‘Document and Settings’ branch to a place of your liking.

A word of caution

  • I have read that deleting the symbolic link in your Explorer window will in fact delete the data! Careful there. Use the junction tool again to undo a symbolic link
  • When I moved my wife’s “documents and settings” folder, the access rights were modified, which wreaked havoc since I am an Administrator and she is ‘just’ a user (if somebody messes up, it better be me). On Windows XP Home you cannot easily modify access rights of folders. Apparently, you can do so in safe mode, but if you are not afraid of the command line you can use ‘cacls’ in order to perform necessary access right changes.

Chronology

  |  
comments powered by Disqus