How I split up my workstation's disk space

December 8, 2008

There's a lot of different ways to partition disks and split out filesystems. Mine isn't necessarily the best one, it's just what I use, partly because I am cautious and conservative.

My workstation has two disks, partitioned identically and generally mirrored. I split the filesystems up like so:

  • /boot is a separate and non-mirrored filesystem. I have a /boot2 on the second disk which I synchronize by hand every so often (usually not, to be honest, which is a bad habit).

  • there are two swap partitions, one on each disk. I don't bother mirroring swap; it's too much work for what I get out of it.

  • /, /usr, and /var are each in separate mirrored partitions. (I still make them separate filesystems, which may be pointless these days.)

  • all the rest of the disk space is in a single mirrored partition, which is used for a single LVM logical volume.
  • all other filesystems are in that logical volume (and are thus sitting on LVM over RAID-1, which seems to perform well enough).

Keeping the system partitions outside of LVM means that I can boot even if something goes wrong with LVM (which it sometimes does). I put my other data into LVM because LVM is a lot more convenient.

If I was doing this today, I would have two mirrored partitions for /, /usr, and /var, with the goal of using the second set to make operating system upgrades less alarming by always having a fully bootable and functional version of the old system sitting around. I figure that on modern disks, 40 to 50 GB is a cheap price to pay for such an insurance policy and well worth it.

(Of course, I don't know if this works in practice or if it would horribly confuse Fedora's install/upgrade stuff, although since there is a disk upgrade and a Fedora upgrade in my near future, I'm probably going to get to find out. And in credit where credit is due department, this was inspired by what little I know of Sun's 'live upgrade' stuff.)

My only current observation on filesystem sizes is that /var needs to be much bigger than I thought it would be. My next /var will be at least 10 GB and may go all the way to 20 GB. (Disk space is cheap and running out is painful, which is one drawback to not having system filesystems in LVM.)


Comments on this page:

From 86.53.68.233 at 2008-12-09 05:44:22:

Question - why synchronize /boot manually?

I've set /boot up as a normal mirror in the past and it seems to work well enough. GRUB saw both as normal partitions, which is fine because it doesn't write to them. Is there something I missed?

By cks at 2008-12-09 08:47:27:

By this point there's probably no reason to avoid mirroring /boot; I persist in it out of old habits from the days when a mirrored /boot struck me as too much magic for poor lilo et al.

(I think I was especially nervous about the possibility that /boot partitions would wind up in slightly different places on the disk, which would throw off anything that used absolute block offsets from the start of the disk.)

From 62.210.154.97 at 2008-12-09 10:22:56:

Here's what I have:

sda1 md0 /boot
sdb1 md0 "
sda2 md1 luks0 VolGroup00
sdb2 md1 " "

VolGroup00 contains:

/ 4G
/usr 10G
/opt 1G
/var 6G
swap 12G
/home xxxG
/backup xxxG ← where I do daily rsync of my personal servers
freespace lots

/tmp is on tmpfs

This works pretty much out of the box on F10.

I'm sure this wastes a few gigs here and there, but on a 500G disk that's not a big deal.

From 71.250.234.178 at 2008-12-09 11:37:54:

An rsync in your crontab would work wonders if you're worried about /boot ;-)

Written on 08 December 2008.
« How to help programmers (part 1): the os.listdir() problem
How Amanda uses what restore program to use, a correction »

Page tools: View Source, View Normal, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Mon Dec 8 23:44:53 2008
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.