LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 02-07-2006, 05:22 AM   #1
barrulus
LQ Newbie
 
Registered: Feb 2006
Location: Wales
Distribution: Fedora, SuSE, CentOS, Ubuntu
Posts: 13

Rep: Reputation: 0
Linux Software RAID 1+0 (using mdadm)


Hello People,

I have a server that recently had 4 x 300GB 15k RPM SCSI drives added to it.
They were added so that I can write my database to a highspeed array.

Unfortunately the host based RAID controller onboard the box is only geared for 1 RAID array and that is already in use for a RAID 1 stripe across 2 x 73GB SCSI drives for my host OS (Fedora Core 4 x86_64)

Ok, so now I have 1 x RAID 1 hardware controlled array, and I need some redundancy and high speed access.
My machines are Sunfire V40z's and have more than enough spare CPU and I/O to handle softare RAID so I am trying to configure the following: -

sdb1 + sdc1 = md1 (RAID 1)
sdd1 + sde1 = md2 (RAID 1)
md1 + md2 = md3 (RAID 0)

Ok, while in theory this is very simple, with Linux software RAID there are a few caveats...

1. you cannot use the raw drive (i.e. /dev/sdb) you have to create a partition on the drive and format it to be of partition type Linux RAID autodetect.
So I partition each drive, create 1 primary partition using all disk space, use fdisk to set the partion to Linux RAID Autodetect.
Doing this essentially gives the drives a "persistant superblock" so that the drives will be recognised at boot time.

Ok, /dev/md1 and /dev md2 are both easy and are recognised by my kernel/OS when booting and I have two functional RAID 1 mirrors with no data.

I now need to make a RAID 0 stripe across these two mirrors to get my RAID 1+0 (10) up.

I use:
mdadm -C /dev/md3 --level=raid0 --raid-devices=2 /dev/md1 /dev/md2
to create a RAID 0 array using the four disks in the aforementioned config.
This works greate, I can now create and mount my filesystem:
mkfs.reiserfs /dev/md3
mount /dev/md3 /data/

Alright at this point I have almost 600GB of useable space in exactly the configuration I want.
My problem is this:

How do I make this persistant across boots?
only my two RAID 1 arrays are persistant across boots, no matter what I try the RAID 0 stripe fails.

I have tried scripting using mdadm to rebuild the array (assemble) but it just tells me that the drives are part of an existing array.
I have tried fdisking the /dev/md3 and creating a Linux RAID Autodetect partition /dev/md31 to get the persistant superblock happening but this fails on boot as /dev/md3 does not exist until Linux has booted to a point.

Any help here would be greatly appreciated.
 
Old 02-07-2006, 06:42 AM   #2
sam_vde
LQ Newbie
 
Registered: Mar 2005
Posts: 19

Rep: Reputation: 0
Raid 1+0

I think you can achieve this by using the /etc/raidtab file. Persistent superblocks are required to boot from a software raid, but for your particular setup raidtab could work fine.

Another option (my personal preference that is) is using LVM. You can add your RAID1 sets into a Volume Group (lineair or striped) and create Logical Volumes from it. This will give you more flexibility (e.g. not allocating all space yet so you can grow the volumes afterwards) and you can work with meaningful device names (e.g. /dev/oracle/db).

Beware if you should go for LVM and you create a striped Volume Group, you cannot expand this with more physical devices afterwards!
 
Old 02-07-2006, 09:21 AM   #3
barrulus
LQ Newbie
 
Registered: Feb 2006
Location: Wales
Distribution: Fedora, SuSE, CentOS, Ubuntu
Posts: 13

Original Poster
Rep: Reputation: 0
Ok, so I leave persistant superblocks to take care of /dev/md1 and /dev/md2 and set up a /etc/raidtab file with some detail about the RAID 0 stripe across the two RAID 1 mirrors.

I have considered using LVM on the RAID 0 stripe, that way I can add additional mirrors into the underlying array and then increase the size of the raid 0 array by adding new devices to the array. Then I simply increase the size of the LVM group.

for RAIDTAB, do I need the raidtool package installed?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why can't I mount this md0 raid? (mdadm and software raid) cruiserparts Linux - Software 35 01-05-2013 03:35 PM
Linux raid with mdadm eyt Linux - Newbie 6 02-07-2006 05:26 AM
help me setup software raid 1 on slackware with mdadm xrado Slackware 2 03-02-2005 05:50 AM
Software RAID with mdadm problems... robbow52 Debian 2 04-19-2004 07:06 PM
mdadm mail with software RAID brucehohl Linux - Software 1 12-20-2003 06:17 AM


All times are GMT -5. The time now is 05:49 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration