• Skip to site navigation
  • Skip to content
  • Skip to sidebar
  • Skip to footer
  • Go to archive page
Shadowmaster’s Lair
  • Home
  • Projects
  • Articles
  • About
  • Contact
  • Blog
‹ Previous | Blog index | Next ›

The problem with partitioning

Monday, April 5, 2010

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):

FilesystemMount pointSizeUsedAvailableUsage %
/dev/sda1/win/vista28 GiB19 GiB9 GiB68%
/dev/sda2/boot177 MiB27 MiB141 MiB16%
/dev/sda3/12 GiB2.5 GiB8.1 GiB24%
/dev/sda5/usr61 GiB8.2 GiB52 GiB14%
/dev/sda6/home101 GiB93 GiB8.4 GiB92%
/dev/sda7/var12 GiB1.3 GiB9.9 GiB12%
/dev/sda8/opt921 MiB269 MiB653 MiB30%
/dev/sda9/tmp8.3 GiB411 MiB7.9 GiB5%
/dev/sda10swapon device3.81 GiBN/AN/AN/A
/dev/sda11/usr/local4.8 GiB1.7 GiB3.1 GiB36%
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.

Graph displaying size and usage of the most relevant partitions from Table 1
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?!

Posted in Hardware, Miscellaneous, Software at 13:32 UTC | No comments
Trackbacks
Trackback URI
Tracked on 2010-09-04 06:29
From Shadowmaster’s Blog:
The problem with partitioning: Part II
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
Comments
Linear | Threaded
No comments
Add Comment
All fields are optional. Your email address won't be publicly displayed.
Standard emoticons like :-) and ;-) are converted to images.
 
 
 
‹ February ’12 ›
Mo Tu We Th Fr Sa Su
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29        
  • Recent posts
  • Archives
  • RSS/XML RSS 1.0
  • RSS/XML RSS 2.0
  • Atom/XML Atom 1.0
  • RSS/XML Comments
Twitter: @shikadilord
  • Shadowmaster’s Blog: Two days without Wesnoth SVN http://t.co/V33x8Jwr20 hours ago
  • ... You might as well post daily updates in a blog summarizing all that crap! Oh great, you got me doing it now.2 days ago
  • It's okay if you are talking with people and mentioning them, but if you're narrating your daily life every 5 minutes...2 days ago
  • Chatty twitters make me angry.2 days ago
  • Okay, that failed spectacularly. Go back to your regular schedule, #Wesnoth forum users.1 week ago
  • Not to alarm you, #Wesnoth people, but I'm going to break your forums for a few seconds!1 week ago
Categories
  • XML Frogatto
  • XML Hardware
  • XML IRC
  • XML freenode
  • XML Miscellaneous
  • XML Personal
  • XML Projects
  • XML Rei 2 IRC Bot
  • XML Wesnoth-TC
  • XML Site updates
  • XML Software
  • XML Web browsers
  • XML Web design
  • XML phpBB
  • XML Wesnoth
  • XML Wesnoth Evolution
  • XML Wesnoth-UMC-Dev
Projects
  • Wesnoth Add-ons
  • Wesnoth-TC/RCX
  • Frogatto levels
  • Rei 2 IRC Bot
  • Wesnoth-UMC-Dev Registry
  • Shikadibot 0314
  • phpBB 3.0 Mods/Hacks
Articles
  • Wesnoth Evolution
Links
  • Battle for Wesnoth
  • Wesnoth-UMC-Dev
  • Frogatto & Friends
Contact • Site Information & Disclaimer

Copyright © 2006-2012 by Ignacio R. Morelle. All rights reserved.
Powered by Poison Ivy/Dorset6 D9 and Serendipity.
Hosting provided by rewound.net and NearlyFreeSpeech.NET.

Serendipity PHP Weblog Valid XHTML 1.0 Transitional