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,

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.


Relevant Pages

  • read/only root filesystem strategy
    ... the installed system as possible be running under a read/only mount. ... or a widely shared network filesystem. ... Modifying the kernel to perform the setup. ... Partition hda1 would house the kernel and a small rescue ...
  • Re: usb-storage on SMP?
    ... > filesystem, but I can't load the kernel from USB key drive. ... I recommend that you use fdisk to set up one partition as FAT16 type ... send the line "unsubscribe linux-kernel" in ...
  • Re: boot loader that can read from partition?
    ... You could copy most of the LILO code and simply ... | load the secondary boot loader. ... |> | partition table. ... | that are coded into the kernel itself (I think other boot parameters ...
  • Re: 2.6.30-rc8 Oops whilst booting
    ... However the vfat filesystem didn't have /sbin/init. ... The first partition on the disc that is ... boot from, to /dev/sdb6, so that I minimised the risk to sdc1 in the ... changed the name of the root partition that is passed to the kernel by ...
  • Re: Command Line Partitioning
    ... it seems when I get CF disks they have an MS-DOS partition ... Both lilo and extlinux can be ... The down side of lilo is that the boot loader ... Linux kernel. ...