Re: Partitioning scheme for file/mail server



On Mon, 24 Oct 2005, Alex Butcher announced authoritatively:
> On Mon, 24 Oct 2005 08:36:03 +0000, Ben Tisdall wrote:
>> / 40GB
>
> Why? 2GB is plenty:
>
> $ df -k
> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/hde2 2071416 977856 988336 50% /
>
> Best to create seperate partitions for /usr, /tmp, /home and /var.

If you're doing that, well, 500Mb is plenty. Hell, even less is. I'm
using 200Mb here, and I can struggle along with 50Mb as long as I
don't need too many simultaneously-present kernels.

> These days, make swap 2x the maximum amount of memory that can be fitted
> to the motherboard. Keeps life easy. If you're using Linux software RAID
> to perform the mirroring between partitions, then swap can be configured
> to use the two matching swap partitions round-robin, so you'd only need
> 1xmax memory on each disc.

It's trivial to do that even if you don't use RAID, viz

/dev/disks/swap0 swap swap defaults,pri=1 0 0
/dev/disks/swap1 swap swap defaults,pri=1 0 0

(This system uses LVM, but not RAID, and you don't need LVM for this,
either.)

If you add more swap on-the-fly on a disk that's already got swap on it,
use a lower priority (i.e., 0) for the new swap so that the kernel doesn't
try to use it until the existing swap is already full. This should keep
inter-swap-area head movement down until you're really short of memory.

>> As for the rest, I would really like to use it flexibly between /home and
>> say, /mnt/shared-data but I'm not sure how best to do this. Would making
>> /home a symlink to /mnt/shared-data/home be ok or is there a better way?
>
> As for the rest, get with the 21st century and use LVM :-). That way you
> can dynamically shuffle space from unallocated space and one filesystem to
> another if-and-when you need it. I'd advise you to take a rough stab at
> getting the proportions right (e.g. based on current usage), but leave
> ~50% unallocated for now. When you expand a filesystem, do it in large
> chunks (say, 10-20GB or more).

Agreed --- although of course the chunk size you choose to expand in
depends on how much disk space you have in total; the chunk size you
suggest is more than the total disk space on one of my machines, and
entirely reasonable for another of them ;)

I'd hold off putting / on LVM, though, because it means you have to boot
using an initrd, and if that breaks for whatever reason then fixing
things is deeply annoying and fiddly. At least if / is unadorned (or at
best only a mirrored RAID partition) then you can do a single-user boot
even if nothing is working but the kernel and a statically linked
busybox (and it's *hard* to break a statically linked busybox).

--
`"Gun-wielding recluse gunned down by local police" isn't the epitaph
I want. I am hoping for "Witnesses reported the sound up to two hundred
kilometers away" or "Last body part finally located".' --- James Nicoll
.



Relevant Pages

  • Re: software RAID-0 recommendations
    ... > for my linux box before i realized that you can't utilize the onboard RAID ... RAID0 array with / on it, excluding /boot and swap. ... > * create an LVM device using the two RAID partitions ...
    (Fedora)
  • Advice on setting up Raid and LVM
    ... I'm setting up Raid 1 and LVM on 2x80GB SATA drives. ... for /, /home, and swap? ... The future purpose of using LVM is I want to be able to expand any partitions ...
    (Fedora)
  • Re: [SLE] SUSE 9.0, software RAID, and booting
    ... I do not want any of the drives holding parts of swap to crash the ... It looks like I will have to go with LILO instead of GRUB. ... have to establish the RAID after the initial setup. ...
    (SuSE)
  • Re: [opensuse] Swap Software RAID 1 not working, SuSE 10.3
    ... raid 5 actually and it also suffers the same problem. ... must change this in 10.3 in order to get swap on raid 1 or raid 5 ... physical drives to make up multiple raid arrays, if my swap partition ... I have 3 G of RAM and I rarely use any swap on disk, ...
    (SuSE)
  • Re: [opensuse] Swap Software RAID 1 not working, SuSE 10.3
    ... didn't have to go raid 0 in order to fix this problem and now it works ... partitions in an emergency, either when you run short or if the array ... physical drives to make up multiple raid arrays, if my swap partition ... I have 3 G of RAM and I rarely use any swap on disk, ...
    (SuSE)