LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-21-2009, 08:24 PM   #1
Oxagast
Member
 
Registered: Aug 2003
Location: Mocksville, NC, USA
Distribution: Gentoo, Slackware.
Posts: 410

Rep: Reputation: 30
Nothing sees my software raid


Hi,
I have a software raid setup. I have raid-1 on /dev/hda1 and /dev/hdb1, and I want to use it as a boot partition. I use raid-0 on /dev/hda3 and /dev/hdb3 and want to use that as the / partition. Nothing seems to be able to "see" it though. Even if I use MAKEDEV it doesn't create the devices /dev/md1 and /dev/md3 correctly (it creates them, but they don't work). I have lilo setup to use /dev/md3 as the root. The only way I can see my array is if I use a live cd (in this case my distro's) and do:

Code:
mknod /dev/md1 b 9 1
mknod /dev/md3 b 9 3
mdadm --assemble /dev/md1 /dev/hda1 /dev/hdb1
mdadm --assemble /dev/md3 /dev/hda3 /dev/hdb3
Then I can mount the partitions and they work fine. But when I try to boot, The kernel will boot up until it says it's autodetecting raid devices and then says 0 are found, then says unable to read superblock, no filesystem could mount root.
Then the kernel panics with "not sync VFS: unable to mount root fs on unknown block 9,3".

I tried putting mdadm's info about the arrays into /etc/mdadm.conf but that didn't make a difference.

I have raid-1 and raid-0 compiled into my kernel.

I created the raid with:
Code:
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/hda1 /dev/hdb1
mdadm --create /dev/md3 --level=0 --raid-devices=2 /dev/hda3 /dev/hdb3
Then formatted /dev/md1 with ext2fs and /dev/md3 with ext3fs.

Anyone know why it's not auto detecting, or maybe a way to force the kernel to use the right paramaters?

Last edited by Oxagast; 01-22-2009 at 02:02 AM.
 
Old 01-22-2009, 07:25 AM   #2
Oxagast
Member
 
Registered: Aug 2003
Location: Mocksville, NC, USA
Distribution: Gentoo, Slackware.
Posts: 410

Original Poster
Rep: Reputation: 30
By the way, this is a fresh install of Gentoo. Raid isn't documented (that I know of) in the official install docs, although they do have a page on how to do it, I'm not sure if it's up to date with the latest build, so that may be why its not working. I know I've had (relatively) the same setup before. My drives are old and slow, I'd really like to have raid .
 
Old 01-22-2009, 11:45 AM   #3
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,859
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Just a few thoughts:

I presume your partition types were set to "fd", an easy thing to forget in a fresh install.

Quote:
I tried putting mdadm's info about the arrays into /etc/mdadm.conf but that didn't make a difference.
I wouldn't think it would, since / isn't mounted yet!

You don't mention whether you use an initrd. If nothing else works, you can manually place your mdadm commands in your init file, although it sounds like you don't want to do that.
 
Old 01-22-2009, 12:06 PM   #4
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
I've set up RAID1 on Ubuntu without problems and followed the instructions here:

http://www.howtoforge.com/how-to-ins...software-raid1

My experience is that RAID commands and setup are rather consistant from Linux distribution to distribution.

I have a Gentoo server using RAID but it is using hardware RAID so I cannot be of any direct Gentoo assistance.
 
Old 01-23-2009, 04:02 PM   #5
Oxagast
Member
 
Registered: Aug 2003
Location: Mocksville, NC, USA
Distribution: Gentoo, Slackware.
Posts: 410

Original Poster
Rep: Reputation: 30
Yes, the partitions are set to raidautodetect (fd). How would I use initrd to get it to work? And yes, I can see how putting anything in a config file on the / partition wouldn't make any difference because it can't be mounted. It seems like a "which came first, the chicken or the egg" problem. It uses udev, but udev doesn't seem to see that I have those raid partitons and won't create the /dev/md* files correctly (they are there, they just don't do anything that I'm aware of). The only way I can access it is if I boot from something else, then delete all the /dev/md*'s and then recreate /dev/md1 and /dev/md3 with mknod and then assemble them with mdadm. So how do I get it to do that BEFORE it tries to mount /? And why does raid autodetect at startup not even see the partitions? It says 0 found.
 
Old 01-24-2009, 09:18 AM   #6
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,859
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Unfortunately, I don't know how to fix the autodetect thing, but I'm pretty sure you need some kernel arguments such as:

md=0,0,4,0,/dev/hda3,/dev/hdb3
root=/dev/md0

assuming root is on /dev/md0 and is raid 0; your numbers may vary, I'm not sure about the other numbers - you'll have to look up the kernel arguments help.

Alternatively, the nice thing about using an initrd is that it doesn't use autodetect and that in fact the partition types can be whatever you want them to be. The initrd uses a temporary ramdisk to do the mknod, mdadm, mounting thing then switchs root at the end to use your real filesystem. Basically, you put the commands you listed above in your "init" file in the initrd-tree and when the initrd is run, it runs the commands for you. The mdadm.conf can be in the /etc directory of the initrd-tree, rather than on the real filesystem. There's the link referred to above for ubuntu, and there's a thread about it for slackware, which might be more directly applicable to your situation with Gentoo, although there's quite a lot not applicable to your situation too.

https://www.linuxquestions.org/quest...k-12.0-586440/

Last edited by mostlyharmless; 01-24-2009 at 09:29 AM.
 
  


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
Adding an old software-RAID array to a software-RAID installation.. Boot problems GarethM Linux - Hardware 2 05-05-2008 04:16 PM
LXer: Red Hat sees another delay in PC Linux software LXer Syndicated Linux News 0 09-26-2007 09:20 PM
Fedora Core Sees Non-Existent RAID regorbro Linux - Hardware 2 06-26-2007 03:32 AM
Will a ex - Software Raid 1 disk boot without Raid software? carlosruiz Linux - Software 0 05-27-2006 02:12 PM
CentOS 4.2 sees both disks in RAID array on IBM x346 server SupaDucta Linux - Hardware 0 02-06-2006 03:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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
Open Source Consulting | Domain Registration