help needed to boot from compact flash

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi All,

I have trying to move my linux from harddrive to a compact flash without
much success for a week. Here is what I am trying to do:

I already have my own kernel and modules, tested successfully on my computer
on hard drive. I followed
the three article series from Bruce Perens here to make busybox and file
system:

part 1 for busybox
http://www.linuxdevices.com/articles/AT6143283999.html

part 2 for file system,
http://linuxdevices.com/articles/AT9416075241.html
I used Ram disk intead of romfs described in book by Karim Yaghmour
"Building embedded Linux systems"

The compact flash is connect to an IDE to CF, set to the master of the
second channel.

Then I used grub to load my kernel and initrd. by running /sbin/grub
root (hd2,0)
setup (hd2,0)

When it boots, it gives me a grub prompt
I typed

kernel /boot/bzImage
initrd /boot/initrd.bin
boot

where the initrd.bin is a compressed Ram disk image from the whole rootfs.

Then I got this message
....
VFS: Mounted root (ext2 filesystems).
kmod: failed to exec /sbin/modeprobe -s -k block-major-3 errrno=2
VFS: Cann't open root device "" or 03:07
Please append a correct "root=" boot option
kernel panic: VFS: Unable to mount root fs on 03:07

I also tried to copy the filesystem directly to the flash and reboot
it also gives me a grub prompt
do the same for the kernel and initrd (I used the real initrd.img from
mkinitrd this time)
I got this message:
hda hda1 hda1 hda3     (these are OK because I have three partitions on the
compact flash)
hda7 bad access block 3 count 2
end-request I/O error dev 03:07 (hda) sector 2
unable to read superblock
...
I never have anything like hda7. It has only 3 partitions.

Can any one help me here? Do I have to compile all the modules into the
kernel or keep them as modules as I am doing it now?

Thanks in advance.

Everett



Re: help needed to boot from compact flash

Quoted text here. Click to load it
without
computer
file
the

Have you tried booting from the primary channel?

Quoted text here. Click to load it
rootfs.

What don't you try root=/dev/hdc?

Quoted text here. Click to load it
from
on the

But your CF is on hdc.

Quoted text here. Click to load it
the

If all else fail, you can try our CD.  It will load most CFs up to
256M.
See:  http://cfd.linnix.com

Quoted text here. Click to load it


Re: help needed to boot from compact flash
Try doing this at your grub prompt:
grub> root(hd1,0)
grub> kernel (hd1,0)/boot/bzImage ro root=/dev/hd1  [hd1 = which ever device
where your flash is mounted.]
grub>initrd (hd1,0)/boot/initrd.img
grub>boot

Thanks
Uday



Re: help needed to boot from compact flash
Hi Thanks for the suggestion.

For the grub installation, I copied stage1, stage2 into my boot/grub from my
desktop linux directory. What are these files? Do I have to change them? And
also when flash boots, it goes to grub prompt instead of linux directly. How
to make it boot my linux directly?

Thanks.

Everett

Quoted text here. Click to load it



Re: help needed to boot from compact flash
Copy grub.conf to /boot/grub/ and make a soft link to menu.lst.
See grub.conf file in your red-hat machine at /boot/grub/ directory
here you can create your own configuration as what linux image to boot with.

Also, you dont need to copy the stage1 and stage2 files...
Use grub-install utility and grub utility. It will create those file for u.

procedure:
    #mkdir /mnt/usb
    #mount /dev/sda1 /mnt/usb
    #grub-install --root-directory=/mnt/usb '(hd1)'
    #grub /dev/sda
            grub> root(hd1,0)
            grub>setup (hd1)

Here hd1 is my usb name as seen by the BIOS.You can get this information
from /boot/devices.map file.

Uday

Quoted text here. Click to load it
my
And
How



Re: help needed to boot from compact flash
why don't u use redboot..

Quoted text here. Click to load it
without
computer
file
the
rootfs.
from
on the
the


Site Timeline