[plug] Partitioning Hard Disk

Craig Ringer craig at postnewspapers.com.au
Wed Sep 25 18:53:19 WST 2002


> /tmp   (roughly) 100MB, vary according to available space and needs

Alternately, give yourself more swap and use tmpfs - its fast, 
efficient, and handily erased at every boot. Of course, that's personal 
preference only.

> /usr   size of packages plus some elbow room

Or _lots_ of elbow room, depending on how much playing about with things 
you plan to do. An OO.o install in /usr/local can eat an incredible 
amount of space.

> /var   \ if this is to be predominantly a server, make var huge and home
> /home  / small; if this is to be predominantly a workstation or store
>          many individual user files (think SaMBa), reverse that.

Alternately, if you're feeling cramped for space, you can use bind 
mounts to share a partition between /home and /var. Upside: more space 
efficient and more flexible. Downsides: more complex, no distro can set 
it up at install-time, makes distro changes a wee bit uglier. I like to 
do that on desktops with < 40gb of space, as I never know whether I'll 
have a 500mb /var or a 4gb /var.

How: create a single partition to old /var and /home, mounted on say 
/.home_var

create the directories
/.home_var/home
/.home_var/var

mount -o bind /.home_var/home /home
mount -o bind /.home_var/var /var

and in /etc/fstab:

/.home_var/home /home          none    bind    0 0
/.home_var/var	/var           none    bind    0 0

mount -a handles this quite happily - but make _certain_ that the entry 
in fstab for the real FS is before any bind mounts using it.

> I use ext3 where possible. ReiserFS is too complicated and ext2 has no 
> journalling.

Complicated? mkreiserfs /dev/hdxn ; mount -t reiserfs /dev/hdxn /point
I've never had any problems with reiserfs - though its nicer now that 
the distros rescue disks all support it.

> When installation is done, mount /usr and /boot readonly,nodev; and mount 
> /tmp, /home and /var nosuid,nodev. Under certain circumstances, you can also 
> leave / mounted readonly, and this is an excellent security measure.

But you have to mess about a lot to do it. Mount expects to be able to 
write to /etc/mtab at boot, etc - its usually more trouble than its 
worth. I discovered just how much when building nfs-root thin clients - 
lots of messing about dealing with a ro /etc.

-- 
Craig Ringer
GPG Key Fingerprint: AF1C ABFE 7E64 E9C8 FC27  C16E D3CE CDC0 0E93 380D
	-- if it ain't broke, add features 'till it is. (or:)
	while (! broken) { features ++ ; broken = isBroken(features) }




More information about the plug mailing list