linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] LVM support for LILO
@ 2000-09-07 18:25 Andreas Dilger
  2000-09-07 21:43 ` Andi Kleen
  2000-09-08  0:02 ` Heinz J. Mauelshagen
  0 siblings, 2 replies; 20+ messages in thread
From: Andreas Dilger @ 2000-09-07 18:25 UTC (permalink / raw)
  To: Linux LVM mailing list; +Cc: idsfa

Heinz,
Michael Kellen and I have been working to add LILO support for booting
from a LV (i.e. have /boot be an LV, and then not have ANY DOS partitions).

However, the main problem that we are having is that you cannot use
an LV device major/minor to do anything with liblvm.  All of the liblvm
functions use an LV name, it would be good to add an ioctl which takes
a dev_t (e.g. 0x3a01) and returns an LV name, or maybe an lv_t which
we can use with liblvm.  Along the same lines, it may be good to have
an ioctl which takes a dev_t and returns a vg_t of the VG which this LV
is a part of.  Finally, it would be good to take the code out of lvm_map()
which only does block/dev remapping (which lvm_map() will call), but
which also be called by an ioctl like FIBMAP.

How this all fits together is:

1) LILO gets the name of a kernel image (e.g. /boot/vmlinuz) and does stat()
   on it to get the dev_t.

2) LILO does FIBMAP ioctl for each block in the kernel image to find the
   absolute block on the dev_t, and stores this into boot.map.

We need to take the LV dev_t and map it to an lv_t.  Then after LILO does
the FIMBAP on a file block (which returns an LV relative block number),
we need to call a function (ioctl) with (lv_t, lv_block) to return the PV
(dev_t, block), which will then be stored in the boot.map.  LILO needs
the underlying dev_t, because this is translated into a BIOS drive number.

All of these things are relatively easy to do, but it is useless if it
is not in the standard LVM code.  Mapping from a LV dev_t to an lv_t is
simply checking MAJOR(dev) == LVM_MAJOR, return lv[MINOR(dev) + 1] or so.
Doing the block remapping is already in lvm_map(), and just needs to be
moved into a separate function that can be called via ioctl.

Cheers, Andreas

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [linux-lvm] LVM support for LILO
@ 2000-09-08 19:39 Andreas Dilger
  0 siblings, 0 replies; 20+ messages in thread
From: Andreas Dilger @ 2000-09-08 19:39 UTC (permalink / raw)
  To: Linux LVM mailing list

Heinz writes:
> We would need at least an additional "allocation on a single device"

The "contiguous" option to lvcreate should be enough, since the /boot LV
will be relatively small (1 or 2 PEs).  If it ever does cross two PVs,
LILO will detect this with Andi's patch, so no need to make LVM more
complicated.

Luca writes:
> beware that bios addressable might mean below cylinder 1024 if your bios
> doesn't handle lba32

LILO already checks this, since we will be passing the raw disk block numbers
to LILO, so it will be no different than a regular /boot.  The one benefit
of a full LVM system is that if you need to grow /boot, but you have a 1024
cylinder BIOS limit, you can still do this by migrating a PE of another LV
away from the end of the boot LV, and then extending the boot LV.

Heinz writes:
> ... need a "don't pvmove" status flag for the LV to ensure that no wrong
> pvmove(8) can happen.

Luca writes:
> i'd like to be able to pvmove even the boot lv (i.e. i am migrating
> to a larger disk)

As for the "don't move" status flag, this _may_ be useful, but people already
can't move their kernels out of /boot, so this is probably not that big of
an issue.  I would rather keep things simple.  It will not happen very often
that people move /boot, and with newer systems, there are fewer BIOS limits
so it may even be _more_ confusing if people can't move /boot when they want.

Cheers, Andreas

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [linux-lvm] LVM support for LILO
@ 2000-09-08 19:50 Andreas Dilger
  2000-09-09  7:44 ` Luca Berra
  2000-09-09 10:07 ` Christoph Hellwig
  0 siblings, 2 replies; 20+ messages in thread
From: Andreas Dilger @ 2000-09-08 19:50 UTC (permalink / raw)
  To: Linux LVM mailing list

Michael Kellen writes:
> I actually already have code for a check (in lilo.c) to insure that the
> files are contiguous and on the first physical disk.  With the lv to pv
> ioctl, that would be easy to extend to any bootable device.

Actually, there is no need for an image to be contiguous, because even
the filesystem does not guarantee a file is contiguous.  The only
requirement is the image be on a single device that the BIOS can see
when it is first booting.

> In implementing this, we need to remember that not just the kernel needs
> to be mapped.  The boot loader any ramdisks need to be known as well.

Yes, once the LVM block mapping works, it will work for all of these.

> What I'd *really* like to see is kernel code for autostarting of LVM
> similar to the autostart of md (side note: 2.4.0-test7 seems to break
> that, though). One step at a time, though.

Yes, it would be nice to eliminate the requirement for an initrd to use
LVM.  It may be that you could put some limits in place to make the root
VG simple enough for the kernel to load.  You could even hard-code it to
have only 1 LV in this VG, which is the root filesystem.  If it was all
__init code for the LVM module, it would not bloat the kernel...  The
tricky part would be to find the right PV for the rootvg before LVM is
loaded...

Cheers, Andreas

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2001-02-27  0:30 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-09-07 18:25 [linux-lvm] LVM support for LILO Andreas Dilger
2000-09-07 21:43 ` Andi Kleen
2000-09-07 22:39   ` Andreas Dilger
2000-09-07 22:46     ` Andi Kleen
2000-09-07 23:44       ` Andreas Dilger
2000-09-08 14:25         ` Andi Kleen
2000-09-08  0:11   ` Heinz J. Mauelshagen
2000-09-07 22:14     ` Andi Kleen
2000-09-07 23:00     ` Andi Kleen
2000-09-08  0:02 ` Heinz J. Mauelshagen
2000-09-07 23:29   ` Andreas Dilger
2000-09-08 13:02     ` Heinz J. Mauelshagen
2000-09-08 13:47       ` Luca Berra
2000-09-08 19:09         ` Heinz J. Mauelshagen
2000-09-08 14:03     ` Michael J Kellen
2001-02-27  0:30       ` Ralph Jennings
  -- strict thread matches above, loose matches on Subject: below --
2000-09-08 19:39 Andreas Dilger
2000-09-08 19:50 Andreas Dilger
2000-09-09  7:44 ` Luca Berra
2000-09-09 10:07 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).