When I first installed Debian Lenny on this laptop in December 2008 — Lenny was the testing distribution back then — I partitioned the brand new computer's hard disk following some basic ideas I collected from elsewhere, including my own ideas and experience. I knew that I didn't want /home (non-Linux users: this is the directory where my user configuration, files and documents are) to reside in the same partition as things that are being continuously written to (/var, with the log files and other info managed by running services) or stuff that is constantly being read and executed (/usr, /bin, /sbin, /lib).
I know very well (well, basically) how hard disk drives work and that I'm most likely not protecting my files against hardware errors. However, this has still demonstrated to be a good protection against software errors — example here.
My scheme has some major drawbacks, though. Let's take a look at the state of things in “bluecore” (my current HP laptop):
| Filesystem | Mount point | Size | Used | Available | Usage % |
| /dev/sda1 | /win/vista | 28 GiB | 19 GiB | 9 GiB | 68% |
| /dev/sda2 | /boot | 177 MiB | 27 MiB | 141 MiB | 16% |
| /dev/sda3 | / | 12 GiB | 2.5 GiB | 8.1 GiB | 24% |
| /dev/sda5 | /usr | 61 GiB | 8.2 GiB | 52 GiB | 14% |
| /dev/sda6 | /home | 101 GiB | 93 GiB | 8.4 GiB | 92% |
| /dev/sda7 | /var | 12 GiB | 1.3 GiB | 9.9 GiB | 12% |
| /dev/sda8 | /opt | 921 MiB | 269 MiB | 653 MiB | 30% |
| /dev/sda9 | /tmp | 8.3 GiB | 411 MiB | 7.9 GiB | 5% |
| /dev/sda10 | swapon device | 3.81 GiB | N/A | N/A | N/A |
| /dev/sda11 | /usr/local | 4.8 GiB | 1.7 GiB | 3.1 GiB | 36% |
| Total: | 233 GiB | | | |
Table 1. Filesystems in “bluecore”
The most evident problem sources here are /dev/sda6, which is large and has very little free space, and /dev/sda5, which is about 63% of sda6 and yet has plenty (86%) of unused space. Why is this? I made a mistake during installation and assumed that I was going to have lots of heavy software from Debian installed on the machine. More specifically, I believed that KDE 3.5.9/10 and later 4.x (I was anticipating the switch to Squeeze) required lots of space and it turned out not to be the case.

Vista, /boot and the swapon partitions are out of the matter.
In other words, /usr is a huge waste of free space.
The other immediately noticeable problem is /var (/dev/sda7), which I expected to become larger with time as the apt cache filled up. Apparently there's some mechanism at work here that makes sure old packages don't stay on the disk for too long — this caused me some trouble (understatement) when I had to revert to an older pm-utils version around a month ago because the version in Squeeze to which I upgraded had broken suspend-to-RAM on my machine (it got better...until I realized that a kernel bug is chasing me since a while). Finally, the logs are rotated and compressed so they never take too much space in /var.
But what's wrong with /opt? It was intended for a few binary and/or proprietary third-party software packages that I expected to install — namely, the Mingw32 cross-compiling environment, Adobe (Acrobat!) Reader, CrossOver Office and Maple. At the moment, I only really have Adobe Reader, CrossOver Office and Google Chrome (of all things...) in /opt, plus some symbolic links to directories in /usr/local for Maple 9 and Maple 12 (don't ask), which turned out to be too large for this file system. I ended up installing a set Mingw32 cross-compiling environment packages from Debian instead of setting up one using archives from elsewhere. I have installed other third-party packages to my /home dir out of sheer laziness — this includes Microsoft Office, Eclipse, Google Earth and, for a while, Mozilla Seamonkey 1.1.x.
This makes /opt rather useless and it could have been a symbolic link to a directory in the same partition as /usr/local for all I care. And talking about /usr/local, this one seems to be the only “good” partition at the moment, in terms of usage. This is, after all, where all my locally-compiled crap goes if I ever installed it, which may eventually be the case for Wesnoth (large package!) if I ever need to test some install hook for some odd reason. Then again, this partition has Maplesoft's packages installed on it, plus a statically-linked backup copy of Busybox, and some other software.
The swap partition tends to be useless for anything but suspend-to-disk (Tux On Ice!) because system performance is unbearable once real RAM runs out and programs get swapped to disk. I haven't run into any situation where its capacity is not sufficient for suspending, but it's important to consider that a Tux On Ice suspend image can easily be 100% of RAM in size (this is, 1.7 GiB), unlike native hibernation images which are usually smaller since they don't include disk caches and such.
The actual rootfs (/dev/sda3) is also a blatant waste of space, but this one makes sense in situations where I may need to use it as a temporary storage for files in case of an “emergency”.
The ideal solution now would be shrinking /usr (a lot) and /var (just a tiny bit) to give all that wasted space back to /home where I can put it to good use for more source code distributions, CD/DVD and HDD images of operating systems I'm researching, and Wesnoth content — which, for the record, can take up a lot of space. Consider the following SCons build tree:
shadowm@bluecore:~/src/wesnoth$ du -ch --max-depth 1 build
952K build/sconf_temp
84M build/release
1.4G build/debug
1.4G build
1.4G total
shadowm@bluecore:~/src/wesnoth$ du -sh wesnoth-debug
369M wesnoth-debug
shadowm@bluecore:~/src/wesnoth$
That's 1.4 GiB worth of C++ object files and one big fucking executable with debug symbols.
It seems paranoid to have separate partitions for everything, and maybe the aforementioned file system crash isn't enough of a proof, but I did lose most of my files on openSUSE 10.0 once because of a software error (and later on openSUSE 10.3 on the same desktop box due to one hardware error in a long list of HDD accidents).
While shrinking and expanding partitions with FOSS tools is possible and I've successfully done it three times in the past with Ext3 and NTFS filesystems, I've both grown distrustful of disk partitioning tools and lost my faith in my ability to work with them after an unfortunate accident involving renumbering partitions (long story). It's not something I'm going to try right now while my backup possibilities are close to nil due to various factors out of my control, including money. However, it'd be nice if I can learn from these mistakes and allocate more space to /home than /usr in the future.
The question remains: why am I wasting 28 GiB at the start of the hard disk if I never actually use Windows Vista?!
Not very long ago, I posted an entry regarding some arguably bad installation decisions when I partitioned bluecore’s hard disk for installing Debian. Some weeks ago, I finally decided to risk it all and fix those problems, with the guarantee that if I sc