[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Attempt to Move Root



Le primidi 1er nivôse, an CCXXIV, Stephen Powell a écrit :
> No, that won't work.  If the root filesystem is an LVM2 logical volume, then
> /boot *cannot* be part of the root filesystem.  To be more rigorous, there will
> be a /boot directory in the / filesystem, but it must be an *empty* directory,
> so that another filesystem can be mounted on that directory.  Another
> filesystem must get mounted on the /boot directory in the root filesystem,
> and that filesystem must be made on a partition of a *real* disk which is
> accessible via the BIOS.  It cannot be an LVM2 logical volume.  The boot
> partition contains the LILO map file (by default, /boot/map) as well as the
> kernel image file and the initial RAM filesystem image file.  LILO reads these
> files at boot time via BIOS calls, and the BIOS does not support LVM2 logical
> volumes.

What you write is slightly inaccurate. The core of your inaccuracy is this:
LILO does not use the BIOS to read FILES, but SECTORS. How to map files to
sectors is entirely LILO's problem.

IIRC, the mapping is computed when (re)installing LILO on the boot-sector
and hard-coded in the boot-sector itself, with one level of indirection (the
map file). After a quick glance at the sources, it uses the FIBMAP ioctl and
various others to ask the kernel the blocks used by a file and converts to
sectors. At the same time, I noticed that LILO seems to be actually capable
of finding the sectors for files on LVM.

This is how LILO works. GRUB, for example, works in a completely different
way: it has code to decode partition tables, logical volumes and various
filesystems, and uses it to find files at runtime. This is way more robust
than LILO. On the other hand, the code for that is quite large and does not
fit on the 512- octets of a boot-sector: GRUB must cheat, it has a second
stage, and just like LILO's map file, it hard-codes the sectors for the
second stage in the boot-sector image. Still, GRUB's second stage is much
smaller than a kernel image (about fifty kilo-octets) and changes very
infrequently. To avoid troubles with filesystems, GRUB tries to put its
second stage in the unused space between the partition table and the
boot-sector.

I have not read this thread carefully, so maybe it has already been
addressed, but all this suggest that the OP should install GRUB instead of
LILO and be done with that kind of trouble.

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: Digital signature


Reply to: