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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-21-2009, 08:24 PM
|
#1
|
Member
Registered: Aug 2003
Location: Mocksville, NC, USA
Distribution: Gentoo, Slackware.
Posts: 410
Rep:
|
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.
|
|
|
01-22-2009, 07:25 AM
|
#2
|
Member
Registered: Aug 2003
Location: Mocksville, NC, USA
Distribution: Gentoo, Slackware.
Posts: 410
Original Poster
Rep:
|
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  .
|
|
|
01-22-2009, 11:45 AM
|
#3
|
Senior Member
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,859
|
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.
|
|
|
01-22-2009, 12:06 PM
|
#4
|
Member
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370
Rep:
|
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.
|
|
|
01-23-2009, 04:02 PM
|
#5
|
Member
Registered: Aug 2003
Location: Mocksville, NC, USA
Distribution: Gentoo, Slackware.
Posts: 410
Original Poster
Rep:
|
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.
|
|
|
01-24-2009, 09:18 AM
|
#6
|
Senior Member
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,859
|
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.
|
|
|
All times are GMT -5. The time now is 06:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|