I am building a home server with the intent of using it for
I have five disks, and I will use a normal root partition and a normal swap partition, see below. Note that the abomination of the Linux kernel or udev that causes disks to not end up as the same device on every boot means that the below list, being valid when preparing the disks is not valid when rebooting, causing some problems. Disks must be referenced by their uuid, completely non-userfriendly since the sysadmin MUST deal with them. No fun.
Anyway, I boot the Arch live CD and manually prepare the disks with cfdisk:
Later during the installation, in /etc/rc.conf, I add the raid modules to the MODULES line, and in /etc/mkinitcpio.conf I add the raid HOOK. Also, it might be necessary to add kernel parameters to the kernel line in /boot/grub/menu.lst:
However, see a fortcoming post on LVM2 where will I show how I collected all the RAID arrays into a gigantic Volume Group, and then split it up into logical volumes that are then mounted into the file system. These LVs can be shrunk or grown as needed and thus offers much more flexibility than RAID alone.
As a concluding remark I might add that my partitioning scheme was created to maximize the use of current disk space and redundancy since the disks aren't identical. I don't know if it is optimal in any way and comments are welcome. This is my first shot ever at software RAID, so any disclaimers you can imagine apply.
I haven't planned for the future since it seems this disk space should be enough for quite some time, but I am hoping that I will be able to exchange the disks for larger ones and just create same-sized partitions for complementing the old arrays and additional ones for new arrays and then just grow the volume group and the logical volumes as needed. I should for instance be able to fail all participating partitions on a particular disk (thus degrading all arrays having partitions on the disk, but still working), shut down, put in a new disk, boot and create new partitions that are the same size and then add those to the arrays and watch them rebuild. I could do this for all disks, one at a time and then create new arrays and add them to the volume group and then grow the logical volumes as necessary. Other growth/migration strategies are possible of course.

- Mythtv backend server
- Backup of documents, email, photos, videos etc that are created and used on other computers in the house
- Print server
- Offline syncing for remote backup (using another server at my parents' house, and possibly one at the house of my inlaws)
- Eventually keeping home directories here instead of locally - probably when the kids are old enough to get their own computer(s)
I have five disks, and I will use a normal root partition and a normal swap partition, see below. Note that the abomination of the Linux kernel or udev that causes disks to not end up as the same device on every boot means that the below list, being valid when preparing the disks is not valid when rebooting, causing some problems. Disks must be referenced by their uuid, completely non-userfriendly since the sysadmin MUST deal with them. No fun.
Anyway, I boot the Arch live CD and manually prepare the disks with cfdisk:
- sda: 400GB (/ swap 360GB) 1 2 3
- sdb: 400GB (360GB 40GB) 1 2
- sdc: 500GB (360GB 40GB 100GB) 1 2 3
- sdd: 400GB (360GB 40GB) 1 2
- sde: 500GB (360GB 40GB 100GB) 1 2 3
modprobe raid1So I create a RAID5 array with five 360GB partitions, a RAID5 array with four 40GB partitions, and a RAID1 array with two 100GB partitions:
modprobe raid5
mdadm --create /dev/md0 -raid-devices=5 --level=5 /dev/sda3 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1It is necessary to inform mdadm about the raid arrays so that they can be assembled at boot so I used:
mdadm --create /dev/md1 -raid-devices=4 --level=5 /dev/sdb2 /dev/sdc2 /dev/sdd2 /dev/sde2
mdadm --create /dev/md2 -raid-devices=2 --level=1 /dev/sdc3 /dev/sde3
mdadm --examine --scan >> /etc/mdadm.confNow I did not do this during install, and the installer did not bother doing it, which I discovered when rebooting and fsck could not find any of my nice logical volumes that I created. Doing it during install you must consider where the file is mounted, probably /mnt/etc/mdadm.conf.
Later during the installation, in /etc/rc.conf, I add the raid modules to the MODULES line, and in /etc/mkinitcpio.conf I add the raid HOOK. Also, it might be necessary to add kernel parameters to the kernel line in /boot/grub/menu.lst:
md=0,/dev/sda3,/dev/sdb1,/dev/sdc1,/dev/sdd1,/dev/sde1 md=1,/dev/sdb2,/dev/sdc2,/dev/sdd2,/dev/sde2 md=2,/dev/sdc3,/dev/sde3 to kernel parameterI haven't figured out if that is really necessary since I use a normal root partition, but at least things work now. Also notice that since I got it working after first reboot I manually regenerated the kernel:
mkinitcpio -g /boot/kernel26.imgYou can allocate the RAID arrays to whatever mount point you want now, in my case I could have a large 1,3TB /home directory (/dev/md0), and perhaps a 100GB /backups directory (/dev/md2).
However, see a fortcoming post on LVM2 where will I show how I collected all the RAID arrays into a gigantic Volume Group, and then split it up into logical volumes that are then mounted into the file system. These LVs can be shrunk or grown as needed and thus offers much more flexibility than RAID alone.
As a concluding remark I might add that my partitioning scheme was created to maximize the use of current disk space and redundancy since the disks aren't identical. I don't know if it is optimal in any way and comments are welcome. This is my first shot ever at software RAID, so any disclaimers you can imagine apply.
I haven't planned for the future since it seems this disk space should be enough for quite some time, but I am hoping that I will be able to exchange the disks for larger ones and just create same-sized partitions for complementing the old arrays and additional ones for new arrays and then just grow the volume group and the logical volumes as needed. I should for instance be able to fail all participating partitions on a particular disk (thus degrading all arrays having partitions on the disk, but still working), shut down, put in a new disk, boot and create new partitions that are the same size and then add those to the arrays and watch them rebuild. I could do this for all disks, one at a time and then create new arrays and add them to the volume group and then grow the logical volumes as necessary. Other growth/migration strategies are possible of course.

