You are not logged in.

#1 2009-09-27 19:59:26

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Trying to understand linux RAID

Hello!

I am trying to understand how a linux RAID works. I will be getting 2x 750GB in the next few days, but I don't understand how RAID really works.

I do understand that a raid needs be created with a command similar to

mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1

But where I am confused is when booting how does the kernel know what root=/dev/md0 is?


Website - Blog - arch-home
Arch User since March 2005

Offline

#2 2009-09-27 21:22:35

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Trying to understand linux RAID

GRUB can boot from RAID 0 and 1 if I'm not mistaken, you'll need special instructions for GRUB (they're in the wiki).


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2009-09-27 22:03:07

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: Trying to understand linux RAID

Are you talking about this wiki entry? http://wiki.archlinux.org/index.php/Ins … AID_or_LVM

I don't really see any special instructions besides installing grub on both partitions.

What I'm trying to figure out is how the kernel knows what partitions are contained in the md0 array.


Website - Blog - arch-home
Arch User since March 2005

Offline

#4 2009-09-27 22:19:14

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Trying to understand linux RAID

Perhaps you will find the info you need in mkinitcpio wiki which covers the mdadm requirements for entering data into initramfs through the use of  /etc/mdadm.conf.

Also, to mount it include entry in fstab for md(x).

Works like a charm!


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#5 2009-09-27 22:25:37

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: Trying to understand linux RAID

That does help a bit, I get the concept behind the initrd, but lets say I have a custom kernel with no initrd.
Then how would the kernel handle and array node or what needs to be configured?
I am just trying to understand how software raids work at a lower level, than just add it it mkinitrd.

Just be clear, I do appreciate all the help so far.


Website - Blog - arch-home
Arch User since March 2005

Offline

#6 2009-09-27 23:30:05

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Trying to understand linux RAID

The details within mkinitcpio wiki describe the entry into initramfs...not initrd as you posted.

The elements of the raid array generated via mkinitcpio in initramfs and each drive in the array has the same UUID.  When md0 is assembled via initamfs it looks for those elements with the identical UUID during the boot sequence.

To boot from a raid array, grub has to have an entry in kernel line to enable the correct boot sequence.

I have no knowledge of booting with a raid array since I do not do that in my system.,.  I do however utilize a raid0 array for storage of data using a four-device raid0 array having 170MB/S read speed and 30GB storage space.  It assembles and mounts(fstab) during boot-up.

Good luck with your raid system.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#7 2009-09-27 23:47:13

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: Trying to understand linux RAID

Woops yep I made a mistake wink

It appears that the current version mkinitcpio no longer requires the extra information in grub. It appears that it can some how autodectect this. Maybe from /etc/mdadm.conf

It appears that I would need those extra line for a kernel with no intird. Which I believe that results in answering my question.


Website - Blog - arch-home
Arch User since March 2005

Offline

#8 2009-09-28 00:19:43

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Trying to understand linux RAID

AFAICT there is no autodetect provided in archlinux.....

See the following post for one solution:

http://bbs.archlinux.org/viewtopic.php?id=79306


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#9 2009-09-28 00:24:18

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: Trying to understand linux RAID

Nowadays (2009.02), with the mdadm hook in the initrd it it no longer necessary to add kernel parameters concerning the RAID array(s).

The arrays can be assembled on boot by the kernel using that hook and the contents of /etc/mdadm.conf, which is included in the initrd image when it's build. (See Configuring mkinitpcio using RAID )

An example of a GRUB boot configuration for booting of a RAIDed root like this:

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/md0 ro
initrd /kernel26.img

http://wiki.archlinux.org/index.php/Ins … AID_or_LVM

So I am not sure. From that post it looks like this is not the case. I guess I will only be able to tell when I try myself.


Website - Blog - arch-home
Arch User since March 2005

Offline

#10 2009-09-28 00:42:17

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Trying to understand linux RAID

I believe the reference in the quoted wiki to initrd is incorrect...it should state..... initramfs.

The present raid using mdadm is software raid and performs as described using /etc/mdadm.conf as the array info inserted into initramfs with ......mkinitcpio -p kernel26.

The referenced post I gave to you shows one users boot via kernel line entry in grub while employing mdadm procedures.

Good luck with raid............


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#11 2009-09-28 01:13:05

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: Trying to understand linux RAID

You are probably right.

However I am not sure if saying intird is incorrect, as the intramfs is part of the initrd. http://en.wikipedia.org/wiki/Initrd


Website - Blog - arch-home
Arch User since March 2005

Offline

Board footer

Powered by FluxBB