help-grub
[Top][All Lists]
Advanced

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

Re: Question on using grub2 in an lv and moving pv's between disks and t


From: David Jablonski
Subject: Re: Question on using grub2 in an lv and moving pv's between disks and then pulling original disk
Date: Fri, 24 Feb 2012 13:41:20 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0

On 02/23/2012 05:27 PM, Jordan Uggla wrote:
> On Thu, Feb 23, 2012 at 1:21 PM, David Jablonski <address@hidden> wrote:

> What you're probably missing is that grub-install always has two
> important arguments, one is the device where grub's boot sector should
> go, and the other option is the --boot-directory= option which
> specifies where grub-install should copy its modules to, and configure
> the core.img to read from at boot. If you don't specify a
> --boot-directory= option then it defaults to "/boot/".  That means
> that if you run just "grub-install /dev/sdb", while booted into a
> system where /boot/ is for example on sda1, you'll end up with a grub
> installation whose boot sector and core.img are on /dev/sdb, but which
> will look for its modules and grub.cfg on sda1. If you want to be sure
> that the grub installation depends only on files from /dev/sdb then
> you need to either chroot into the sytem on sdb before running the
> command (as you did from the rescue CD) or mount the partition
> containing /boot/ somewhere and specify a --boot-directory= option.
> For instance "mount /dev/sdb1 /mnt/ && grub-install
> --boot-directory=/mnt/boot/ /dev/sdb".
> 

Wouldn't the issue of where the boot directory be alleviated by putting
/boot on an lv?  That's where I'm confused.  What is the mechanism by
which grub2-install marks where it's /boot directory is?  If the /boot
directory is a lv shouldn't grub2 boot sector just be pointing to the
lv?  So if I move the pv extents of /dev/sda2 to /dev/sdb2 (which
includes the /boot lv) after extending the vg to the two disks and then
reducing the vg off of /dev/sda2 I would think that grub2 shouldn't
really care that /boot physically is on /dev/sdb2 as long as
grub2-install puts the boot sector on the /dev/sdb and is pointing to
the lv that has /boot.  This works correctly once I was able to install
grub from the rescue cd.  I can then move the pv extents back and forth
between disks and boot up with the disk that currently has the pv
extents on it.  I'm just not sure why this doesn't work the first time I
do the grub2-install on /dev/sdb.  What info is it holding onto as the
/boot directory is a lv?

Is it using /dev/sda1 because that's the BIOS Boot Partition to hold the
location of /boot?  Again though if I dd if=/dev/sda1 of=/dev/sdb1 then
shouldn't it still be pointing to the /boot lv and really shouldn't care
which physical disk the /boot lv is on?

Is there some documentation on how enable debugging and see more of
what's happening when grub2 does it install?  I could probably have a
better sense of what's happening.

Again I believe I'm missing something fundamental but I just am not able
to put my finger on it.

Thanks again for your help.

-- 
David W. Jablonski
Systems Administrator
INOC
608.204.0202
608.663.4555
address@hidden
www.inoc.com

*** DELIVERING UPTIME ***




reply via email to

[Prev in Thread] Current Thread [Next in Thread]