Celestial Coding

Archive => Archives => General => Topic started by: Nathan on December 19, 2009, 10:58:14 PM

Title: Linux RAID Intro
Post by: Nathan on December 19, 2009, 10:58:14 PM
(Don't know where this should go)

First off -
You should wipe the file system info on the drive(s) you want to use in the RAID. This is becuase you are going to format the RAID not the drive.
Please do consider you can RAID partitions or whole disks. It is advised to RAID the whole disk.

Code: Bash
  1. # dd if=/dev/zero bs=1M count=1 of=/dev/sdL#
Where L = letter and # = number

Now lets create the array
Code: Bash
  1. # mdadm --create --verbose /dev/md0 --level=# --raid-devices=# /dev/sdL#
This tells mdadm what drives you want to be in the array, and what RAID level you are going to use.

Once the RAID is created -

To get some detail on the RAID
Code: Bash
  1. # mdadm --detail /dev/md0
Or
Code: Bash
  1. # cat /proc/mdstat

Now you need to actually format the RAID.
Code: Bash
  1. # mkfs.ext3 /dev/md0

To remove a drive from an array (because it failed)
Code: Bash
  1. # mdadm --manage --set-fault /dev/md0 /dev/sdL#
  2. # mdadm /dev/md0 -r /dev/sdL#
You must set it faulty before you can remove it!

To stop the array
Code: Bash
  1. # mdadm --stop /dev/md0

I orignally used to to RAID 2 network block devices, which didn't pan out too well...but it did work!

Some Links:
How to remove an MDADM Raid Array, Once and For All! - http://ubuntuforums.org/showthread.php?t=884556
Managing RAID and LVM with Linux (v0.5) - http://www.gagme.com/greg/linux/raid-lvm.php
Growing a RAID5 array MDADM - http://scotgate.org/2006/07/03/growing-a-raid5-array-mdadm/
The Software-RAID HOWTO - http://tldp.org/HOWTO/Software-RAID-HOWTO.html
Title: Re: Linux RAID Intro
Post by: Celestialkey on December 19, 2009, 11:15:24 PM
Hardware/Software support. You can decide.
Title: Re: Linux RAID Intro
Post by: Nathan on December 20, 2009, 11:11:18 AM
Hardware/Software support. You can decide.
Perhaps we need a Linux section?
Title: Re: Linux RAID Intro
Post by: Celestialkey on December 20, 2009, 11:27:49 AM
Lol, go ahead and make it. I don't have the time atm.