Multi-boot menu hijacked by 12.1; but HOW? And how to revert?

I have a disc with several partitions & operating systems, previously managed very easily with NT bootloader & its boot.ini file in the first DOS partition (sda1). Installing OepenSuse 12.1 I was fooled by asking that its boot was from its ‘/’ partition (sda10) into overlooking a further hidden option not to overwrite the MBR. On rebooting, I find myself with OpenSuse’s boot menu, not the previous NT loader one. Luckily I can get to that - and need to - via the ‘Windows’ Suse menu choice.

I keep backups of the MBR and all partition boot sectors. So I assumed that by re-writing the MBR (446 bytes) from its backup, I would be back where I was. Not so: still the Suse menu! Mystery. I have compared actual & backups of both the MBR (sda) and sda1 boot sectors - and they remain identical! So:
1] Where is the change?
2] How do I get back to the NT bootloader menu on booting?

Here is output from ‘findgrub’ (see, I have searched the forum); in fact sda7 is Ubuntu:-

Find Grub Version 3.5.1 - Written for openSUSE Forums

 - reading MBR on disk /dev/sda                       ...
 - searching partition /dev/sda1      (FAT16)         ... --> Windows NT/2K/XP Loader found in /dev/sda1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can add the following entry to /boot/grub/menu.lst :

###Don't change this comment - YaST2 identifier: Original name: WindowsBootLoader###
title Windows on /dev/sda1
    rootnoverify (hd0,0)
    chainloader +1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 - reading bootsector  /dev/sda2   *  (Extended)      ... --> Legacy GRUB  found in /dev/sda2   => sda10  0x83 (openSUSE)
 - searching partition /dev/sda5      (NTFS)          ...
 - reading bootsector  /dev/sda6      (LINUX)         ... --> Legacy GRUB  found in /dev/sda6   => sda6   0x83 (Mandriva)
 - reading bootsector  /dev/sda7      (LINUX)         ... --> Legacy GRUB  found in /dev/sda7   => sda7   0x83 (Mandriva)
 - skipping partition  /dev/sda8      (swap)         
 - reading bootsector  /dev/sda9      (LINUX)         ... --> Legacy GRUB  found in /dev/sda9   => sda9   0x83 (Fedora)
 - reading bootsector  /dev/sda10     (LINUX)         ... --> Legacy GRUB  found in /dev/sda10  => sda10  0x83 (openSUSE)

and another useful tool ‘boot_info_script055.sh’ after installing 12.1:-

                Boot Info Script 0.55    dated February 15th, 2010                   
 

============================= Boot Info Summary: ==============================

 => Windows is installed in the MBR of /dev/sda
 => Windows is installed in the MBR of /dev/sdb

sda1: _________________________________________________________________________

    File system:       vfat
    Boot sector type:  Fat16
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files/dirs:   /boot.ini /ntldr /NTDETECT.COM /COMMAND.COM

sda2: _________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  Grub
    Boot sector info:  Grub 0.97 is installed in the boot sector of sda2 and 
                       looks at sector 71728611 of the same hard drive for 
                       the stage2 file. A stage2 file is at this location on 
                       /dev/sda. Stage2 looks on partition #10 for 
                       /boot/grub/menu.lst.
......
sda10: _________________________________________________________________________

    File system:       ext4
    Boot sector type:  Grub
    Boot sector info:  Grub 0.97 is installed in the boot sector of sda10 and 
                       looks at sector 71728611 of the same hard drive for 
                       the stage2 file. A stage2 file is at this location on 
                       /dev/sda. Stage2 looks on partition #10 for 
                       /boot/grub/menu.lst.
    Operating System:  Welcome to openSUSE 12.1 
                       "Asparagus" - Kernel ().
    Boot files/dirs:   /boot/grub/menu.lst /etc/fstab

and by good luck, before installing 12.1:-

                Boot Info Script 0.55    dated February 15th, 2010                   
 

============================= Boot Info Summary: ==============================

 => Windows is installed in the MBR of /dev/sda
 => Windows is installed in the MBR of /dev/sdb

sda1: _________________________________________________________________________

    File system:       vfat
    Boot sector type:  Fat16
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files/dirs:   /boot.ini /ntldr /NTDETECT.COM /COMMAND.COM

sda2: _________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info:  
......
sda10: _________________________________________________________________________

    File system:       ext4
    Boot sector type:  Grub
    Boot sector info:  Grub 0.97 is installed in the boot sector of sda10 and 
                       looks at sector 63315347 of the same hard drive for 
                       the stage2 file. A stage2 file is at this location on 
                       /dev/sda. Stage2 looks on partition #10 for 
                       /boot/grub/menu.lst.
    Operating System:  Welcome to openSUSE 11.2 
                       "Emerald" - Kernel ().
    Boot files/dirs:   /boot/grub/menu.lst /etc/fstab
......
================================ sda1/boot.ini: ================================

[boot loader]
timeout=30
default=c:\boot\bootsda6.man
[operating systems]
C:\boot\bootsect.dos="NWDOS on /dev/sda1" 
multi(0)disk(0)rdisk(0)partition(2)\WINNT="Microsoft Windows 2000 Server" /fastdetect
c:\boot\bootsda6.man="Mandrake 2010.0 on /dev/sda6" 
c:\boot\bootsda7.ubu="Ubuntu 10.04 on /dev/sda7" 
c:\boot\bootsda9.fed="Fedora 12 on /dev/sda9" 
c:\boot\bootsa10.sus="Suse 11.2 on /dev/sda10"
......


which shows a change for the extended partition sda2 boot sector. How is this involved? What is now the boot sequence?

FWIW OpenSuse 11.2 was already installed an sda10, booted from the NT loader via the sda10 partition boot sector. I simply overwrote it with 12.1. Any suggestions about how to return to this situation would be welcomed. Also an explanation of how I now see the Suse boot menu on booting when the MBR appears unchanged.

Lewis Smith

the bootflag has been set on the extended partition (sda2)

sudo /sbin/sfdisk /dev/sda -A1

The OS info is only reliable for openSUSE and Fedora, because they use their own patched version of Legacy Grub. “Mandriva” here means Mandriva, ArchLinux, Debian … and probably others. In the latest findgrub version (3.6.2), I put “Mandriva/ArchLinux/Debian”. You can get the latest version here: http://www.unixversal.com/linux/open...grub-3.6.2.tgz.

Notice that you can install findgrub from my repo too. It is included in updategrub. In that case, it would get updated when you do zypper update. It’s up to you. It’s just a script. The way you install it doesn’t matter. But when you install from repo, it’s easier to update.

If you have Ubuntu in sda7, it has to be a very old version, as I don’t remember the latest Ubuntu version that was using Legacy Grub … or you did install Legacy Grub yourself in Ubuntu (?).

Yes, it’s an excellent script. But you should install the latest version too.

Thanks for your reply. Well spotted! This possibility occured to me during a night of little sleep.
Yes, the bootable partition was changed form 1 to 2, and I changed it back with fdisk, and got back to where I was.
This is obscure behaviour…

Will do so. Thanks for saying.

It is the latest! But arrived at by updating progressively from (I think) 10.04.

Thanks again for pointing this out.

Lewis Smith

No, it’s not obscure*. It’s the way openSUSE does it. It doesn’t install Grub in MBR, unlike other distros, but in a partition boot sector. However it writes a generic boot code in MBR. You like that - because it is perfect for your NT bootloader, but other people don’t, believe me. Now with a generic boot code, it has to set the bootflag on its partition in order to boot. That’s all.

  • Well it’s not obscure, but it’s not obvious either.

Nothing obscure about that. It is expected behavior.

During the boot configuration part of install, you can tell it not to set the active flag. And I sometimes do that. But often, it is better. That way, the system can reboot and complete the installation without problem. You can’t get back into opensuse any other way, until you have updated the copy of the boot sector used for your Windows boot menu.

I often find it easier to let the opensuse install change the active flag appropriately. Then, after a reboot, and after everything is checked as working well, I use “dd” to update the Windows boot setup. After testing that works, I then flip the active bit back to windows.

Please supply the full link. I tried all sorts to find this version, in vain. (I have 3.5.1).

Where does this much cited ‘generic’ MBR code jump to? The boot sector of the bootable partition? Is it coincidence that this generic MBR is the same as written by NT loader and GRUB?

TIA Lewis Smith

This is the full link: [noparse]http://www.unixversal.com/linux/openSUSE/findgrub-3.6.2.tgz[/noparse]](http://www.unixversal.com/linux/openSUSE/findgrub-3.6.2.tgz)

You should delete the older findgrub and cfindgrub scripts.

Easier method : delete the older scripts and install updategrub from repo:

su -l
zypper ar [noparse]http://download.opensuse.org/repositories/home:/please_try_again/openSUSE_12.1/[/noparse]  PTA
zypper refresh -r PTA
zypper in updategrub

In the very first sector of the hard disk: the Master Boot Record.

No. This is a VBR (Volume Boot Record), the first sector of a partition.

Grub boot code in MBR ist not the same as Generic boot code.
NT generic boot code and openSUSE generic boot code are very similar. I will implement a function in findgrub when I have time to display the type o generic MBR (Windows 7 generic, Vista generic, openSUSE generic). I think it will be a valuable information.

You’re right. The link I provided in post #3 doesn’t work. Sorry about that.

On 01/25/2012 11:26 AM, please try again wrote:
> This is the full link: ’
> http://www.unixversal.com/linux/openSUSE/findgrub-3.6.2.tgz
> (http://www.unixversal.com/linux/openSUSE/findgrub-3.6.2.tgz)

if you look back to post #3 the link is absolutely mangled!

what did you do different in the two posts?

if nothing, then i’d guess you (or someone, like the OP who was slowed
down because of it) should put a note (referencing posts #3 and #8) in
the forum on forum suggestions <http://tinyurl.com/5r4xfkd> about fixing
the sometimes seen trashing of links problem…


DD
openSUSE®, the “German Engineered Automobiles” of operating systems!

I must have copied/pasted it from another post.

The second time:

[noparse][/noparse][noparse][noparse]http://www.unixversal.com/linux/openSUSE/findgrub-3.6.2.tgz[/noparse][noparse][noparse]](http://www.unixversal.com/linux/openSUSE/findgrub-3.6.2.tgz)[/noparse]

I had to use 5 <noparse> to display the code above. :frowning:

Yes, it’s not easy to post links.