RAID setup: Difference between revisions

From Elvanör's Technical Wiki
Jump to navigation Jump to search
Line 15: Line 15:


  mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
  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).


* To deactivate a RAID array:
* To deactivate a RAID array:

Revision as of 13:28, 1 October 2009

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.
  • 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).

  • 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.