LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 07-08-2007, 06:23 PM   #1
rtspitz
Member
 
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Rep: Reputation: 32
software raid - device rearrangement after reboot when drives are disconnected


some experts' advice needed here !

before you smite me for using software raid, let me tell you that I do use a hardware raid controller - but just for the data disks as this baby wasn't cheap ;-(

the software-raid problem I run into is this:

I have 4 sata ports on my mainboard, 2 of which provided by the southbridge and 2 extra ports come from some promise chip.
2 sata disks are connected to controller A (further on named CA), a hot spare sata disk is connected to controller B (further on named CB).
So my system sees a total of 4 sata disk, 3 used for software raid and the last one is my hardware raid controller (3ware).
2 of these disks on CA form a raid1 array, disk 3 on CB is configure to be a hot spare. there are 2 raid devices /dev/md0 and /dev/md1, /dev/md1 is used as a physical volume for LVM. all of this works great. I should mention that I also boot from /dev/md0 (not lvm-ed), which is the reason for my "little" problem.

As long as I use mdadm to fake disk-failures the system runs fine, as the disks aren't really gone (block devices still there).
But if I power down my system and physically remove one of those 3 disks, something bad happens to grub's device mapping. As far as I understand CA and CB do not report missing disks to linux, so if one disk goes missing grub's device mapping goes bad and it cannot boot the kernel anymore. Fortunately my fstab file only uses lvm and raid devices which get assigned automatically during initrd bootup.

So what I'm asking is this: is there a way to assign a device mapping in some way that doesn't get mixed up if my mobo's bios thinks some disks aren' there ?

Can GRUB boot from disks by looking at the raid superblock maybe ?
Or instead of: "root (hd2,0)" use something like "root /dev/md0" or "root /dev/disk/by-uuid/...." ?

Just in case you're thinking to tell me to get a 2nd hardware raid controller, I might do that in the end. But let's see what you can come up with first ;-)

If you need some more info for clarification, let me know.

Last edited by rtspitz; 07-08-2007 at 06:33 PM.
 
Old 07-08-2007, 06:31 PM   #2
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Rep: Reputation: 121Reputation: 121
One of the problems faced by those using Software RAID is the fact that the BIOS numbers the drives before it passes things off to the first sector of the boot device. So, if you remove the boot device configured in the BIOS, then, unless you have grub on the second drive, there's no drive to boot from.

The thing I don't know about for sure is what happens if you were to remove the second drive. Does the BIOS then renumber the drives so that #3 becomes #2 and #4 (perhaps your hardware RAID controller) becomes #3? I would expect that it would.

I've never used drive labeling, but I wonder if (with the exception of drive 1 problems) this would be a way to address your problem?
 
Old 07-08-2007, 06:45 PM   #3
rtspitz
Member
 
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Original Poster
Rep: Reputation: 32
If I remove say disk 1, my machine boots form disk 2. so I guess drive numbers are shifted around. And that gets to the point where grub is loaded (I installed grub on all 3 drives) but as those numbers don't match anymore the kernel won't get loaded.

I'm on the safe side as soon as I physically replace the faulty disks and the system is back to it's initial state with the drive numbers back to "normal". I guess I can forget about getting my bios to do persistent numbering of drives.

Oh well.... I'll have a look at grub's manual I guess.

Last edited by rtspitz; 07-08-2007 at 06:47 PM.
 
Old 07-08-2007, 06:50 PM   #4
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Rep: Reputation: 121Reputation: 121
You could also get a spare drive, and just chuck it in the "failed" slot for testing. You'll be doing that if a drive actually does fail, right? You do have a spare drive, don't you?
 
Old 07-08-2007, 07:12 PM   #5
rtspitz
Member
 
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Original Poster
Rep: Reputation: 32
Hot spare that is, already in there. I like to have auto-rebuild as my "security blanket".
 
Old 07-08-2007, 08:00 PM   #6
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Rep: Reputation: 121Reputation: 121
Quote:
Originally Posted by rtspitz
Hot spare that is, already in there. I like to have auto-rebuild as my "security blanket".
Yeah, but is that for your hardware RAID? If it is, then it doesn't sound like what's required for the software array. I think you probably need a cold spare for that. But, I could be wrong. I wish one of the handful of experts on software arrays here would chime in, here.
 
  


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
How to setup a software RAID 5 using IDE drives? kitek Linux - Newbie 2 03-17-2007 07:30 PM
Software RAID-5 to regular drives...Possible without complete reformat? andrewjschmidt Linux - Software 3 08-15-2004 10:18 AM
Software raid 5 always missing 1 disk after reboot birkinshawc Linux - Hardware 0 05-20-2004 10:57 PM
Software RAID: 4 drives at once? GaX Linux - Hardware 2 01-08-2004 10:21 AM
Upgrading hard drives on Software raid 1 boot drives. linuxboy123 Linux - General 0 12-11-2003 03:28 PM


All times are GMT -5. The time now is 06:05 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration