Thread View: comp.os.linux.embedded
6 messages
6 total messages
Started by Religious Sect
Mon, 27 Aug 2001 12:16
Booting from compact flash (a question of LILO)
Author: Religious Sect
Date: Mon, 27 Aug 2001 12:16
Date: Mon, 27 Aug 2001 12:16
38 lines
2118 bytes
2118 bytes
Hi y'all I'm trying to boot from a compact flash card which is connected to my standard IDE controller (with a IDE to CF converter). But I'm not having much luck. I currently boot from a standard harddrive (hda). Meanwhile the CF card is connected as hdc. Everything works sweet. I can mount hdc1 and hdc2 and everyone is happy. So I run: lilo -C lilo.flash cp /boot/* /mnt/flash/boot/ lilo.flash: -------------------------------- boot=/dev/hdc map=/boot/map install=/boot/boot.b prompt timeout=50 linear read-only root=/dev/hdc2 image=/boot/vmlinuz-2.2.18 -------------------------------- Which should install MBR and booting stuff on the CF card. But when I try to boot from the CF card all i get is: L 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (etc) This means the first stage is loaded, but no more. Have I forgotten something? Steve
Re: Booting from compact flash (a question of LILO)
Author: Anders Larsen
Date: Tue, 28 Aug 2001 07:52
Date: Tue, 28 Aug 2001 07:52
54 lines
2961 bytes
2961 bytes
On Mon, 27 Aug 2001 14:16:07 +0200, "Religious Sect"
<dontspamthe.templeofcaring@optushome.com.au> wrote:
> I'm trying to boot from a compact flash card which is connected to my
> standard IDE controller (with a IDE to CF converter). But I'm not
> having much luck.
>
> I currently boot from a standard harddrive (hda). Meanwhile the CF
> card is connected as hdc. Everything works sweet. I can mount hdc1
> and hdc2 and everyone is happy.
>
> So I run:
> lilo -C lilo.flash
> cp /boot/* /mnt/flash/boot/
Don't do that!
lilo writes absolute disk addresses to the map file; these would
refer to /dev/hda in your case (since that's where /boot is located).
Step 1: cp -pv /boot/* /mnt/flash/boot/
Step 2: lilo -C lilo.flash -r /mnt/flash/
This will tell lilo to locate the boot-image on /mnt/flash/boot/
and write the map to /mnt/flash/boot/map
(you might have to copy lilo.flash to /mnt/flash/etc/lilo.flash
to get the above command to work)
> lilo.flash:
> --------------------------------
> boot=/dev/hdc
> map=/boot/map
> install=/boot/boot.b
> prompt
> timeout=50
> linear
> read-only
> root=/dev/hdc2
> image=/boot/vmlinuz-2.2.18
> --------------------------------
>
> Which should install MBR and booting stuff on the CF card.
Well, when you boot from CF, I guess your CF will be /dev/hda,
so "root=/dev/hda2" might do wonders, too.
("boot=/dev/hdc" tells lilo where to *write* the boot info,
so don't change that).
HTH
cheers
Anders
--
"In theory there is no difference between theory and practice.
In practice there is." - Yogi Berra
Re: Booting from compact flash (a question of LILO)
Author: Religious Sect
Date: Tue, 28 Aug 2001 14:26
Date: Tue, 28 Aug 2001 14:26
99 lines
4297 bytes
4297 bytes
Hi I have had two great (and fortunately very similar) responses. Combining the two responses... cp -pv /boot/* /mnt/flash/boot/ cp lilo.flash /mnt/flash/etc/lilo.conf lilo -r /mnt/flash -v -v -v so /mnt/fkash/etc/lilo.conf: -------------------------------- boot=/dev/hdc map=/boot/map install=/boot/boot.b prompt timeout=50 linear read-only root=/dev/hda2 (was hdc2) image=/boot/vmlinuz-2.2.18 -------------------------------- I get: LILO version 21, Copyright 1992-1998 Werner Almesberger Caching device /dev/hda (0x0300) Caching device /dev/hda1 (0x0301) Caching device /dev/hda2 (0x0302) Caching device /dev/hda3 (0x0303) Caching device /dev/hda4 (0x0304) Caching device /dev/hda5 (0x0305) Caching device /dev/hda6 (0x0306) Caching device /dev/hda7 (0x0307) Caching device /dev/hda8 (0x0308) Caching device /dev/hdb (0x0340) Caching device /dev/hdb1 (0x0341) Caching device /dev/hdb2 (0x0342) Caching device /dev/hdb3 (0x0343) Caching device /dev/hdb4 (0x0344) Caching device /dev/hdb5 (0x0345) Caching device /dev/hdb6 (0x0346) Caching device /dev/hdb7 (0x0347) Caching device /dev/hdb8 (0x0348) Caching device /dev/sda (0x0800) Caching device /dev/sda1 (0x0801) Caching device /dev/sda2 (0x0802) Caching device /dev/sda3 (0x0803) Caching device /dev/sda4 (0x0804) Caching device /dev/sda5 (0x0805) Caching device /dev/sda6 (0x0806) Caching device /dev/sda7 (0x0807) Caching device /dev/sda8 (0x0808) Caching device /dev/sdb (0x0810) Caching device /dev/sdb1 (0x0811) Caching device /dev/sdb2 (0x0812) Caching device /dev/sdb3 (0x0813) Caching device /dev/sdb4 (0x0814) Caching device /dev/sdb5 (0x0815) Caching device /dev/sdb6 (0x0816) Caching device /dev/sdb7 (0x0817) Caching device /dev/sdb8 (0x0818) Caching device /dev/loop0 (0x0700) Caching device /dev/loop1 (0x0701) Caching device /dev/loop2 (0x0702) Caching device /dev/loop3 (0x0703) Caching device /dev/loop4 (0x0704) Caching device /dev/loop5 (0x0705) Caching device /dev/loop6 (0x0706) Caching device /dev/loop7 (0x0707) Reading boot sector from /dev/hdc open /dev/hdc: Permission denied It is the last line that is the killer (yes I'm logged in as root) And here's what happens when you do an fdisk -l Disk /dev/hda: 16 heads, 51 sectors, 1010 cylinders Units = cylinders of 816 * 512 bytes Device Boot Start End Blocks Id System /dev/hda1 1 41 16727+ 82 Linux swap /dev/hda2 * 42 1010 395352 83 Linux Disk /dev/hdc: 4 heads, 32 sectors, 490 cylinders Units = cylinders of 128 * 512 bytes Device Boot Start End Blocks Id System /dev/hdc1 1 256 16368 83 Linux /dev/hdc2 * 257 490 14976 83 Linux Any ideas why I have no permission for hdc? Especially when I can mount and read/write to my hearts content? Thanks Steve
Re: Booting from compact flash (a question of LILO)
Author: Erik Ivanenko
Date: Tue, 28 Aug 2001 15:19
Date: Tue, 28 Aug 2001 15:19
34 lines
2390 bytes
2390 bytes
Omit the boot parameter, and specify root=/dev/hdc2. From the
lilo.conf(5) man page:
boot=boot-device
Sets the name of the device ->(e.g. a hard disk partition)<- that
contains the boot sector. If this keyword is omitted, the boot sector is
read from (and possibly written to) the device that is currently mounted
as root.
You may wish to try boot=/dev/hdc2, if root must be /dev/hda2.
Afterall, your fdisk claims that /dev/hdc2 is the bootable partition.
> And here's what happens when you do an fdisk -l
>
> Disk /dev/hda: 16 heads, 51 sectors, 1010 cylinders
> Units = cylinders of 816 * 512 bytes
>
> Device Boot Start End Blocks Id System
> /dev/hda1 1 41 16727+ 82 Linux swap
> /dev/hda2 * 42 1010 395352 83 Linux
>
> Disk /dev/hdc: 4 heads, 32 sectors, 490 cylinders
> Units = cylinders of 128 * 512 bytes
>
> Device Boot Start End Blocks Id System
> /dev/hdc1 1 256 16368 83 Linux
> /dev/hdc2 * 257 490 14976 83 Linux
>
> Any ideas why I have no permission for hdc? Especially when I can mount and
> read/write to my hearts content?
>
> Thanks
>
> Steve
Re: Booting from compact flash (a question of LILO)
Author: Anders Larsen
Date: Tue, 28 Aug 2001 15:29
Date: Tue, 28 Aug 2001 15:29
25 lines
2207 bytes
2207 bytes
On Tue, 28 Aug 2001 16:26:13 +0200, "Religious Sect" <dontspamthe.templeofcaring@optushome.com.au> wrote: > LILO version 21, Copyright 1992-1998 Werner Almesberger > > Caching device /dev/hda (0x0300) [snip] > Caching device /dev/hdb (0x0340) [snip] > Reading boot sector from /dev/hdc > open /dev/hdc: Permission denied > > It is the last line that is the killer (yes I'm logged in as root) Since LILO didn't tell anything about any /dev/hdc* above, my guess is that you need to create /dev/hdc on the flash disk, as in # mknod -m 600 /mnt/flash/dev/hdc b 22 0 HTH cheers Anders -- "In theory there is no difference between theory and practice. In practice there is." - Yogi Berra
Re: Booting from compact flash (a question of LILO)
Author: Religious Sect
Date: Wed, 29 Aug 2001 11:55
Date: Wed, 29 Aug 2001 11:55
23 lines
1946 bytes
1946 bytes
Hi All sorted now. Just thought I'd give a quick rundown on how I did it (with a lot of help from a friend). - Boot from HD (as normal) on hda - mount CF on hdc - copy all files from HD to CF - shutdown - change IDE cables so that hda=CF and hdc=HD - boot from HD (hdc) - interrupt boot process with 'linux root=/dev/hda1' - this continued the boot on hda - once I had the prompt then modify lilo - and run lilo so that it needs hda only worked sweet. Thanks for your help Steve
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads