raid10??

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

raid10??

by randall-22 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi all,

i'm setting up a new server and i basically have 4 disks (+2 for back-up
storage), easiest would be to go for the good old raid5 and suffer the
performance loss, but i have some time left to do some benchmarking and
i want to give raid10 a try.

i don't seem to be able to find much resources on google about setting
up raid 10 in debian (anybody has some experience???)
and i also came accross the idea of raid1 with lvm setup..is this an option?


just wandering if somebody has some thoughts and pointers


--
To UNSUBSCRIBE, email to debian-isp-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: raid10??

by Matus UHLAR - fantomas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 28.01.08 15:03, randall wrote:

> i'm setting up a new server and i basically have 4 disks (+2 for back-up
> storage), easiest would be to go for the good old raid5 and suffer the
> performance loss, but i have some time left to do some benchmarking and
> i want to give raid10 a try.
>
> i don't seem to be able to find much resources on google about setting
> up raid 10 in debian (anybody has some experience???)
> and i also came accross the idea of raid1 with lvm setup..is this an option?
>
>
> just wandering if somebody has some thoughts and pointers

I currently run raid0 over raid1. Someone mentioned that I'm lucky because
due to some problem this configuration may fail. Well, I'm lucky yet...

I noticed there is raid10 driver in kernel, but I haven't looked carefully
over that yet. Currently I have 2 types of disks (2 disks of each) connected
through 2 SATA cards (each card has one disk of one type and one disk of
another type), mirroring one disk of one type on one cars with one disk of
another type on another card, so if one of cards or both disks of one type
fail, I'm still not loosing any data... I would like to have raid10 with the
same configuration.

--
Matus UHLAR - fantomas, uhlar@... ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Your mouse has moved. Windows NT will now restart for changes to take
to take effect. [OK]


--
To UNSUBSCRIBE, email to debian-isp-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: raid10??

by Roberto C. Sánchez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jan 28, 2008 at 04:13:10PM +0100, Matus UHLAR - fantomas wrote:
>
> I currently run raid0 over raid1. Someone mentioned that I'm lucky because
> due to some problem this configuration may fail. Well, I'm lucky yet...
>
This makes no sense to me.  Why not just pair off the disks in raid1
arrays and then make them all PVs in an LVM setup?

Regards,

-Roberto

--
Roberto C. Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com


signature.asc (196 bytes) Download Attachment

Re: raid10??

by Matus UHLAR - fantomas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> On Mon, Jan 28, 2008 at 04:13:10PM +0100, Matus UHLAR - fantomas wrote:
> >
> > I currently run raid0 over raid1. Someone mentioned that I'm lucky because
> > due to some problem this configuration may fail. Well, I'm lucky yet...

On 28.01.08 11:23, Roberto C. Sánchez wrote:
> This makes no sense to me.  Why not just pair off the disks in raid1
> arrays and then make them all PVs in an LVM setup?

because I wanted to skip the LVM part. I have no need for LVM yet...
--
Matus UHLAR - fantomas, uhlar@... ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
It's now safe to throw off your computer.


--
To UNSUBSCRIBE, email to debian-isp-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: raid10??

by Gilles Mocellin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le Monday 28 January 2008 17:30:05 Matus UHLAR - fantomas, vous avez écrit :

> > On Mon, Jan 28, 2008 at 04:13:10PM +0100, Matus UHLAR - fantomas wrote:
> > > I currently run raid0 over raid1. Someone mentioned that I'm lucky
> > > because due to some problem this configuration may fail. Well, I'm
> > > lucky yet...
>
> On 28.01.08 11:23, Roberto C. Sánchez wrote:
> > This makes no sense to me.  Why not just pair off the disks in raid1
> > arrays and then make them all PVs in an LVM setup?
>
> because I wanted to skip the LVM part. I have no need for LVM yet...
But LVM stripping (lvcreate -i) will add you the RAID0 part of your RAID10 !
=>lvm stripping across two raid1 arrays.


signature.asc (196 bytes) Download Attachment

Re: raid10??

by randall-22 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Gilles Mocellin wrote:

> Le Monday 28 January 2008 17:30:05 Matus UHLAR - fantomas, vous avez écrit :
>>> On Mon, Jan 28, 2008 at 04:13:10PM +0100, Matus UHLAR - fantomas wrote:
>>>> I currently run raid0 over raid1. Someone mentioned that I'm lucky
>>>> because due to some problem this configuration may fail. Well, I'm
>>>> lucky yet...
>> On 28.01.08 11:23, Roberto C. Sánchez wrote:
>>> This makes no sense to me.  Why not just pair off the disks in raid1
>>> arrays and then make them all PVs in an LVM setup?
>> because I wanted to skip the LVM part. I have no need for LVM yet...
>
> But LVM stripping (lvcreate -i) will add you the RAID0 part of your RAID10 !
> =>lvm stripping across two raid1 arrays.

i have just installed with the debian installer making 2 x raid1 and
then glueing them together with LVM
256 MB /boot raid 1 (on all 4 disks)
10 GB /root raid1 + lvm
1 GB /swap raid1 + lvm
500 GB unused raid1 + lvm

(i wasn't very sure what to do about the swap but i think this means
slower but securer in a case of crashing)

till so far the performance feels pretty snappy but i still have to do
some benchmarking and remove a few random disks to see what happens.

anybody ever reliably used a set up like this in production?


--
To UNSUBSCRIBE, email to debian-isp-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: raid10??

by Boris Pavlov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Roberto C. Sánchez wrote:
> On Mon, Jan 28, 2008 at 04:13:10PM +0100, Matus UHLAR - fantomas wrote:
>> I currently run raid0 over raid1. Someone mentioned that I'm lucky because
>> due to some problem this configuration may fail. Well, I'm lucky yet...
>>
> This makes no sense to me.  Why not just pair off the disks in raid1
> arrays and then make them all PVs in an LVM setup?

to have control and optimize the speed? afaik, raid 10 is used primarily
for performance, not space consolidation, or safety only.

>
> Regards,
>
> -Roberto
>


--
To UNSUBSCRIBE, email to debian-isp-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: raid10??

by Matus UHLAR - fantomas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> > On 28.01.08 11:23, Roberto C. Sánchez wrote:
> > > This makes no sense to me.  Why not just pair off the disks in raid1
> > > arrays and then make them all PVs in an LVM setup?

> > because I wanted to skip the LVM part. I have no need for LVM yet...

On 28.01.08 20:23, Gilles Mocellin wrote:
> But LVM stripping (lvcreate -i) will add you the RAID0 part of your RAID10 !
> =>lvm stripping across two raid1 arrays.

read again the "skip the LVM part" please.
--
Matus UHLAR - fantomas, uhlar@... ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
"They say when you play that M$ CD backward you can hear satanic messages."
"That's nothing. If you play it forward it will install Windows."


--
To UNSUBSCRIBE, email to debian-isp-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: raid10??

by Roberto C. Sánchez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jan 29, 2008 at 05:23:25AM +0100, randall wrote:

>
> i have just installed with the debian installer making 2 x raid1 and
> then glueing them together with LVM
> 256 MB /boot raid 1 (on all 4 disks)
> 10 GB /root raid1 + lvm
> 1 GB /swap raid1 + lvm
> 500 GB unused raid1 + lvm
>
> (i wasn't very sure what to do about the swap but i think this means
> slower but securer in a case of crashing)
>
> till so far the performance feels pretty snappy but i still have to do
> some benchmarking and remove a few random disks to see what happens.
>
> anybody ever reliably used a set up like this in production?
>
I run a similar setup on many production servers.  On one, for example,
I have four disks.  I create two RAID1 arrays, /dev/md0 and /dev/md1.
Then I create a LVM volume group, adding both /dev/md0 and /dev/md1 as
physical volumes.  Then I create whatever logical volumes I want.  It
works very well.

Regards,

-Roberto

--
Roberto C. Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com


signature.asc (196 bytes) Download Attachment

Re: raid10??

by Héctor González-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

With mdadm you can make RAID10, is there a problem here I just don't see?

my mdadm.conf has this for one server with 4 500GB disks, md0 is 1 TB.

ARRAY /dev/md0 level=raid10 num-devices=4
UUID=9fbd86dc:518e4bf3:c0ae5f04:5c65c500


Roberto C. Sánchez wrote:

> On Tue, Jan 29, 2008 at 05:23:25AM +0100, randall wrote:
>  
>> i have just installed with the debian installer making 2 x raid1 and
>> then glueing them together with LVM
>> 256 MB /boot raid 1 (on all 4 disks)
>> 10 GB /root raid1 + lvm
>> 1 GB /swap raid1 + lvm
>> 500 GB unused raid1 + lvm
>>
>> (i wasn't very sure what to do about the swap but i think this means
>> slower but securer in a case of crashing)
>>
>> till so far the performance feels pretty snappy but i still have to do
>> some benchmarking and remove a few random disks to see what happens.
>>
>> anybody ever reliably used a set up like this in production?
>>
>>    
> I run a similar setup on many production servers.  On one, for example,
> I have four disks.  I create two RAID1 arrays, /dev/md0 and /dev/md1.
> Then I create a LVM volume group, adding both /dev/md0 and /dev/md1 as
> physical volumes.  Then I create whatever logical volumes I want.  It
> works very well.
>
> Regards,
>
> -Roberto
>
>  


--
Hector Gonzalez
cacho@...
http://www.genac.org


--
To UNSUBSCRIBE, email to debian-isp-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: raid10??

by randall-22 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Héctor González wrote:

> With mdadm you can make RAID10, is there a problem here I just don't see?
>
> my mdadm.conf has this for one server with 4 500GB disks, md0 is 1 TB.
>
> ARRAY /dev/md0 level=raid10 num-devices=4
> UUID=9fbd86dc:518e4bf3:c0ae5f04:5c65c500
>
>
> Roberto C. Sánchez wrote:
>> On Tue, Jan 29, 2008 at 05:23:25AM +0100, randall wrote:
>>  
>>> i have just installed with the debian installer making 2 x raid1 and
>>> then glueing them together with LVM
>>> 256 MB /boot raid 1 (on all 4 disks)
>>> 10 GB /root raid1 + lvm
>>> 1 GB /swap raid1 + lvm
>>> 500 GB unused raid1 + lvm
>>>
>>> (i wasn't very sure what to do about the swap but i think this means
>>> slower but securer in a case of crashing)
>>>
>>> till so far the performance feels pretty snappy but i still have to do
>>> some benchmarking and remove a few random disks to see what happens.
>>>
>>> anybody ever reliably used a set up like this in production?
>>>
>>>    
>> I run a similar setup on many production servers.  On one, for example,
>> I have four disks.  I create two RAID1 arrays, /dev/md0 and /dev/md1.
>> Then I create a LVM volume group, adding both /dev/md0 and /dev/md1 as
>> physical volumes.  Then I create whatever logical volumes I want.  It
>> works very well.
>>
>> Regards,
>>
>> -Roberto
>>
>>  
>
>
no problem, just some time left to try out different options ;)

and i was just about to try that way, any pointers about the install you
are willing to share?

should be something as follows i figured, can you include /boot this way?

sfdisk -d /dev/hda | sfdisk /dev/hdb etc......

mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sd[ab]1
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sd[cd]1
mdadm --create /dev/md2 --level=0 --raid-devices=2 /dev/md[01]



--
To UNSUBSCRIBE, email to debian-isp-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: raid10??

by Héctor González-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

randall wrote:

> Héctor González wrote:
>  
>> With mdadm you can make RAID10, is there a problem here I just don't see?
>>
>> my mdadm.conf has this for one server with 4 500GB disks, md0 is 1 TB.
>>
>> ARRAY /dev/md0 level=raid10 num-devices=4
>> UUID=9fbd86dc:518e4bf3:c0ae5f04:5c65c500
>>
>>
>> Roberto C. Sánchez wrote:
>>    
>>> On Tue, Jan 29, 2008 at 05:23:25AM +0100, randall wrote:
>>>  
>>>      
>>>> i have just installed with the debian installer making 2 x raid1 and
>>>> then glueing them together with LVM
>>>> 256 MB /boot raid 1 (on all 4 disks)
>>>> 10 GB /root raid1 + lvm
>>>> 1 GB /swap raid1 + lvm
>>>> 500 GB unused raid1 + lvm
>>>>
>>>> (i wasn't very sure what to do about the swap but i think this means
>>>> slower but securer in a case of crashing)
>>>>
>>>> till so far the performance feels pretty snappy but i still have to do
>>>> some benchmarking and remove a few random disks to see what happens.
>>>>
>>>> anybody ever reliably used a set up like this in production?
>>>>
>>>>    
>>>>        
>>> I run a similar setup on many production servers.  On one, for example,
>>> I have four disks.  I create two RAID1 arrays, /dev/md0 and /dev/md1.
>>> Then I create a LVM volume group, adding both /dev/md0 and /dev/md1 as
>>> physical volumes.  Then I create whatever logical volumes I want.  It
>>> works very well.
>>>
>>> Regards,
>>>
>>> -Roberto
>>>
>>>  
>>>      
>>    
> no problem, just some time left to try out different options ;)
>
> and i was just about to try that way, any pointers about the install you
> are willing to share?
>
> should be something as follows i figured, can you include /boot this way?
>
> sfdisk -d /dev/hda | sfdisk /dev/hdb etc......
>
> mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sd[ab]1
> mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sd[cd]1
> mdadm --create /dev/md2 --level=0 --raid-devices=2 /dev/md[01]
>
>
>
>  
Well, if memory doesn't fail, I just did something like:

mdadm --create /dev/md0 --level=raid10 --raid-devices=4 /dev/sd[bcde]1

I don't boot currently from that raid, but it should work fine, if you
told the mdadm package to include boot raid support.

--
Hector Gonzalez
cacho@...
http://www.genac.org


--
To UNSUBSCRIBE, email to debian-isp-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: raid10??

by martin f krafft :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

also sprach Héctor González <cacho@...> [2008.01.30.0600 +1100]:
> Well, if memory doesn't fail, I just did something like:
>
> mdadm --create /dev/md0 --level=raid10 --raid-devices=4 /dev/sd[bcde]1

This has the advantage that access to the disk only has to traverse
the md layer once. It works, I use it almost everywhere.

--
 .''`.   martin f. krafft <madduck@...>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems
 
die wahrheit ist selten
auf seiten der wahrscheinlichkeit.
                                                 -- heinrich v. kleist


digital_signature_gpg.asc (196 bytes) Download Attachment

Re: raid10??

by Andre Keller :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry forgot the list ;-)

martin f krafft schrieb:

> also sprach Héctor González <cacho@...> [2008.01.30.0600 +1100]:
>  
>> Well, if memory doesn't fail, I just did something like:
>>
>> mdadm --create /dev/md0 --level=raid10 --raid-devices=4 /dev/sd[bcde]1
>>    
>
> This has the advantage that access to the disk only has to traverse
> the md layer once. It works, I use it almost everywhere.
>
>  

Is this also possible while debian installation? Can one boot from this
raid?


--
To UNSUBSCRIBE, email to debian-isp-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: raid10??

by martin f krafft :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

also sprach Andre Keller <mluser@...> [2008.01.30.1923 +1100]:
> Sorry forgot the list ;-)

Please don't Cc people when replying to lists.

> Is this also possible while debian installation? Can one boot from this
> raid?

Not yet, at least not with the Debian installer.

--
 .''`.   martin f. krafft <madduck@...>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems
 
"... and so he killed Miguel in a rit of fealous jage."
                                               -- inspector clouseau


digital_signature_gpg.asc (196 bytes) Download Attachment

Re: raid10??

by randall-22 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Héctor González wrote:

> randall wrote:
>> Héctor González wrote:
>>  
>>> With mdadm you can make RAID10, is there a problem here I just don't see?
>>>
>>> my mdadm.conf has this for one server with 4 500GB disks, md0 is 1 TB.
>>>
>>> ARRAY /dev/md0 level=raid10 num-devices=4
>>> UUID=9fbd86dc:518e4bf3:c0ae5f04:5c65c500
>>>
>>>
>>> Roberto C. Sánchez wrote:
>>>    
>>>> On Tue, Jan 29, 2008 at 05:23:25AM +0100, randall wrote:
>>>>  
>>>>      
>>>>> i have just installed with the debian installer making 2 x raid1 and
>>>>> then glueing them together with LVM
>>>>> 256 MB /boot raid 1 (on all 4 disks)
>>>>> 10 GB /root raid1 + lvm
>>>>> 1 GB /swap raid1 + lvm
>>>>> 500 GB unused raid1 + lvm
>>>>>
>>>>> (i wasn't very sure what to do about the swap but i think this means
>>>>> slower but securer in a case of crashing)
>>>>>
>>>>> till so far the performance feels pretty snappy but i still have to do
>>>>> some benchmarking and remove a few random disks to see what happens.
>>>>>
>>>>> anybody ever reliably used a set up like this in production?
>>>>>
>>>>>    
>>>>>        
>>>> I run a similar setup on many production servers.  On one, for example,
>>>> I have four disks.  I create two RAID1 arrays, /dev/md0 and /dev/md1.
>>>> Then I create a LVM volume group, adding both /dev/md0 and /dev/md1 as
>>>> physical volumes.  Then I create whatever logical volumes I want.  It
>>>> works very well.
>>>>
>>>> Regards,
>>>>
>>>> -Roberto
>>>>
>>>>  
>>>>      
>>>    
>> no problem, just some time left to try out different options ;)
>>
>> and i was just about to try that way, any pointers about the install you
>> are willing to share?
>>
>> should be something as follows i figured, can you include /boot this way?
>>
>> sfdisk -d /dev/hda | sfdisk /dev/hdb etc......
>>
>> mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sd[ab]1
>> mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sd[cd]1
>> mdadm --create /dev/md2 --level=0 --raid-devices=2 /dev/md[01]
>>
>>
>>
>>  
> Well, if memory doesn't fail, I just did something like:
>
> mdadm --create /dev/md0 --level=raid10 --raid-devices=4 /dev/sd[bcde]1
>
> I don't boot currently from that raid, but it should work fine, if you
> told the mdadm package to include boot raid support.
>
almost there ;)

i tried to follow the how-to-forge article on raid1 installation for a
running system, replacing it with raid10.
this seems to work nicely, attached my notes based on the original article.
until the very last final step that is, getting the final raid10 to
boot, i'm not having much luck with grub, i'm receiving grub error 2 at
the moment for all 4 disks.

before i continue on this path i want to ask if it is possible at all.
md0 /root
md1 /swap
md2 /data

so all 3 as RAID10 and no seperate /boot

so here's the question.
1 this is possible and am i just to big a noob to get the correct grub
parameters
2 this is not possible so i should use a seperate /boot in raid1






How To Set Up Software RAID1 On A Running System (Incl. GRUB Configuration) (Debian Etch)

Version 1.0
Author: Falko Timme <ft [at] falkotimme [dot] com>
Last edited 11/26/2007

This guide explains how to set up software RAID1 on an already running Debian Etch system. The GRUB bootloader will be configured in such a way that the system will still be able to boot if one of the hard drives fails (no matter which one).

I do not issue any guarantee that this will work for you!

 
1 Preliminary Note

In this tutorial I'm using a Debian Etch system with two hard drives, /dev/sda and /dev/sdb which are identical in size. /dev/sdb is currently unused, and /dev/sda has the following partitions:

    * /dev/sda1: /boot partition, ext3;
    * /dev/sda2: swap;
    * /dev/sda3: / partition, ext3

In the end I want to have the following situation:

    * /dev/md0 (made up of /dev/sda1 and /dev/sdb1): /boot partition, ext3;
    * /dev/md1 (made up of /dev/sda2 and /dev/sdb2): swap;
    * /dev/md2 (made up of /dev/sda3 and /dev/sdb3): / partition, ext3

This is the current situation:

df -h

host:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdc1             4.6G  453M  4.0G  11% /
tmpfs                 4.0G     0  4.0G   0% /lib/init/rw
udev                   10M   60K   10M   1% /dev
tmpfs                 4.0G     0  4.0G   0% /dev/shm


fdisk -l

host:~# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         608     4883728+  83  Linux
/dev/sdb2             609       60801   483500272+   5  Extended
/dev/sdb5             609         669      489951   82  Linux swap / Solaris
/dev/sdb6             670       60801   483010258+  8e  Linux LVM

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sde: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sdf: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System



 
2 Installing mdadm

The most important tool for setting up RAID is mdadm. Let's install it like this:

apt-get install initramfs-tools mdadm

You will be asked the following question:

MD arrays needed for the root filesystem: <-- all

Afterwards, we load a few kernel modules (to avoid a reboot):

modprobe md
modprobe linear
modprobe multipath
modprobe raid0
modprobe raid1
modprobe raid5
modprobe raid6
modprobe raid10

Now run

cat /proc/mdstat

The output should look as follows:

server1:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
unused devices: <none>
server1:~#

in case there are still active arrays
mdadm --fail /dev/md3 /dev/sdb5
mdadm --stop /dev/md3
 
3 Preparing /dev/sdb

To create a RAID1 array on our already running system, we must prepare the /dev/sdb hard drive for RAID1, then copy the contents of our /dev/sda hard drive to it, and finally add /dev/sda to the RAID1 array.

First, we copy the partition table from /dev/sda to /dev/sdb so that both disks have exactly the same layout:

sfdisk -d /dev/sdb | sfdisk /dev/sdd
sfdisk -d /dev/sdb | sfdisk /dev/sde
sfdisk -d /dev/sdb | sfdisk /dev/sdf

The output should be as follows:

server1:~# sfdisk -d /dev/sda | sfdisk /dev/sdb
Checking that no-one is using this disk right now ...
OK

Disk /dev/sdb: 652 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
 /dev/sdb: unrecognized partition table type
Old situation:
No partitions found
New situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/sdb1   *        63    289169     289107  83  Linux
/dev/sdb2        289170   1285199     996030  82  Linux swap / Solaris
/dev/sdb3       1285200  10474379    9189180  83  Linux
/dev/sdb4             0         -          0   0  Empty
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
server1:~#

The command

fdisk -l

should now show that both HDDs have the same layout:

server1:~# fdisk -l

Disk /dev/sda: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          18      144553+  83  Linux
/dev/sda2              19          80      498015   82  Linux swap / Solaris
/dev/sda3              81         652     4594590   83  Linux

Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          18      144553+  83  Linux
/dev/sdb2              19          80      498015   82  Linux swap / Solaris
/dev/sdb3              81         652     4594590   83  Linux
server1:~#

Next we must change the partition type of our three partitions on /dev/sdb to Linux raid autodetect:

fdisk /dev/sdd

server1:~# fdisk /dev/sdd

Command (m for help): <-- m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): <-- t
Partition number (1-4): <-- 1
Hex code (type L to list codes): <-- L

 0  Empty           1e  Hidden W95 FAT1 80  Old Minix       be  Solaris boot
 1  FAT12           24  NEC DOS         81  Minix / old Lin bf  Solaris
 2  XENIX root      39  Plan 9          82  Linux swap / So c1  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  83  Linux           c4  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 5  Extended        41  PPC PReP Boot   85  Linux extended  c7  Syrinx
 6  FAT16           42  SFS             86  NTFS volume set da  Non-FS data
 7  HPFS/NTFS       4d  QNX4.x          87  NTFS volume set db  CP/M / CTOS / .
 8  AIX             4e  QNX4.x 2nd part 88  Linux plaintext de  Dell Utility
 9  AIX bootable    4f  QNX4.x 3rd part 8e  Linux LVM       df  BootIt
 a  OS/2 Boot Manag 50  OnTrack DM      93  Amoeba          e1  DOS access
 b  W95 FAT32       51  OnTrack DM6 Aux 94  Amoeba BBT      e3  DOS R/O
 c  W95 FAT32 (LBA) 52  CP/M            9f  BSD/OS          e4  SpeedStor
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi eb  BeOS fs
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a5  FreeBSD         ee  EFI GPT
10  OPUS            55  EZ-Drive        a6  OpenBSD         ef  EFI (FAT-12/16/
11  Hidden FAT12    56  Golden Bow      a7  NeXTSTEP        f0  Linux/PA-RISC b
12  Compaq diagnost 5c  Priam Edisk     a8  Darwin UFS      f1  SpeedStor
14  Hidden FAT16 <3 61  SpeedStor       a9  NetBSD          f4  SpeedStor
16  Hidden FAT16    63  GNU HURD or Sys ab  Darwin boot     f2  DOS secondary
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fd  Linux raid auto
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fe  LANstep
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid ff  BBT
1c  Hidden W95 FAT3 75  PC/IX
Hex code (type L to list codes): <-- fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): <-- t
Partition number (1-4): <-- 1
Hex code (type L to list codes): <-- fd
Changed system type of partition 2 to fd (Linux raid autodetect)

Command (m for help): <-- t
Partition number (1-4): <-- 5
Hex code (type L to list codes): <-- fd
Changed system type of partition 3 to fd (Linux raid autodetect)

Command (m for help): <-- w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
server1:~#

To make sure that there are no remains from previous RAID installations on /dev/sdb, we run the following commands:

mdadm --zero-superblock /dev/sdb1
mdadm --zero-superblock /dev/sdb2
mdadm --zero-superblock /dev/sdb3

If there are no remains from previous RAID installations, each of the above commands will throw an error like this one (which is nothing to worry about):

server1:~# mdadm --zero-superblock /dev/sdb1
mdadm: Unrecognised md component device - /dev/sdb1
server1:~#

Otherwise the commands will not display anything at all.

4 Creating Our RAID Arrays

Now let's create our RAID arrays /dev/md0, /dev/md1, and /dev/m