How To Install Linux Software-Raid on Debian 3.1, 3.1r1a & Ubuntu 5.10

Want to support HowtoForge? Become a subscriber!
 
Submitted by patjec (Contact Author) (Forums) on Thu, 2005-10-27 17:50. :: Linux | Storage

How To Install Linux Software-Raid

Thanks to these people and their FAQ:

Emidio Planamente's pages: http://www.planamente.ch/emidio/pages/linux_howto_root_lvm_raid.php and Tado's serverconfig pages at http://howtoforge.com.

Tested with these distros: Debian 3.1 & 3.1r1a sarge, Ubuntu-server 5.10 "The Breezy Badger Release".

While testing ISPconfig according to the http://howtoforge.com/perfect_setup_ubuntu_5.10 tutorial I wanted to add RAID1 on my server. I followed all the instructions from http://howtoforge.com/perfect_setup_ubuntu_5.10_p2 and changed things after:

"I will use the following partition scheme:

/boot 50 MB
/swap 1GB
/ 10 GB
/var the rest of the hard disk"

I created the partitions on both hard disks (hda + hdb) as above (sizes optimized for my system) but instead of ext3 as file system chose Linux RAID for all 8 partitions (2 * 4, 4 on each disk).

After you created these partitions with identical sizes on both drives, start Configure Software Raid. This is the entry for working with mdadm (http://freshmeat.net/projects/mdadm/).

Create a RAID system of your choice. You can set up RAID0, RAID1 or RAID5. I have 2 hard disks, backup is the primary task, so I chose RAID1. Now it is time to connect the partitions on hda and hdb and create the RAID1 arrays.

Pick 2 equal partitions and bind them as an array. Do this with all 8 partitions and you get 4 RAID1 arrays. Close the RAID configure screen and you see on the partition screen 4 new RAID1 entries.

Open them one by one by. Scroll to the first one and press enter. Change type from RAID to your preferred file system and choose a mount point (for me: first one ext3 and /boot; second one swap; third one ext3 and /; the fourth one ext3 and /var). Go to Save and be very patient. On my server I had to stop with anything because the system slowed down dramatically for over one hour.

You can verify the build of the array's on a second console (ALT + F2) and repeatedly typing

cat /proc/mdstat on Ubuntu 5.1

or

watch cat /proc/mdstat on Debian 3.1 and newer.

You can see the build of the RAID arrays that way. After the build you have something like:

root@server1:/home/patje/install_ispconfig# cat /proc/mdstat
Personalities : [raid1]md3 : active raid1 sda4[0] sdb4[1] 133596416 blocks [2/2] [UU]
#Creating%20RAID%20devices md2 : active raid1 sda3[0] sdb3[1] 24410688 blocks [2/2] [UU]
md1 : active raid1 sda2[0] sdb2[1] 1951808 blocks [2/2] [UU]
md0 : active raid1 sda1[0] sdb1[1] 120384 blocks [2/2] [UU]
unused devices: <none>

After this the Debian / Ubuntu installer does the rest of the installation. Now take your time and study the mdadm (http://freshmeat.net/projects/mdadm) tools.Have fun...


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by skua-57 (registered user) on Wed, 2006-09-13 08:08.

Couple of questions: 
1. Why ext3fs? Why not  Raiserfs (which is a journaling fs)?
2. Why bother with RAID1 for your system partitions? If you have a single user system, who cares about the system partition; you're upgrading all the time anyway. It's your documents an photos that are irreplaceable. On the other hand, if you run a criticle server, maybe you can justify RAID... but then you have to keep an eye on the logs all the time.
Which is it?

 What does your /etc/fstab file look like for a RAID?  Does the linux installation know how to create it, or does the user have to tinker with /etc/fstab?

Is your RAID transparent, as a file system, when you boot to a Live-CD?   Can you fix stuff easily by booting to a live CD if you have to?

 What do you put into the grub setup to cause RAID support to be loaded, if your kernel doesn't have RAID compiled in?

 skua

 

Submitted by Anonymous (not registered) on Sun, 2006-02-26 08:47.
just like to say thank you -- worked for me, after a couple of false starts, lol. I'm a newbie too -- and an old geezer to boot (57) ;-)
Submitted by Anonymous (not registered) on Sat, 2006-03-11 05:28.
Yea me too...thanks!
Submitted by Anonymous (not registered) on Thu, 2005-11-10 15:43.
Followed your instructions and all went well until the attempt to install GRUB failed. I tried LILO and it too failed. Is there something else I need to do that everyone with linux experience knows about but a newbie would not? Should I just ignore the error and plow on?
Submitted by John Byrne (not registered) on Mon, 2009-05-04 03:44.
grub should be on its own partition and should for the sake of simplicity the boot partition should be the first partition on the first disk and 150 mb is a good size it should be formatted with ext2 or ext3 and swap should be on the last drive if you want to keep it simple i like to use the raid for "/" and install grub in the mbr
Submitted by Anonymous (not registered) on Sun, 2006-01-29 23:11.
had a similar problem myself. When you say the GRUB and/or LILO installation failed do you mean it wouldn't boot after installation? This is the problem I had and it was due to the RAID support being loaded as a module and not compiled into the kernel. The easiest way round this is to create a new initrd that pre loads the RAID support.(Easier then compiling a new kernel!!) Then just configure LILO or GRUB to load that intrd and all should be well.
Submitted by Anonymous (not registered) on Sun, 2005-12-11 00:46.

Any thoughts on this very legitimate question? This is exactly the reason Linux will NEVER get to where Windows is. Somebody asks a question and it gets ignored because:

a) Nobody has a clue

b) The guy made the mistake of saying that he's a newbie, so it gets ignored. Frankly, I'm surprised that no one said something like RTFM you F____ newbie.

c) Nobody cares enough to answer this.

Guess what, I have the EXACT same problem. Additionally, how in the hell do you mirror a swap partition? Oh that's right. You DON'T!!

If linux experts don't get their heads out of their ass and start sharing the knowledge, Linux is doomed to fail or at the very least be controlled by big companies like Novell and the likes.

Submitted by John Byrne (not registered) on Mon, 2009-05-04 03:48.
Thats very wrong good luck doing software raid with windows have fun with that windows cant exist on a striped partition linux can be installed on a software raid however /boot must be on a separate partition as for ubuntu you need to grab the alternate install cd which is easy to setup a raid on not the standard install cd
Submitted by Anonymous (not registered) on Thu, 2006-06-29 12:51.

Why did you ask for help here? It says specifically after the article not to ask for help here but instead use the forums - there is even a link.

Calm down and ask for help in the forums.

And don't start a tirade why linux is bad and why people using linux don't share their knowledge - this is neither the right place nor the right time.

Submitted by Anonymous (not registered) on Fri, 2005-12-30 05:19.

Keep on your windowsbox then.

I was a newbie on linux too and got frustrated too, now i see that most questions are already on the net, its just you have to learn how to use the net. and by the way, raid systems are well overdocumented in many wiki pages. and thats what is wrong on windows machines, almost nobody takes time to learn what they are dealing with, A GOD a blue screen, what are those stupid numbers!!

on the other hand, this is a nice one too "i boot my system and god KERNEL panic" what did i do wrong :) whell thats a question that we could ANSWER NOT.

i think you could better be on your windows box if you like the point and click system, and never take the time to learn ALL the shells there (not only cmd and dos)

And if you want to find out more do more with your machine and like to figure things out yourself atleast take some time for it you could try linux, If you look good on the net its almost impossible that your question is not already asked. do a quick search on the subject in google news you will see what i mean

And linux will be a competeter off windows systems it will take a couple off years but they will stay.

and no i'm not a windows freak, neither am i a mac os2 linux or whatever for system freak, just used to work with all :)

grtz,

Ethereal

Submitted by Anonymous (not registered) on Sun, 2005-12-18 06:09.
you find this to be significantly different from windows?
Submitted by lance (registered user) on Sun, 2005-12-11 16:15.

Hi,

As I wrote in the howto here is how I let this work with MY hardware and Ubuntu5.10 /Debian 3.10. I tested both.


Why It doesn't work for you? Indeed I have no clue. The onlything I read is 'it doesn't work for me'. Maybe it's hardware related, maybe something else...

No, I'm also a 'newbee', I play with Linux since a 18 months or so.

Yes I care, but if you are not registred or don't take the time to mail me private, I am not starting a search to a clue in this comment section. This comment section is not build as a forum.


Ever called to Microsoft helpdesk? 250€ a call without being sure they give you a result... You get a tracking number and that's it.

Submitted by admin (registered user) on Sun, 2005-12-11 14:46.

"b) The guy made the mistake of saying that he's a newbie, so it gets ignored. Frankly, I'm surprised that no one said something like RTFM you F____ newbie."

If you had read three lines above you'd have seen this:

"Please do not use the comment function to ask for help! If you need help, please use our forum:
http://www.howtoforge.com/forums"

A forum is much better suited to answer questions like these because it has much more formatting options, a search function, etc.

In addition to that, noone ignores newbies here! Far from it, this is one of the most newbie-friendly places on the net. Have a look at the forum, and you'll understand why.

"c) Nobody cares enough to answer this."

Because he did not post in the forum. You can use comments to make annotations, share your thoughts, but obviously they are not very well suited to ask for help. I've pointed out the reasons for this before.

"If linux experts don't get their heads out of their ass and start sharing the knowledge, Linux is doomed to fail or at the very least be controlled by big companies like Novell and the likes."

You can't blame us for not sharing our knowledge, can you? We've written tons of tutorials, are spending several hours each day in the forum to help newbies and everyone else without benefitting from it financially. I don't think you would do something like that if you were in our place so please stop posting nonsense here, and if you have questions please go to the forum.

And please keep in mind: if you're friendly to us, we'll be friendly to you, so don't start flame-wars or the like.

Submitted by papa (registered user) on Thu, 2005-12-15 11:58.

wel, as i see NOBODY here does it right.

You CAN install a debian sarge with RAID 1 from the debian installer.

You DONT have to switch to other console for that.

lots of people forget to select the MDADM in de installer which makes you

able to create the raid volumes.

I'm going to make a howto how this is done.

And yes its difficualt in the beginnen, i took us about 10 installations to get the

order of creating partition etc to get RAID 1 on root from installer.

Submitted by lance (registered user) on Thu, 2005-12-22 17:53.
I wait for youre input and change the things in mine that you learn me. Thanks.
Submitted by lance (registered user) on Thu, 2005-11-10 22:40.
No, after that the installer from Debian / Ubunu (both tested) did all the rest.
Submitted by Anonymous (not registered) on Sat, 2005-12-10 14:42.
The Ubuntu 5.10 installer fails to install grub and lilo for me too. I am using 3 SATA drives (but no raid setup through BIOS) just the Linux software raid.
Submitted by Anonymous (not registered) on Thu, 2005-10-27 21:49.
instead of typing cat /proc/mdstat over and over again, you can simply use watch


so: watch cat /proc/mdstat

Submitted by lance (registered user) on Thu, 2005-12-22 17:56.
After the basic instalation 'watch' is not availble.