In alt.os.linux.slackware
no.to...@gmail.com wrote:
> This query applies to installations other than Slakware, so lets not
> resort to foot-ball-hooligan-tribalism.
>
> 2 slak-family installations fail to boot from the CF, whereas
> Debian-Etch does boot.
>
> The one failing slak's initrd-script, at the fail-point reads:----
> if [ "$DATA" = "" ]; then
> # from= is not used or it didn't contain valid data
> DATA=$(find_in_computer $LIVECDNAME/$SGN)
> DATA=$(dirname $DATA 2>/dev/null)
> if [ "$DATA" = "" ]; then fatal \
> "$LIVECDNAME data not found.
> You are maybe using an unsupported boot device (eg. SCSI or old PCMCIA).
> Workaround: Copy the directory $LIVECDNAME from your boot device to an IDE/SATA
> disk, eg. to /mnt/hda1/$LIVECDNAME or C:\\$LIVECDNAME. Then try to boot again."
> --------------
>
> So the problem is RERPORTED as "unsupported boot device: SCSI"
I wish I could address this, but I'm not familiar with the code and
messages you are quoting above. The booting process has many steps
where things can go wrong. The above looks to me like it is coming
from problems with an init script in a initrd.gz for an OS that is not
Slackware, but that's all I can say about it.
> -> less README.initrd == ...
> Here's another example: Build an initrd image using Linux 2.6.29.5
> kernel modules for a system with an ext3 root partition on /dev/hdb3.
> Note that you need the mbcache, jbd, and ext3 modules to use ext3:
>
> mkinitrd -c -k 2.6.29.5 -m mbcache:jbd:ext3 -f ext3 -r /dev/hdb3
> ---------------------------------------------------------------
>
> So how would you know that "you need the mbcache, jbd, and ext3 modules to use ext3"?
> And what do you need to use CF & USBstik?
With this, however, I have some experience. Let me explain. The
answer to your question is (flagged) below, surrounded by a lot of
other needed explanation:
Put yourself in the viewpoint of the computer. Drives have partitions
and partitions have file systems. For the computer to read files it
must "understand" the file system. Grub has built into it code that
allows it to understand a few (but not all!) file systems. It's
different from Lilo in that way I think. What I understand is that
Lilo doesn't read files in this way, but instead "locates" them through
a map that was made earlier when lilo was run. This "locating" is
sufficient for booting in the way that was setup when lilo was run.
Grub doesn't do anything in advance like this, but instead has a built
in ability to understand certain file systems. It is limited in what
file systems it can read (bad), but with this ability it can actually
read files. On the fly! You don't need to tell it in advance what you
want to boot (good).
One problem that happens when booting with Grub is that partition names
change. I believe that the map that Lilo uses gets around that
problem. It refers to the map and not to a partition name when it
locates the kernel, initrd.gz, and the root directory.
Grub, on the other hand (I'm speaking of legacy Grub) needs to be told
where these things are. Instead of names like "sde3" it uses a name
like "(hd4,2)". I'll not go into that here, but these are really two
ways of saying the same thing. So the difference in terminology isn't
the issue. The issue is knowing the name of the device ("sde" or
"hd4"), since these names change from one instance of booting to
another.
Grub allows you to explore at the grub command line. The tab key and
the "configfile" command are helpful in this. With a little
exploration you can find the device name and make the changes to the
booting instructions as needed so Grub can find things and boot.
For everyday Grub booting, though, you want things to just work. I do
three things to accomplish this:
vvv
(1) I use partition labels. I label the partitions that grub needs to
find using e2label, and I fix the root system's fstab to refer to this
label ("LABEL=<label>" instead of "<device such as '/dev/hda1'>").
Labeling the root partition allows me to make a Grub config file (often
called "menu.lst") that will always work. Fixing fstab allows
Slackware to work. (Yes, Slackware needs to be told where it lives!
Look in your fstab.) You should do the same for any other partitions
that might not be located correctly, such as swap partitions.
A line in my menu.lst invokes the kernel and refers to the above label.
I sometimes use something like this:
kernel /vmlinuz-generic-2.6.37.6 (ro) root=LABEL=<label>
(You can also tell *mkinitrd* where root is. If you do and want to use
that location, then omit "root=<label>" above. If you do both, then
the above is used.)
It's an odd syntax to use "=" twice, but it works. This takes care of
locating the root directory, although it doesn't tell where the kernel
is. So the above line needs some help. See (2) below.
Note. It doesn't matter if Grub can understand the file system where
root resides. Grub runs the initrd.gz and the initrd.gz loads the
modules that were named when it was made using mkinitrd. These modules
(such as mbcache, jbd, and ext3) can have other purposes, but one
purpose *(here I will answer your question)* is to allow this line in
the init script of your initrd.gz to work:
mount -o ro -t $ROOTFS $ROOTDEV /mnt
I believe the modules are not needed when you use a huge kernel. This,
I believe, is because a huge kernel has *all* the modules compiled-in.
Modules augment a kernel's capability dynamically (so they don't have to
be compiled-in). Do not assume that a capability like "mount" is
always available. The kernel can only do it if it "understands" how.
The module "ext3" and perhaps others, for example, are needed to mount
an ext3 file system. I use these when I make an initrd.gz:
modules=ehci-hcd:uhci-hcd:ohci-hcd:usb-storage:usbhid:ext4:ext3:ext2:vfat:\
nls_cp437:nls_iso8859-1
The ehci, uhci and ohci-hcd plus usb-storage are needed because I want
to mount a root that is on a USB device. You don't need these if your
root is on an internal hard drive. This is true even if your kernel
and/or initrd.gz reside on a CF. We're talking just about mounting the
root.
I don't remember what usbhid is for. the ext4, ext3, ext2, and vfat
will allow you to mount a variety of different file systems. I don't
remember what the last two are for, but I don't think you will need
them.
When I make an initrd.gz I think about providing modules so init can
mount root at /mnt. I *also* think about what I may want to do if the
normal boot process goes to "rescue mode". This is basically a linux
command line that the init script opens. Slackware's init will do this
if it cannot mount root at /mnt. This will happen, for example, if you
fail to provide all the modules needed to mount it. You can also
request rescue mode by putting "rescue" on the boot line. Change the
kernel line in Grub's menu.lst to look like this:
kernel /vmlinuz-generic-2.6.37.6 (ro) root=LABEL=<label> rescue
(2) To locate the initrd.gz and the kernel I use a line like this in my
menu.lst:
root (cd)
This needs to come before the line above. It simple tells where "/"
is. (As in "/vmlinuz-generic-2.6.37.6...".) I boot from a CD which is
why I use this line. If you want to boot from a CF you'll need
something like "root (hd1,0). Be aware that this is not reliable. As
I explained way above, device names change. That is why I like to boot
from a CD. You can do it from a CF, but you may need to adjust the
"root" statement in your menu.lst, potentially every time you boot.
The new Grub (not legacy) may provide a solution to this.
Note. You may not know it, but a CD has a file system. It is called
iso9660. Grub can understand it. If instead you want to put your
kernel or your initrd.gz on a CF, then you may have to experiment to
find a file system (to use when you make your CF) that Grub can
understand.
(3) I use a line like this in my menu.lst to locate the initrd.gz:
initrd /initrd.gz
This comes after the line about the kernel and root.
^^^
[snip]
I guess I've droned on long enough. You're asking good questions. That
is to be commended! Stick with it, and you will learn how things work.
Take notes. I keep a directory full of lessons I've learned on
different linux subjects. It's like finding your way out of the
forest. Without a trail of bread crumbs, you're lost!
Good luck.
--
http://JosephRosevear.com
http://RosevearSoftware.com