Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2004.3 software raid install howto
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
david.birch
n00b
n00b


Joined: 26 Nov 2004
Posts: 13

PostPosted: Fri Nov 26, 2004 7:11 am    Post subject: 2004.3 software raid install howto Reply with quote

hope this might help some others.... software raid caused a little more grief with latest CD's :( - my /dev/md<xx> entries were not appearing etc... (must say many thanks to many other posters who gave me all the info i have compiled =) )

so here was wot got my system humming along... (which is a vanilla p4 with IDE disks - tho i use this same method for my other comp which has SATA disks...)

Note also - i actually installed with my second disk missing (left at home....) - so i just substituted "missing" where ever my /dev/hdc<xx> entries were (and left out /dev/hdc<xx> from DEVICE line in mdadm.conf)


ok...firstly, load raid modules

#modprobe md

then, if none exist, create the /dev/md<xx> devices; (just add numbers as needed to for-loop)
Code:

#for i in 0 1 2 3 4 5 6 7 8 9 10; do mknod /dev/md$i b 9 $i; done


create your /etc/mdadm.conf file; (yes, in teh live cd enviro)

i have 6 partitions;
1. boot (/dev/hda1 & /dev/hdc1), this will be /dev/md0
2. win XP (*sigh*...) (/dev/hda2)
3. root (/dev/hda3 & /dev/hdc3), this will be /dev/md1
4. extended (/dev/hda4 & /dev/hdc4)
5. swap (/dev/hda5 & /dev/hdc5), this will be /dev/md2
5. big data partition (/dev/hda6 & /dev/hdc6), this will be /dev/md3

so my mdadm.conf file is

Code:

DEVICE /dev/hda1 /dev/hda3 /dev/hda5 /dev/hda6
DEVICE /dev/hdc1 /dev/hdc3 /dev/hdc5 /dev/hdc6

ARRAY /dev/md0 devices=/dev/hda1,/dev/hdc1
ARRAY /dev/md1 devices=/dev/hda3,/dev/hdc3
ARRAY /dev/md2 devices=/dev/hda5,/dev/hdc5
ARRAY /dev/md3 devices=/dev/hda6,/dev/hdc6




after you have your mdadm.conf file, you can create the arrays:

i am using raid 1, so i modprobe raid1,

Code:

#modprobe raid1

# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hda1 /dev/hdc1
mdadm: array /dev/md0 started.
# mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/hda3 /dev/hdc3
mdadm: array /dev/md1 started.
# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/hda5 /dev/hdc5
mdadm: array /dev/md2 started.
# mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/hda6 /dev/hdc6
mdadm: array /dev/md3 started.


next... you can see if this worked by doing
Code:

#cat /proc/mdstat


and you should see all the info about your raid arrays...

then.. create your file systems as normal on your /dev/md<xx> devices eg...;
#mkefs /dev/md0 (for ext2) or;
#mkswap /dev/md2

i personally use reiserfs for my root & data partitions, and ext2 for boot.



ok, now follow normal install instructions other than -

1. MAKE SURE TO COMPILE INTO kernel RAIDsupport (under raid/lvm section in device drivers...)

2. emerge raidtools

3. copy your mdadm.conf file into your chrooted enviro

4. i find that when i chroot, i lose the /dev/md<xx> entries, so have to run the "for i in 0 1 2 3 4 5 6 7 8 9 10; do mknod /dev/md$i b 9 $i; done"
command gain inside the chrooted enviro...

5. make sure fstab has correct entries - like /boot set to /dev/md0 (or whatever # you have configured...)

6. If you want both disks to boot in the event of failure - make sure to install grub/lilo into both disks boot sectors!



Addendum....

OK - setup failed & the system won't boot, and you need to acces your "raided" up partitions...

boot with your live cd.

load raid modules,

#modprobe md

then, if none exist, create the /dev/md<xx> devices;

#for i in 0 1 2 3 4 5 6 7 8 9 10; do mknod /dev/md$i b 9 $i; done

re-create the mdadm.conf file.

load raidXX, eg
#modprobe raid1

re-assemble your raid arrays...

#mdadm --assemble /dev/md0
mdadm: /dev/md0 has been started ....

and now you should be able to re-mount them (like "mount /dev/md1 /mnt/gentoo" ) and fix ur probs... :wink:


Last edited by david.birch on Sat Dec 18, 2004 3:24 pm; edited 2 times in total
Back to top
View user's profile Send private message
ddoherty03
n00b
n00b


Joined: 24 Feb 2004
Posts: 38

PostPosted: Fri Nov 26, 2004 8:14 am    Post subject: Software RAID Reply with quote

david.birch,

Thanks for the summary of the raid process.

How does LVM relate to raid? Can you raid-up two disks them allocate partitions, etc under LVM?

Have you tried this?

Gracias.
Back to top
View user's profile Send private message
david.birch
n00b
n00b


Joined: 26 Nov 2004
Posts: 13

PostPosted: Fri Nov 26, 2004 9:35 pm    Post subject: Reply with quote

sorry, i guess i was a little mis-leading - all i meant was to make sure you do compile in raid support, which is under the raid/LVM section in device drivers for kernel.

i have zero knowledge of LVM...
Back to top
View user's profile Send private message
Tux_001
n00b
n00b


Joined: 23 Oct 2003
Posts: 7

PostPosted: Mon Nov 29, 2004 4:50 pm    Post subject: Reply with quote

Hey man thanks for the tips ... I just have buy a new PC with a P5AD2 Premium board and 2 maxtor disk configure in raid0 for windows. I'm looking on how I can get linux installed together with my windows. When I boot with a gentoo 2004.3 live cd ... I can't see my sata disk in /dev like it should be (no /dev/sda and no /dev/sdb). What can I do ?
Back to top
View user's profile Send private message
david.birch
n00b
n00b


Joined: 26 Nov 2004
Posts: 13

PostPosted: Tue Nov 30, 2004 11:06 am    Post subject: Reply with quote

hrm, are you running hardware raid 0 ? that mobo looks like the next gen of the one i bought, which has on-board raid, which i haven't actually used yet (the software raid is quite different, but has features i like...).

if you are using hardware raid, then you might not see /dev/sdXX etc, you probably need a hardware raid driver (look at the ICH6R drivers)
Back to top
View user's profile Send private message
Tux_001
n00b
n00b


Joined: 23 Oct 2003
Posts: 7

PostPosted: Tue Nov 30, 2004 12:50 pm    Post subject: Reply with quote

Thanks for your reply .... It will try it :)
Back to top
View user's profile Send private message
NicolBolas
n00b
n00b


Joined: 23 Apr 2003
Posts: 13
Location: Vernon, Normandy, France

PostPosted: Tue Dec 14, 2004 1:26 pm    Post subject: Reply with quote

What's the point in mirroring the SWAP? I'd rather use 2 independant swap partitions but activate them with the same priority, wich makes the kernel naturally stripe over both swaps...
_________________
never forget that a cray is the only one arch that can run an endless loop in only 4 hours
Back to top
View user's profile Send private message
ryanontherun
n00b
n00b


Joined: 01 Oct 2004
Posts: 9
Location: Seattle, WA

PostPosted: Wed Dec 15, 2004 1:02 am    Post subject: Reply with quote

Quote:
What's the point in mirroring the SWAP? I'd rather use 2 independant swap partitions but activate them with the same priority, wich makes the kernel naturally stripe over both swaps...


I was wondering that as well. In another RAID howto I read it was said you couldn't use raid for the swap partition (I believe it was a raid0 guide). It was said almost in passing so I'm wondering if it's true... Could you use raid0 for the swap partition? If yes, would you want to or would that essentially be the same as setting 2 swap partitions to the same priority (would there be a performance increase/penelty) And as NicolBolas asked, Why would you want to use raid 1 for your swap partition? Seems like it would be slower and pointless...
Back to top
View user's profile Send private message
mieses
Tux's lil' helper
Tux's lil' helper


Joined: 28 Feb 2004
Posts: 105

PostPosted: Fri Dec 17, 2004 6:59 pm    Post subject: Reply with quote

Bootable software RAID is possible as long as it is RAID 1.

This howto was useful. Thanks for posting it.

You have one small typo:
# cat /proc/mdstat
(not mdsat)
Back to top
View user's profile Send private message
david.birch
n00b
n00b


Joined: 26 Nov 2004
Posts: 13

PostPosted: Sat Dec 18, 2004 3:29 pm    Post subject: for the queries on raid1 & swap Reply with quote

for the queries on raid1 & swap.. the whole point of raid 1 is failure prevention, so yes raid 1 of the swap is what you want to complete the system - otherwise if swap goes bung, what will the system do?
I use this setup for production servers, which don't run with much swap, i prefer physical memory :) my swap usage generally never gets above more than a few megs. In the case where swap is highly utilised, maybe this would add significant overhead, so maybe some other solution?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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