LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-12-2006, 09:52 PM   #1
Akhran
Member
 
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Rep: Reputation: 30
Can I have RAID 1 and RAID 5 with 3 HDDs?


I have partitioned my 3 harddisks into the following configuration:

/boot 100MB with RAID1 on sda1, sdb1, sdc1
swap 1GB with RAID5 on sda2, sdb2, sdc2
/ the rest of the harddisk space with RAID5 on sda3, sdb3, sdc3

After reboot, I installed GRUB on sdb and sdc:

# grub
# > device (hd0) /dev/sdb
# > root (hd0,0)
# > setup (hd0)
# > device (hd0) /dev/sdc
# > root (hd0,0)
# > setup (hd0)
# > quit
#

To simulate a harddisk failure, I unplugged sda. During bootup, I have the following error output:

Code:
Assembling RAID array md2...done (already running).
Assembling RAID array md0...failed (no devices found).
Assembling RAID array md1...failed (no devices found).
Assembling RAID array md2...done (already running).
Will now check all file systems.
fsck 1.39 (29-May-2006)
Checking all file systems.
[/sbin/fsck.ext2 (1) -- /boot] fsck.ext2 -a -C0 /dev/md0
fsck.ext2: Invalid argument while trying to open /dev/md0
/dev/md0:
The superblock could not be read or does not describe a correct ext2 file system. 
If the device is valid and it really contains an ext2 filesystem ( and not swap 
or ufs or something else), then the superblock is corrupt, and you might try running 
e2fsck with an alternate superblock:

e2fsck - b 8193 <device>

fsck died with exit status 8

File system check failed.

A maintenance shell will now be started.
Is it because RAID1 and RAID5 don't play nice together on the same system?

Appreciate any help on this.

Thanks !

Last edited by Akhran; 10-12-2006 at 10:00 PM.
 
Old 10-12-2006, 11:47 PM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
I don't think it is possible to have RAID 1 across 3 disks. Raid 1 is a mirror, I I don't believe you can have 3 sides to a mirror.

Raid 5 is much better than RAID 1. Even though you're doing software RAID as opposed to hardware, since you have the 3 disks, you may as well run 5 instead of a half cocked 1. You also shouldn't need to install grub on each drive, just install it once, and the software RAID should copy it.

Peace,
JimBass
 
Old 10-13-2006, 01:17 AM   #3
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
You should not set swap as RAID-5, RAID-0, or any RAID level. It is stupid to have reduntant swap. For speed, just make a swap partition on each hard drive. Then specify the priority to the same number. The kernel will do RAID-0 automatically.

I only recommend software RAID-5 for multi-processor systems because it needs a lot of computer resources.

RAID-5 is not always better than RAID-1 or RAID-0. RAID-5 is great if you are creating it on a hardware controller or using it with a multi-processor system. RAID-5 can do multiple writes but accessing files are as fast a single hard drive. RAID-1 can access multiple files at once depending on how many drives in the mirror. Its writes are as fast as a single hard drive. RAID-0 can only write and read one file at a time, but has higher throughput than RAID-5. For an OS drive, I suggest RAID-1.

Using software RAID will not copy the master boot record. It will only copy the data on a partition in the array. Grub is not RAID friendly. LILO is RAID friendly but it is harder to setup and sometimes you will forget to run /sbin/lilo after changing the config file.

The test actually worked. RAID-5 needs three disks to work. In order to bring up a RAID-5 for your setup, you need four disks or include a hot spare.
 
Old 10-13-2006, 04:36 AM   #4
Akhran
Member
 
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Original Poster
Rep: Reputation: 30
Hi Electro, based on your advice, am I right to say that the following configuration is right?

swap 512MB (total 1.5GB) on each of the 3 disks at sda1, sdb1, sdc1
/boot 100MB RAID1 (/dev/md0) on all 3 disks at sda2, sdb2, sdc2
/ rest of the partitions on RAID5 (/dev/md1) on all 3 disks at sda3, sdb3, sdc3

Following the installation, I installed Grub on sdb1 and sdc1.

However, when I unplug sda and boot the system, I have the same error as in my first post. System hangs at : A maintenance shell will now be started.

Code:
Assembling RAID array md1...done (already running).
Assembling RAID array md0...failed (no devices found).
Assembling RAID array md1...done (already running).
Will now check all file systems.
fsck 1.39 (29-May-2006)
Checking all file systems.
[/sbin/fsck.ext3 (1) -- /boot] fsck.ext3 -a -C0 /dev/md0
fsck.ext3: Invalid argument while trying to open /dev/md0
/dev/md0:
The superblock could not be read or does not describe a correct ext2 file system. 
If the device is valid and it really contains an ext2 filesystem ( and not swap 
or ufs or something else), then the superblock is corrupt, and you might try running 
e2fsck with an alternate superblock:

e2fsck - b 8193 <device>

fsck died with exit status 8

File system check failed.

A maintenance shell will now be started.
Could you also elaborate on the 4 disks requirement for my setup?

Any advice would be appreciated.

Thanks!


Quote:
Originally Posted by Electro
You should not set swap as RAID-5, RAID-0, or any RAID level. It is stupid to have reduntant swap. For speed, just make a swap partition on each hard drive. Then specify the priority to the same number. The kernel will do RAID-0 automatically.

I only recommend software RAID-5 for multi-processor systems because it needs a lot of computer resources.

RAID-5 is not always better than RAID-1 or RAID-0. RAID-5 is great if you are creating it on a hardware controller or using it with a multi-processor system. RAID-5 can do multiple writes but accessing files are as fast a single hard drive. RAID-1 can access multiple files at once depending on how many drives in the mirror. Its writes are as fast as a single hard drive. RAID-0 can only write and read one file at a time, but has higher throughput than RAID-5. For an OS drive, I suggest RAID-1.

Using software RAID will not copy the master boot record. It will only copy the data on a partition in the array. Grub is not RAID friendly. LILO is RAID friendly but it is harder to setup and sometimes you will forget to run /sbin/lilo after changing the config file.

The test actually worked. RAID-5 needs three disks to work. In order to bring up a RAID-5 for your setup, you need four disks or include a hot spare.

Last edited by Akhran; 10-14-2006 at 10:03 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SATA RAID 0 errors on bootup -- invalid raid superblock vonst Slackware 3 07-04-2006 04:55 PM
Perc3Di SCSI RAID + Adaptec 2810SA RAID = Fatal Grub Error? LinuxOnTheEdge Linux - General 2 03-19-2005 03:35 PM
does linux support the sata raid and ide raid in k7n2 delta ilsr? spyghost Linux - Hardware 10 04-16-2004 06:27 AM
Debian Woody r1 Installer won't detect SATA RAID HDDs on SiI 3122A bluPSU Linux - Hardware 11 01-20-2004 04:36 PM
moving system from ide software raid to new box with scsi raid ftumsh Linux - General 0 10-28-2003 10:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration