struggle for days
Yes, well it took a number of false starts for me too. That's the nice thing about having grub and the old OS install, you can take your time working on it and still have a fall back. Clearly, if you can boot grub off the raid 0 you're halfway there.
First, I'd try to isolate the problem. You can add the command "sh" to your "init" script. This will stop the script and give you a command shell. Try putting this right after the dmraid command. You can then explore what the error is and why dmraid isn't working. E.g.: Code:
... For example, one possibility is that the "dmraid" version you have isn't built statically. You'll either have to recompile it with --enable-static_link or include its runtime libraries in /boot/initrd-tree/lib. I use dmraid-1.0.0-rc14, which is the latest "vanilla" dmraid: http://people.redhat.com/~heinzm/sw/...0.rc14.tar.bz2 You can compile it (under old install). I use "vanilla" grub 0.97 from the grub site; ftp://alpha.gnu.org/gnu/grub/grub-0.97.tar.gz pclinux's version is probably already patched for dmraid; but if it is not, you can download the grub-0.97-dmraid.patch http://download.talinux.tal.org/pub/...7-dmraid.patch as well as anything else you need or want (like grub-gfx for the boot graphics) http://aur.archlinux.org/packages/gr...rub-gfx.tar.gz Sometimes patches conflict and will require manual tweaking... You can put multiple "sh" commands in your init script to examine the state of the system as it boots. You can proceed by exiting the shell with "exit", then the rest of the "init" script will go. If it isn't working and you don't want to see the kernel panic and have to reboot with the powerswitch/reset button, you can reboot the system with Ctrl-Alt-Del within the shell. Convenient, eh? I'm surprised your default initrd.img had no "init". You could retry using the default initrd.img file and create a file "init" in it (sorry for the pun). Just make it an executable shell as follows: Code:
#!/bin/ash |
i was surprised as well that my default initrd.img didnt have an init file with it. it took me a long time to figure out i had to build a new one with mkinitrd before i had one with an init file.
first im going to try compiling my own dmraid from source, and adding an sh to my init. i would think my version of grub is patched to use dmraid - i'm using the super grub boot cd from here: http://www.supergrubdisk.org/ i'll get to adding boot gfx as soon as i get it booting ;) |
Okay. I did download the latest dmraid, and compiled it with ./configure --enable-static_link . i had to download another glibc6 package for static linking.
once i got my dmraid built, i copied it over to my init-tree. i also copied the libdevmapper file over to the lib dir, just to be safe. rebuilt my initrd image and reboot now i believe dmraid is loading properly.. i think the new version/compile with static link helped in that respect. now, i'm onto another problem. in the line dmraid runs, it says "no RAID disks". the init continues on trying to mount the root fs, and cant, and kernel panic. enterting in "sh" anywhere in my init script throws a "failed in exec of sh" error. i tried copying my /bin/sh to /boot/initrd-tree/bin, and adding the full path of /bin/sh in my init, but neither helped the error at all. also, this may have some relevance to this?- the top of my init file says #/bin/nash instead of the normal #/bin/sh or #/bin/bash ive seen. also there is a binary /boot/initrd-tree/bin/nash so i tried nash instead of sh. it seems to pause the init script but i cant do anything except enter to continue or ctrl-alt-del to reboot. i'll have to check on this next boot, im not entirely sure, i dont think i had a prompt or could type any text. i know dmraid recognizes my raid when the system is running, but why cant it find it during the initrd? |
pclinux initrd
Quote:
|
Here's another thought; your SATA drives may not have been recognized yet when dmraid is run; you might need to add the appropriate modules to the initrd.
|
sbin is a symlink to bin. contents of bin are:
-rwxr-xr-x 1 root root 789262 Jul 22 20:06 dmraid* lrwxrwxrwx 1 root root 10 Jul 19 16:21 hotplug -> /sbin/nash* lrwxrwxrwx 1 root root 11 Jul 19 16:21 modprobe -> ../bin/nash* -rwxr-xr-x 1 root root 74460 Jul 17 22:00 nash* -rwxr-xr-x 1 root root 725088 Jul 21 02:32 sh* i copied sh to the bin dir, hoping to get it working... it is not there by default. the sata drivers not being loaded is a good point, i'll have to check into that. from reading my man mkinitrd, it seems all i need to do is add modules to the /etc/modules or /etc/modprobe.conf for them to be auto loaded at boot time by the initrd. i cant see how that could possibly work if access to my drives isnt set up when it tries to read the modules files. btw, nash says its from redhat. |
here's a thought - would it be possible to use another distro's initrd, such as your slackware initrd, to boot my machine?
|
modules and sh
Quote:
As far as nash is concerned, apparently it's not a full fledged independent shell unfortunately - but I've never used it, as it's a fedora/redhat thing. You might try "man nash" on your system to see what it can do. It should be able to load the modules for you, but it can't act the way bash or ash can, from what I can see from the man page. In brief, I think you need it to load the modules for your sata drives before asking it to do dmraid. |
insmod
Didn't mention it previously but
Code:
insmod /lib/xxx_mod.ko It should go without saying that you need to include insmod (static version) in your initrd-tree as well, if it's not already there |
ok - so using another distro's initrd is pretty much out of the question. i also dont want to switch distro's, as i've already got everything set up/configured to my liking - and that was very difficult and took a long time.
I did read the nash man page, and as you said it is not a full fledged shell. it is limited in what it can do, but for what i do need it to do, it should work. there are instances for insmod in my init script already - one for loading the jbd.ko(i think for keyboard) and one for ext3.ko. however, insmod does not exist in my /bin directory. it isnt in any of the directories for that matter. the closest i can find to insmod is modprobe in my /bin dir, and as you can see in my post above, that is a symlink to /bin/nash anyway. but according to nash's man page, insmod is a supported function of nash, so that must be how it loads the modules. heres my problem: ive viewed lsmod, and cant seem to locate the module loaded for sata. maybe it is named something really strange, but nothing in the list looks even close, save for ata_piix or libata. i dont know if either of those could be it. so the question is, should i be looking for something specific to my hardware? or is this a generic sata driver that i should be able to find by googling? i believe it is an ATI onboard sata raid (disks were previously on my nforce board, hence why the dmraid name nvidia_xxx) |
half day of work today, so ive got a chance to play around with this a bit.
i did some research last night on libata and ata_piix - it seems that these are scsi/sata drivers. however, ata_piix is for an intel card, which i do not have. libata seems like a general ata library. so i tried adding libata and ata_piix to my initrd. on reboot i got a lot of errors with ata_piix, something with unknown function ata_example. insmod exits with error code -2. i couldnt see libata, it was too far up on the screen. so i came back to my 20g drive install to play around some more. guess what? i no longer have a /dev/mapper/ folder in my 20g drive install. dmraid -ay now reports "no RAID disks", just as it did in my initrd for my raid0 install. what happened? i didnt change anything on the 20 gig install. i checked insmod again after this - libata and ata_piix dont seem to be in the list. i tried to insmod them again, dmraid still says the same thing. i rmmod ata_piix and tried insmod with a force_pcs option, but insmod reports that it is an invalid parameter. heres where i got my information from: http://linux-ata.org/driver-status.html and the libata FAQ link on that page. |
whoops - i used gzip to decompress the .ko.gz files so i could add them to my initrd, and modprobe was using the .ko.gz to load the modules at boot. so they never got loaded because they were .ko and no longer gzipped. so that was an easy fix.
i figured out i need ahci.ko for my ati raid, i didnt see that last night. still, why is ata_piix being loaded then? everything works without it. i added ahci.ko to my initrd-tree/lib/ and updated my init. i'm loading libata first, but i'm still getting a list of "unknown symbol ata_" errors. im going to try only loading atalib and seeing if it is throwing any errors. but here's what my init file looks like: Code:
#!/bin/nash |
Sounds like you're making progress. Some modules implicitly depend on another (example ext3 and jbd) I'd try using "lsmod" in your 20 G setup to see what modules are loaded when dmraid works there, then add those to the initrd.
|
i also loaded sg.ko and sd_mod.ko - the first is the generic scsi driver, the second is to use the card in raid. once i had those loaded, along with the others above, dmraid starts working and discovers my device.
i'm still getting a kernel panic though, as it doesnt mount the root FS. any ideas as to why? ive tried using root=/dev/mapper/nvidia_ecccjggb2 and also root=/dev/sdr2 i also set resume=/dev/mapper/nvidia_ecccjggb2 - the error that comes up with that is something like "cannot read from /dev/mapper/nvidia_ecc..." - so it seems like even though dmraid is working, im unable to access the devices? |
from man nash:
Code:
mkrootdev path |
All times are GMT -5. The time now is 11:33 AM. |