RAID setup

From Elvanör's Technical Wiki
Revision as of 12:44, 3 February 2013 by Elvanor (talk | contribs)
Jump to navigation Jump to search

Concepts

Types

  • A RAID setup can either be hardware (hardware card that includes a RAID controller, in this case no drivers are needed) or software (in this case Linux drivers are needed). There is a third type called firmware RAID that is neither software nor hardware. It seems no drivers are needed but there is a burden on the host CPU.

Possible setups

  • RAID 0 is stripping: basically two drives combined into one big drive. If one drive breaks, all data is lost so this is risky.
    • With RAID 0, you cannot have /boot on the stripped partition (at least not with GRUB 0.97). You need a separate /boot partition that is not on the RAID array.
  • RAID 1 is mirroring. There is redundancy but at a high cost.

Tools

  • mdadm is used to create the RAID arrays:
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1

When creating the array mdadm can complain about the previous presence of a filesystem. You can use mkswap to remove the filesystem (later you will probably reformat the RAID array, so that's safe). It can also tell you to use --metadata=0.90 format. Indeed if you use GRUB legacy, and a setup without initrd, you cannot use RAID 1 with a metadata format higher than 0.90.

  • To deactivate a RAID array:
mdadm --stop /dev/md1
  • To deassociate the partitions from a RAID array:
mdadm --zero-superblock /dev/sda1
mdadm --zero-superblock /dev/sdb1
  • To obtain the status of an array:
mdadm --detail /dev/md1

LVM2

  • LVM is a set of userspace tools that allows dynamic resizing of partitions without rebooting and other stuff like that. Untested yet.