FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-26-2012, 08:39 PM
Bob Proulx
 
Default grub gets confused when I upgrade the kernel

Hendrik Boom wrote:
> I have two different Debian systems on my EEEPC -- stable and testing.
>
> Whenever testing installs a new kernel as a result of the routing update,
> my grub/menu.list file gets rewritten. WHen it does this, it matches the
> kernels I have in one Debian sysstem with the fie-system root I have in
> the other.

This is a little confusing. Are you saying that you are sharing one
/boot directory with two different systems? Or something different.

> I have to hand-edit menu.list to make things right again,
> using static boot stanzas in front of the AUTOMAGIC KERNEL LIST.
>
> (a) Is there any way I can stop this misbehaviour?

In Squeeze the update-grub script is called due to the script located
in /etc/kernel/postinst.d/zz-update-grub (previously from the config
file /etc/kernel-img.conf) where it calls update-grub. If you can
determine the customization needed for your situation then you should
be able to edit that file and make modifications there.

The grub-legacy /usr/sbin/update-grub script is a text shell script.
By reading through what it does there you should be able to understand
what is happening and therefore how to deal with it.

Your description confuses me because update-grub looks in /boot for
existing kernels. But you say that it is the wrong list. That
implies to me that you have /boot mounted from the wrong system.

In any case, perhaps I should say "worst case", it should be possible
to hack on update-grub in place to do what you want.

> (b) If I were to progress to grub2, where I gather I can't take control
> of the boot process by editing menu.lst, is there some other way of
> making sure things go right? I fear that one of these years, upgrading
> to grub2 will become inevitable.

The grub2 uses a process that assembles parts from here and there
together into the resulting /boot/grub/grub.cfg file. That file is
effectively read-only since it is assembled from parts located
elsewhere. Those parts take pieces from /etc/default/grub where most
configuration is expected to be performed and inserted into template
files located in /etc/grub.d/* files.

Configuration can mostly be done by tweaking variables in
/etc/default/grub. Worst case is that the template files in
/etc/grub.d/* would need to be modified. The new system is definitely
less transparent and more complicated than the previous one.

Bob
 
Old 02-26-2012, 08:50 PM
Marc Auslander
 
Default grub gets confused when I upgrade the kernel

Hendrik Boom <hendrik@topoi.pooq.com> writes:
...
>
> (b) If I were to progress to grub2, where I gather I can't take control
> of the boot process by editing menu.lst, is there some other way of
> making sure things go right? I fear that one of these years, upgrading
> to grub2 will become inevitable.
>

With grub2 you put custom stanzas into /etc/grub.d and they are
included in grub.cfg (the new menu.lst) whenever it is rebuilt. I use
this to make absolutely sure my default kernel stays the default
kernel, for example.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87mx85e038.fsf@aptiva.optonline.net">http://lists.debian.org/87mx85e038.fsf@aptiva.optonline.net
 
Old 02-27-2012, 04:09 AM
Hendrik Boom
 
Default grub gets confused when I upgrade the kernel

On Sun, 26 Feb 2012 14:39:06 -0700, Bob Proulx wrote:

> Hendrik Boom wrote:
>> I have two different Debian systems on my EEEPC -- stable and testing.
>>
>> Whenever testing installs a new kernel as a result of the routing
>> update, my grub/menu.list file gets rewritten. WHen it does this, it
>> matches the kernels I have in one Debian sysstem with the fie-system
>> root I have in the other.
>
> This is a little confusing. Are you saying that you are sharing one
> /boot directory with two different systems? Or something different.

I'm getting the kernels in the /boot partition of one system matched with
the file-system root partition of the other system.

-- hendrik


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jif35l$r1d$1@dough.gmane.org">http://lists.debian.org/jif35l$r1d$1@dough.gmane.org
 
Old 02-27-2012, 07:15 AM
Bob Proulx
 
Default grub gets confused when I upgrade the kernel

Hendrik Boom wrote:
> I'm getting the kernels in the /boot partition of one system matched with
> the file-system root partition of the other system.

I looked at the update-grub script and at first glance I don't see how
that is possible It looks for kernels in /boot. I don't see how it
can be pulling files from some other /boot unless it is the mounted
one. The mounted /boot should be the one that matches your current
filesystem.

Perhaps you could debug /usr/sbin/update-grub with 'set -x' and such
and see why it is doing what it is doing on your system.

Bob
 
Old 02-27-2012, 01:09 PM
Andrei POPESCU
 
Default grub gets confused when I upgrade the kernel

On Du, 26 feb 12, 20:54:31, Hendrik Boom wrote:
> I have two different Debian systems on my EEEPC -- stable and testing.
>
> Whenever testing installs a new kernel as a result of the routing update,
> my grub/menu.list file gets rewritten. WHen it does this, it matches the
> kernels I have in one Debian sysstem with the fie-system root I have in
> the other. I have to hand-edit menu.list to make things right again,
> using static boot stanzas in front of the AUTOMAGIC KERNEL LIST.
>
> (a) Is there any way I can stop this misbehaviour?
>
> (b) If I were to progress to grub2, where I gather I can't take control
> of the boot process by editing menu.lst, is there some other way of
> making sure things go right? I fear that one of these years, upgrading
> to grub2 will become inevitable.

Assuming the two installs are *not* sharing /boot[1] this should work
with grub-pc + os-prober out of the box, *but* I recommend letting only
one install deal with the MBR (stable would be the obvious choice,
unless you need features from testing grub-pc).

[1] it's still not obvious from your replies to Bob

For maximum flexibility you can also let each system install its own
grub in the partition and have one "master" grub in the MBR with a
static grub.conf to select between the systems. I have such a setup
(with a shared /home) and I could be convinced to detail it somewhere on
the web.

Hope this helps,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
 
Old 02-28-2012, 05:50 PM
Hendrik Boom
 
Default grub gets confused when I upgrade the kernel

On Mon, 27 Feb 2012 01:15:40 -0700, Bob Proulx wrote:

> Hendrik Boom wrote:
>> I'm getting the kernels in the /boot partition of one system matched
>> with the file-system root partition of the other system.
>
> I looked at the update-grub script and at first glance I don't see how
> that is possible It looks for kernels in /boot. I don't see how it can
> be pulling files from some other /boot unless it is the mounted one.
> The mounted /boot should be the one that matches your current
> filesystem.

Interesting. And puzzling. Shouldn't it provide boot entries for all
the OS's on the system, including both Linuxes? That would mean it has
to find both root and boot partitions. It does find Windows.

-- hendrik


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jij7kq$ou5$1@dough.gmane.org">http://lists.debian.org/jij7kq$ou5$1@dough.gmane.org
 
Old 02-28-2012, 05:57 PM
Bob Proulx
 
Default grub gets confused when I upgrade the kernel

Hendrik Boom wrote:
> Bob Proulx wrote:
> > Hendrik Boom wrote:
> >> I'm getting the kernels in the /boot partition of one system matched
> >> with the file-system root partition of the other system.
> >
> > I looked at the update-grub script and at first glance I don't see how
> > that is possible It looks for kernels in /boot. I don't see how it can
> > be pulling files from some other /boot unless it is the mounted one.
> > The mounted /boot should be the one that matches your current
> > filesystem.
>
> Interesting. And puzzling. Shouldn't it provide boot entries for all
> the OS's on the system, including both Linuxes? That would mean it has
> to find both root and boot partitions. It does find Windows.

Other systems are included due to the actions of the os-prober part.
But those should always be included later in the list after the local
ones. But I didn't look over the script in detail. I am sure that if
you dug into it with set -x that it would make sense to you and then
you could adapt it to your needs.

Bob
 
Old 02-29-2012, 06:44 AM
Tom H
 
Default grub gets confused when I upgrade the kernel

On Tue, Feb 28, 2012 at 1:50 PM, Hendrik Boom <hendrik@topoi.pooq.com> wrote:
> On Mon, 27 Feb 2012 01:15:40 -0700, Bob Proulx wrote:
>> Hendrik Boom wrote:
>>>
>>> I'm getting the kernels in the /boot partition of one system matched
>>> with the file-system root partition of the other system.
>>
>> I looked at the update-grub script and at first glance I don't see how
>> that is possible It looks for kernels in /boot. *I don't see how it can
>> be pulling files from some other /boot unless it is the mounted one.
>> The mounted /boot should be the one that matches your current
>> filesystem.
>
> Interesting. *And puzzling. *Shouldn't it provide boot entries for all
> the OS's on the system, including both Linuxes? *That would mean it has
> to find both root and boot partitions. *It does find Windows.

I can't see the update-grub scripts of grub1 or grub2 making such a
mistake if the two installs aren't sharing the same "/boot".


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAOdo=SzA959SWxsuD+vZFSZ8CSfkF=zDrp307y_SVqqt3-qaAg@mail.gmail.com">http://lists.debian.org/CAOdo=SzA959SWxsuD+vZFSZ8CSfkF=zDrp307y_SVqqt3-qaAg@mail.gmail.com
 
Old 03-15-2012, 06:35 PM
Hendrik Boom
 
Default grub gets confused when I upgrade the kernel

On Sun, 26 Feb 2012 20:54:31 +0000, Hendrik Boom wrote:

> I have two different Debian systems on my EEEPC -- stable and testing.
>

Let me see if I understand grub's interpretation of menu.lst correctly.
I have a boot stanza in my menu.lst:

title Debian GNU/Linux, kernel 3.0.0-1-686-pae testing (squeeze-grub) OK
root (hd0,5)
kernel /vmlinuz-3.0.0-1-686-pae root=/dev/mapper/VG1-testing--root ro
initrd /initrd.img-3.0.0-1-686-pae

this means that the kernel, /vmlinuz-3.0.0-1-686-pae, is taken from the
top-level directory on partition (hd0, 5) which what used to be called /dev/sda6,
and that when this kernel is booted, it will use /dev/mapper/VG1-testing--root
as its root partition. It's the /etc/fstab file within
/dev/mapper/VG1-testing--root that it will use to find out what to
mount on /boot, which should properly be the same (hd0, 5) that was
used to find the kernel.

And finally, when grub-update is run, it uses some of the options within
menu.lst when it creates the new one. Here I mean options other than
just the existing hand-made static boot stanzas.

-- hendrik


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jjtgam$fd2$1@dough.gmane.org">http://lists.debian.org/jjtgam$fd2$1@dough.gmane.org
 
Old 03-18-2012, 02:26 AM
Bob Proulx
 
Default grub gets confused when I upgrade the kernel

Hendrik Boom wrote:
> Let me see if I understand grub's interpretation of menu.lst correctly.
> I have a boot stanza in my menu.lst:
>
> title Debian GNU/Linux, kernel 3.0.0-1-686-pae testing (squeeze-grub) OK
> root (hd0,5)
> kernel /vmlinuz-3.0.0-1-686-pae root=/dev/mapper/VG1-testing--root ro
> initrd /initrd.img-3.0.0-1-686-pae

> this means that the kernel, /vmlinuz-3.0.0-1-686-pae, is taken from
> the top-level directory on partition (hd0, 5) which what used to be
> called /dev/sda6,

Yes.

> and that when this kernel is booted, it will use
> /dev/mapper/VG1-testing--root as its root partition.

Yes.

> It's the /etc/fstab file within /dev/mapper/VG1-testing--root that
> it will use to find out what to mount on /boot, which should
> properly be the same (hd0, 5) that was used to find the kernel.

Yes.

> And finally, when grub-update is run, it uses some of the options within
> menu.lst when it creates the new one. Here I mean options other than
> just the existing hand-made static boot stanzas.

Yes. All correct.

Bob
 

Thread Tools




All times are GMT. The time now is 01:24 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org