Linux - SoftwareThis 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.
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.
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:
...
dmraid -ay
sh
...
Then when you try to boot pclinux you'll get the # prompt right after dmraid doesn't work. You can then try other shell commands to find out why. (mount, ls, manually try init lines...)
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).
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:
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?
i know dmraid recognizes my raid when the system is running, but why cant it find it during the initrd?
Well, that is a good question! I think the failure of "sh" in your initialization also has some relevance; clearly the tools available in pclinux's initrd are different from what I'm used to. "sh" is a link to busybox in slackware, might be different in pclinux. I'll probably have to do some research on this one unless someone else pitches in who's more pclinux knowledgeable. What's the contents of your initrd's /sbin and /bin?
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.
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.
here's a thought - would it be possible to use another distro's initrd, such as your slackware initrd, to boot my machine?
I don't know whether it'd be possible to use another dstro's initrd, unless they were closely related. I was under the impression that pclinux was a derivative of ubuntu (might be wrong about that) so that ubuntu's initrd might work. Maybe you could try it, using a binary release, but generally initrds are generated by a script for your machine, so you couldn't use slackware's. At that point you might as well switch to a different distro!
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.
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:
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?
mkrootdev path
Makes path a block inode for the device which should be mounted
as root. To determine this device nash uses the device suggested
by the root= kernel command line argument (if root=LABEL=XXXXXX
or root=UUID=XXXXXX is used devices are probed to find one with
that label or uuid). If no root= argument is available,
/proc/sys/kernel/real-root-dev provides the device number.
the init script fails on mounting the root device, so i'm wondering if its not creating the root device correctly? "mkrootdev /dev/root" is what is in the init script by default, but from the man page it seems like i should not have the /dev/root in there, so it will use my root= from my kernel command line in my menu.lst, or is that the incorrect syntax?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.