Skip to contentSkip to conversation

SuSE/LVM boot problem

linux-lvm Andreas Dilger 2 participants 2 messages May 3, 2000

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines · David Gould
Quoted 2 lines

Option 1 is way easier to implement, but has one big disadvantage: Whenever you move physical extents, you have to re-run lilo.

Yes. Would it be reasonable to have LVM tools check for this and warn the user?

You need to re-run LILO even if you move the kernel on a regular filesystem, so I don't think it's that important if LVM doesn't warn you about this. How often do you move LVs around anyways? If you keep them in your /boot LV and it's only a couple of PPs in size, it shouldn't be an issue. Under AIX, you are forced to have your boot LV contiguous (which I think LILO doesn't need, as long as it is a single disk), and you are still required to run "bosboot" if you move or mirror your BLV.

Quoted 5 lines

If I have understood this, we need the following to make this work (some of this may already exist):

- lvm needs to have a way of tracking/enforcing/satisfying the constraint that specified lvs need to be in the bios bootable physical area

I think this can mostly be left up to the sysadmin for now. I think if LILO can handle LVs at all, it already complains if your kernel isn't in a BIOS bootable area.

Quoted 2 lines

- lilo needs to understand about lvm and use the lvm provided ways to get physical mappings.

How does LILO do this now? It currently gets a filename for the kernel, and that's it. It must do some sort of internal calculation or IOCTL to get the physical block numbers on the disk. Is the problem that it does its calculations w.r.t. the start of the partition?

Quoted 2 lines

- the kernel needs to be able to reconstruct enough of the lvm descriptors to mount / at boot time.

You could always require that the / partition be contiguous, so it can initially be mounted as ext2 directly. If you want to resize your root filesystem, you have to migrate the blocks after it to another location, or move the whole LV to a contiguous region large enough for the new size and re-run LILO. I think it is already possible to specify an offset into a block device for the / filesystem (think bootfloppy), so the kernel could mount /dev/hda1 + X blocks read-only at boot, and when it goes to mount read/write it remounts /dev/rootvg/lv00 as read-write.

I think I need to dig a bit more into the LILO code to see what's really happening there.

Cheers, Andreas

Signature · 3 lines
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
#1 lore raw
Quoted 3 lines · Andreas Dilger
Quoted 3 lines

Yes. Would it be reasonable to have LVM tools check for this and warn the user?

One idea for making this happens is to have a way of locking
logical extents to physical extents so that you have to use a special command to unlock them. This kind of thing is already done in different parts of LVM to make sure you don't delete logical volumes that are in use, or remove physical volumes that still have extents allocated to them.

One this exists, altering lilo to detect LVM, and automatically
lock the necessary logical->physical extent mappings isn't too hard.

Quoted 8 lines

You need to re-run LILO even if you move the kernel on a regular filesystem, so I don't think it's that important if LVM doesn't warn you about this. How often do you move LVs around anyways? If you keep them in your /boot LV and it's only a couple of PPs in size, it shouldn't be an issue. Under AIX, you are forced to have your boot LV contiguous (which I think LILO doesn't need, as long as it is a single disk), and you are still required to run "bosboot" if you move or mirror your BLV.

Well, the problem is that moving a few physical extents does not
obviously suggest re-running lilo. Many physical extents are fine to move, and trying to keep track of which physical extents lilo cares about, and which one's it doesn't isn't a task I think a sysadmin should have to deal with.

The locking mechanism makes a sysadmin aware of when they're
moving something that lilo (or some other program that maintained information about where stuff physically was) cared about, and re-run the necssary utilities so than can regather the information they need.

Quoted 5 lines

How does LILO do this now? It currently gets a filename for the kernel, and that's it. It must do some sort of internal calculation or IOCTL to get the physical block numbers on the disk. Is the problem that it does its calculations w.r.t. the start of the partition?

That's an interesting question, and I'm curious about it. I
believe this also has implications for reiserfs /boot partitions.

Quoted 2 lines
Quoted 2 lines

- the kernel needs to be able to reconstruct enough of the lvm descriptors to mount / at boot time.

I don't believe this is a problem. There is already something
called lvm_initrd that creates a ramdisk to load the lvm modules and build the lvm devices so root can be mounted from an lvm device. It could be improved, but I have a suspicion this isn't a big problem.

While I expected that /boot would have to be ext2fs, and
allocated a very generous 50M to it, I purposely compiled lvm into the kernel in the hopes of one day having an lvm / parition. Of course, resizing an lvm / partition is a dicey affair. :-)

Quoted 2 lines

I think I need to dig a bit more into the LILO code to see what's really happening there.

I think so too. Sadly, though I have time to post here, I don't
have time to dig into lilo.

Have fun (if at all possible),

Signature · 4 lines
Its name is Public Opinion.  It is held in reverence. It settles everything.
Some think it is the voice of God.  Loyalty to petrified opinion never yet
broke a chain or freed a human soul.     ---Mark Twain
-- Eric Hopper ([email protected]  http://omnifarious.mn.org/~hopper) --