[Mageia-discuss] can bootable partitions be detected during installation?

blind Pete 0123peter at gmail.com
Wed May 2 15:38:43 CEST 2012


Following up my own post, sorry.  

blind Pete wrote:

> Wolfgang Bornath wrote:
> 
>> 2012/4/29 blind Pete <0123peter-
> Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>:
>>> Hi,
>>>
>>> During a test installation of M2b3 some other installations are
>>> detected and get listed in the Grub menu, but others don't.
>>> For example, Ubuntu is ignored.  That uses Grub2 so it would be
>>> a bit much to expect Grub to understand it, BUT Ubuntu's Grub2
>>> is installed on Unbutu's root partition.
>>>
>>> Can partitions with boot loaders on them be detected and listed
>>> in Grub's menu as something to be chained?  i.e. Install M2b3
>>> and get Grub installed to the mbr.  Then on booting, Grub could
>>> present a menu that includes all of the standard M2b3 options,
>>> any other kernels that were found (not the Ubuntu kernels because
>>> they are under Grub2 and too hard) and an entry for the Ubuntu
>>> partition.  The partition is LABELed "Ubuntu".  If "Ubuntu" were
>>> selected from the M2b3 mbr Grub menu, then the Grub2 on the Ubuntu
>>> root partition could be chained (and then an Ubuntu kernel).
>>>
>>> Is this do-able?
>> 
>> Yes. That is the way I install all distributions.
> 
> I meant, is it possible for the installer to do it *automatically*
> during installation?

dd if=/dev/sdaN ibs=512 count=1 | grep "LILO\|GRUB" 
seems to detect if partition N is bootable.  

> Have I missed an installation option?  Should this be a feature
> request - or a bug report?  M2b3 "lost" my Ubuntu installation.
> It was a quick and easy thing for me to recover from, but it could
> torment a newbie.

I think a bug report about not finding Ubuntu.  

>> 1. Install a minimal small distribution which uses grub, without X.
>> The only purpose is to put its grub into the MBR and serve as the
>> "steering center".
> 
> Typically, I end up with Grub or Grub2 on each root partition and
> LiLo on the mbr.
> 
>> 2. Install all other distributions with putting their bootloader into
>> their respective root partition
>> 
>> 3. Enter the installations into the menu.lst of the steering center's
>> grub with
>> 
>> title <distributiion name>
>> root (hd0,4)
>> chainloader +

blkid  /dev/sdaN -o export | grep LABEL
if [ 0 == $? ] 
then 
    title $(blkid  /dev/sdaN -o value | sed s/\ .*//)
else
    title /dev/sdaN
root (sd0,N-1)
chainloader +

> Can we get this automated?
> 
> Can a bootable partition be detected?
> 
> Should this entry be as well as, or instead of, the existing entries?
> My feeling is that everything should be included and the user
> can then delete what is not wanted.
> 
>> Here the bootloader of the distribution to start lies in /dev/sda5
>> 
>> The advantage of this way is not only that you can install
>> distributions with different bootloaders. Whenever you install a new
>> kernel in any of these distributions you have to do nothing extra
>> because the new kernel is set in the distribution's bootloader, not in
>> the master boot loader.
> 
> Agreed.
> 




More information about the Mageia-discuss mailing list