Re: boot loader that can read from partition?



phil-news-nospam@xxxxxxxx wrote:
Where would this map file be? One thing I want to avoid is the boot
loader storing anything it needs in any filesystem. I want to be able
to zero-out and reformat every filesystem and still have the boot loader
be able to bring up a kernel.

But you obviously can't zero-out and reformat every partition. The boot
loader and kernel(s) have to live somewhere, right? That somewhere can
be a small filesystem partition, which has the boot loader there, its
configuration file, and kernel images. You can mount this under, hmm,
/boot.

Hey, wait a minute! :)

But you know, if you zero out every filesystem, what is there to boot?
You can't do anything if you don't have a root filesystem. If you have
a way to create a root filesystem in a partition, then at the same time
you can stick a vmlinux kernel image into its root directory. The boot
loader that understands filesystems can then just find it. If the name
hasn't changed, that loader doesn't even have to be reconfigured.

So what you can do is have a dedicated partition which just holds Grub
and its configuration file. No kernels.

Right now I'm playing around with QEMU. It has this option -kernel which
loads a kernel from a file it reads instead of depending on a boot loader.
This is actually kind of nice for when I am building a new system on a
2nd disk drive. At some point that new drive is almost complete, but has
no boot loader. LILO seems to never get it right when trying to make one
drive (e.g. /dev/hdc) bootable for when it will be another (e.g. /dev/hda).

But with grub, you can install the loader without having any kernels
there, and just boot into Grub. Then with Grub you can probe around for
the kernel image.

At the moment, my kernel resides in a partition that is a smallish (256MB)
system, along with lilo and many recovery tools. That partition is not
used during normal system operation which uses other full size partitions.
I would like to be able to easily rebuild that extra system partition but
not clobber the kernel when doing so. Hence the need for another partition.

Right. A tiny partition with the boot loader, smallish partition with
recovery tools, then bigger partitions. The tiny one with the
bootloader can boot into everything using filesystem access to grab the
respective kernels from there, and passing the right root=... option to
that kernel.

.