Advertisment


Author Topic: Linux RAID Intro  (Read 5112 times)

0 Members and 1 Guest are viewing this topic.

Online Nathan

  • Administrator
  • Hero Member
  • *
  • Posts: 1423
  • Reputation 1768
  • Gender: Male
  • woof woof
    • View Profile
Linux RAID Intro
« 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 [Select]
# dd if=/dev/zero bs=1M count=1 of=/dev/sdL#

Where L = letter and # = number

Now lets create the array
Code: bash [Select]
# 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 [Select]
# mdadm --detail /dev/md0

Or
Code: bash [Select]
# cat /proc/mdstat


Now you need to actually format the RAID.
Code: bash [Select]
# mkfs.ext3 /dev/md0


To remove a drive from an array (because it failed)
Code: bash [Select]
# mdadm --manage --set-fault /dev/md0 /dev/sdL#
# mdadm /dev/md0 -r /dev/sdL#

You must set it faulty before you can remove it!

To stop the array
Code: bash [Select]
# 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
Projects:
[ Axios Engine ]
Compilers: Microsoft Visual Studio 2008, GNU C++, FASM, MASM, VB 6/.Net.
Languages: C++, PHP, ASM, JS, VB6/.Net, BASIC, HTML, MySQL
Please buy me some books: Amazon Wishlist

Offline Celestialkey

  • Administrator
  • Hero Member
  • *
  • Posts: 3953
  • Reputation 4874
  • Gender: Male
  • Its Alive!!
    • View Profile
    • www.CelestialCoding.com
Re: Linux RAID Intro
« Reply #1 on: December 19, 2009, 11:15:24 pm »
Hardware/Software support. You can decide.
Created By: Eczuo
Quote
I have noticed that people who claim that everything is predestined, and we can do nothing to change it, look both ways before they cross the road.
Quote
I'd prefer to die standing, than to live on my knees - Che Guevara
Quote
If you change the way you look at something, does that something change in any way?
- Quantum Theory

Hacking
Quote
Never in the field of human conflict was so much owed by so many to so few. - Winston Churchill


Quote from: Revelations 12:4
And his tail drew the third part of the stars of heaven, and did cast them into the earth; and the dragon stood before the woman which was ready to be delivered, for to devour her child as soon as it was born.

Quote
It takes skill to build an empire. It takes an idiot to maintain it.

Online Nathan

  • Administrator
  • Hero Member
  • *
  • Posts: 1423
  • Reputation 1768
  • Gender: Male
  • woof woof
    • View Profile
Re: Linux RAID Intro
« Reply #2 on: December 20, 2009, 11:11:18 am »
Hardware/Software support. You can decide.
Perhaps we need a Linux section?
Projects:
[ Axios Engine ]
Compilers: Microsoft Visual Studio 2008, GNU C++, FASM, MASM, VB 6/.Net.
Languages: C++, PHP, ASM, JS, VB6/.Net, BASIC, HTML, MySQL
Please buy me some books: Amazon Wishlist

Offline Celestialkey

  • Administrator
  • Hero Member
  • *
  • Posts: 3953
  • Reputation 4874
  • Gender: Male
  • Its Alive!!
    • View Profile
    • www.CelestialCoding.com
Re: Linux RAID Intro
« Reply #3 on: December 20, 2009, 11:27:49 am »
Lol, go ahead and make it. I don't have the time atm.
Created By: Eczuo
Quote
I have noticed that people who claim that everything is predestined, and we can do nothing to change it, look both ways before they cross the road.
Quote
I'd prefer to die standing, than to live on my knees - Che Guevara
Quote
If you change the way you look at something, does that something change in any way?
- Quantum Theory

Hacking
Quote
Never in the field of human conflict was so much owed by so many to so few. - Winston Churchill


Quote from: Revelations 12:4
And his tail drew the third part of the stars of heaven, and did cast them into the earth; and the dragon stood before the woman which was ready to be delivered, for to devour her child as soon as it was born.

Quote
It takes skill to build an empire. It takes an idiot to maintain it.