[Top][All Lists]

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

Re: managing a multiboot without stomping the toes of other OSes

From: Jordan Uggla
Subject: Re: managing a multiboot without stomping the toes of other OSes
Date: Sun, 16 Jan 2011 23:43:08 -0800

On Fri, Jan 14, 2011 at 1:13 AM, Rustom Mody <address@hidden> wrote:
> Hi.
> I have a system with ubuntu on sda5 and debian on sda6 and a dedicated
> grub partition on sda3 (mbr points to sda3)
> The sda3 grub.cfg only chainloads to sda5 with title ubuntu and
> likewise sda6 with title debian.
> Further bootsector grubs in sda5 and 6 manage the detailed linux options.
> The problem is that whenever some package is updated (eg grub-pc) it
> 'detects' other OSes and makes a grub.cfg with all kinds of junk such
> as the debian kernel with the ubuntu filesystem etc etc.  What is
> worse, it meddles with the sda3/mbr grub
> So what I want is that I should be able to tell the Debian grub:
> 1. You are sitting on sda6 (not sda)

Installing GRUB to a partition requires the use of blocklists pointing
to data on a filesystem. Because filesystems give no guarantee that
they won't move the data for any given file to a different area on the
disk, this list of blocks may end up pointing to completely different
data. This usually manifests itself in the bootloader simply freezing
very early during boot without any useful error message (because you
can't fit much error reporting into the 440 bytes reserved in the boot
sector), but could also be a security vulnerability as it could lead
to the execution of arbitrary code with full privileges. GRUB legacy
and all other bootloaders share this same problem when no dedicated
embedding area is available (such as the pos-mbr gap which is used
when grub is installed to the mbr on msdos partition tables, or a BIOS
boot partition with GPT), it's just that GRUB legacy didn't warn the
user about it. Luckily, installing GRUB to a partition boot sector is
almost never needed. So I would have your dedicated GRUB install use
the mbr rather than a PBR.

> 2. So please leave sda alone

To keep Debian from overwriting the mbr (and thus your dedicated GRUB
installation) on upgrades of the grub-pc package, run
"dpkg-reconfigure grub-pc" and uncheck sda from the list of install

> 3. Please dont 'detect' other OSes

Add "GRUB_DISABLE_OS_PROBER=true" to /etc/default/grub

As for how you should set up your dedicated GRUB partition's grub.cfg
so that it can boot any of your installed distributions, the simplest
way is to use grub's "configfile" command. For example "search --set
--fs-uuid UUID_HERE; configfile /boot/grub/grub.cfg" will load that
distribution's grub menu, without chainloading. If for some reason you
feel the need to actually load the other distribution's GRUB, rather
than just its grub.cfg, you can do so (without unreliable blocklists)
by using multiboot to load GRUB's core.img from the filesystem rather
than chainloading a partition boot sector, for example "search --set
--fs-uuid UUID_HERE; multiboot /boot/grub/core.img"

> Likewise in ubuntu
> Thanks
> Rusi
> _______________________________________________
> Help-grub mailing list
> address@hidden

reply via email to

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