Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto raid1 on SATA
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
nove
n00b
n00b


Joined: 01 Oct 2004
Posts: 20

PostPosted: Wed Jul 20, 2005 3:48 pm    Post subject: Howto raid1 on SATA Reply with quote

Since weeks iam installing multiple Servers with a raid1 sata system. After Searching and Searching i havent found a tutorial that explained all features
of an setup of an raid1 system. So i have had the amusement to find out the most thing (important things) by myself or i have to interpret the other tutorials.

System:
2 x SATA HDD
1 x VIA SATA Controller PCI

1st. HDD: sda
2nd. HDD: sdb


Raidlevel: 1

Ok lets beginn:
Start your Engines Gentlemens .... favored with a Gentoo 2005 Live CD.

1st.
Loading the Kernel - Modul
Code:
mobprobe raid1


2.nd

do the fdisk thing on your Harddisk like this:

for boot: 128MB
for swap: 1024MB
for / : the rest

do this for both HDDs sda and sdb!!

now lets make these md devices, we need three: md0, md1 and md2
Code:

mknod /dev/md0 b 9 0
mknod /dev/md1 b 9 1
mknod /dev/md2 b 9 2


if this operation is succsesfull lets make the raid.
Code:

mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
mdadm --create --verbose /dev/md2 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3


Note: If you have only a simple Raid-Controller like a via on board or an simple PCI-Raid Controller dont try to make your Raid on the Controller
it maybe happend that your receive an error message like "Device or Recource busy" when you try to do the mdadm --create command.

you can now drink a cup of coffee while you are watching this:
Code:

watch -n1 'cat /proc/mdstat'


then you have to do this:
Code:
mdadm --detail --scan >/etc/mdadm.conf


ok when this is done, do the gentoo setup like the handbook shows you but before you
make chroot, copy the /etc/mdadm.conf to /mnt/gentoo/etc/mdadm.conf and remember your device names md0,md1,md2. you can
handle them like a normal /dev/somethinghdd

Code:
cp -L /etc/mdadm.conf  /mnt/gentoo/etc/mdadm.conf


if you come to the kernel configuration you have to do this:

    compile raid1 support into kernel, this can be found under device-drivers->Multi-device support (RAID and LVM)
    -compile Device Mapper support into the kernel this can also be found under device-drivers->Multi-device support (RAID and LVM)
    -Install some userspace tools:

Code:

emerge device-mapper
emerge raidtools
emerge mdadm


then follow the gentoo handbook until you come to the grub installation.
Code:

emerge grub

Code:
grub --no-floppy

Code:
#setup MBR on /dev/sda
root (hd0,0)
setup (hd0)
#setup MBR on /dev/sdb
device (hd0) /dev/sdb
root (hd0,0)
setup (hd0)
quit


edit your grub.conf
Code:
# Boot automatically after 30 secs.
timeout 30
splashimage=(hd0,0)/grub/splash.xpm.gz
# By default, boot the first entry.
default 0

# Fallback to the second entry.
fallback 1

# For booting with disc 0 kernel
title  GNU/Linux (hd0,0)
root (hd0,0)
kernel (hd0,0)/kernel-2.6.11-gentoo-r3 root=/dev/md2

# For booting with disc 1 kernel, if (hd0,0)/bzImage is unreadable
title  GNU/Linux (hd1,0)
root (hd1,0)
kernel (hd1,0)/kernel-2.6.11-gentoo-r3 root=/dev/md2


and now dont forget to do that:
Code:
 cp /proc/mounts /etc/mtab


the fstab file should look like this:

Code:
/dev/md0                /boot           ext2            noauto,noatime          1 1
/dev/md2                /               ext3            noatime                 0 0
/dev/md1                none            swap            sw                      0 0

so then follow the Handbook again and be happy!!

some other tutorials:

http://gentoo-wiki.com/HOWTO_Gentoo_Install_on_Software_RAID
http://www.gentoo.org/doc/en/gentoo-x86-tipsntricks.xml#software-raid

In the next days i will reformat this tutorial to make it easier to read (and ill work on my english)


Last edited by nove on Fri Jul 22, 2005 6:25 am; edited 5 times in total
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2526
Location: Denmark

PostPosted: Wed Jul 20, 2005 7:40 pm    Post subject: Reply with quote

here:
http://gentoo-wiki.com/HOWTO_Gentoo_Install_on_Software_RAID
_________________
linux: #232767
Back to top
View user's profile Send private message
nove
n00b
n00b


Joined: 01 Oct 2004
Posts: 20

PostPosted: Thu Jul 21, 2005 3:56 am    Post subject: Reply with quote

I know that tutorial and much more others but its difficult to get something to work if the tutorial discribes
only the half thing and imporatant things like the right grub configuration or the note that you have to copy
/proc/mounts into mtab arent there. So i think my tutorial is simple enough that a nOOb can do raid1 with
sata devices.
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2526
Location: Denmark

PostPosted: Thu Jul 21, 2005 11:27 am    Post subject: Reply with quote

its a wiki, why don't you add to it ?!
_________________
linux: #232767
Back to top
View user's profile Send private message
nove
n00b
n00b


Joined: 01 Oct 2004
Posts: 20

PostPosted: Thu Jul 21, 2005 12:05 pm    Post subject: Reply with quote

good idea... when i found the time for it ill do.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum