Recommended Server Partioning
From Zanecorpwiki
This is compatible with the instructions for Booting From Any Disk in a RAID Array.
Contents |
Assumptions
This layout assumes a limited (3-6, perhaps up to 8) disks which are all the same size and a desire to maximize available space data space while giving some thought to server integrity and fault tolerance. With larger or a greater number of disks, specialized apps, etc. it may make sense to do something different than the regular, unified layout proposed here. You'll need at least 3 disks for this layout.
Overview
After years of messing around with different setups and looking aat what other people do, here's what I've come up with:
- start with a set of 3 or more disks of the same size
- create 3 partitions on each: 1, 2, 3
- sd[a-...]1 : boot partitions
- sd[a-...]2 : RAID partitions; will be assembled as RAID1 array md0
- sd[a-...]3 : RAID partitions; will be assembled as RAID5 array md1
The Boot Partitions
The details and reasoning behind the boot partitions is handled in it's own section.
The Root Partition
With /boot living on a non-RAID, plain old disk partition, it's safe enough to put the rest of root (/). I usually give over 8-25GB to root and use RAID1 as the space costs are not that significant. With enough disks to run RAID6 or RAID10, I might consider that as well to save a little space. This is the second partition on each disk which should each be of equal size, designated at Linux RAID and unformatted.
These partitions are then used to build the md0 RAID1 array. The md0 itself will be formatted with your preferred filesystem (ex4 in my case) and mounted as root.
The Data Partitions
The rest of the disks are given over to the third and final partition. Again, these are marked as Linux RAID partitions and left unformatted. They will be used to build the md1 RAID array, which is typically RAID5 or with enough (say, 6+) disks RAID6 or RAID10. The md1 array itself will be left unformatted and unmounted as we intend to logical volume management for the rest of our storage.
Preparing the Volume Group
We're motivated to use logical volume management primarily because it makes backups safe and dead simple. In the example setup, we create take the unformatted md1 RAID and give it over to LVM as the backing for the volume group 'vg1'. Within this, we create two volumes, one for '/home' and one for external backups. The latter is particular to my particular uses. I highly recommend putting home in it's own partition/volume however as it makes upgrades so much simpler.


