LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 07-20-2008, 05:33 PM   #16
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
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:
...
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).

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
dmraid -ay
 
Old 07-20-2008, 05:48 PM   #17
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
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
 
Old 07-22-2008, 08:46 PM   #18
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
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?
 
Old 07-23-2008, 09:37 AM   #19
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
pclinux initrd

Quote:
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?
 
Old 07-23-2008, 12:07 PM   #20
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
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.
 
Old 07-23-2008, 03:56 PM   #21
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
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.
 
Old 07-23-2008, 04:02 PM   #22
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
here's a thought - would it be possible to use another distro's initrd, such as your slackware initrd, to boot my machine?
 
Old 07-24-2008, 01:01 PM   #23
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
modules and sh

Quote:
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.
 
Old 07-24-2008, 02:49 PM   #24
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
insmod

Didn't mention it previously but
Code:
insmod /lib/xxx_mod.ko
with the appropriate module xxx_mod.ko for the sata drives put into the initrd-tree /lib should load the modules using nash.

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

Last edited by mostlyharmless; 07-24-2008 at 02:52 PM.
 
Old 07-24-2008, 09:43 PM   #25
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
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)
 
Old 07-25-2008, 10:28 AM   #26
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
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.
 
Old 07-25-2008, 11:01 AM   #27
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
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

echo "Loading jbd.ko module"
insmod /lib/jbd.ko
echo "Loading ext3.ko module"
insmod /lib/ext3.ko

###load sata drivers first
echo "loading libata..."
insmod /lib/libata.ko
echo "loading ahci..."
insmod /lib/ahci.ko

echo Mounting /proc filesystem
mount -t proc /proc /proc
echo Mounting sysfs
mount -t sysfs none /sys
echo Creating device files
mountdev size=32M,mode=0755
echo -n /sbin/hotplug > /proc/sys/kernel/hotplug
mkdir /dev/.udevdb
mkdevices /dev
echo Creating root device
mkrootdev /dev/root

###detect and map raid
dmraid -ay

resume
echo > /proc/suspend2/do_resume
echo Mounting root filesystem /dev/root
mount -o defaults --ro -t ext3 /dev/root /sysroot
echo Switching to new root
switchroot --movedev /sysroot
echo Initrd finished
 
Old 07-25-2008, 11:59 AM   #28
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
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.
 
Old 07-25-2008, 06:51 PM   #29
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
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?
 
Old 07-26-2008, 04:54 PM   #30
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
from man nash:
Code:
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?
 
  


Reply



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
Going from single hard drive to Software RAID 1 Zippy1970 Linux - Hardware 8 03-14-2008 09:38 AM
How To Clone Single Drive To Raid 1+0 (copy /dev/sde to /dev/md0)? alfista Linux - Server 2 03-13-2008 04:17 AM
Physically detect a failed hard drive in a software RAID 5 array testnbbuser Linux - Server 3 12-21-2007 05:10 PM
hard drive causing trouble with software raid array machs_fuel Linux - Hardware 2 07-15-2006 02:45 PM
adding a hard drive to an existing software raid array iammisc Linux - Hardware 3 03-01-2006 06:08 PM

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

All times are GMT -5. The time now is 04:37 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