I am currently rebuilding a couple laptops
and a desktop to dual boot Windows and Suse 11.2.
Windows is installed on partition 1.
On the laptops, the build goes fine and dual
boot with grub is OK. No issues.
But on the desktop, the exact same build
(after all the on-line updates, etc)
fails with “Operating system not found”
on the final (and first) boot.
It seems that the Suse 11.2 build is somehow resetting the active partition and the boot does not see grub or Windows. When I reset partition #1 back to "active, only Windows loads. So I guess I need to fix this by reinstalling grub. Or use the Windows boot loader.
(1) Where is grub located on my system?
(2) What partiton is the Linux master Boot record
If I wanted to use the Windows boot loader
and do the following command to grab the 512 bytes I need:
dd if=/dev/sna? of=grub.bin bs=512 count=1
My partition layout is below. This is
output from gdisk.exe in DOS7. It’s
an 80gig drive.
1 = Windows-7
2 = /boot
3 = swap
5 = /
6 = /fat32
Partition Mbytes System Usage
1 PRIMARY 30001.0 NTFS/HPFS 39%
2 PRIMARY 3000.0 LINUX 4%
3 PRIMARY 8000.0 LINUX SWAP 10%
4 EXTENDED 35306.9 46%
5 LOGICAL 18002.5 LINUX 24%
6 LOGICAL 17304.4 FAT32 23%
Only one OS can control the MBR. So, openSUSE in the MBR and it will load GRUB. From there, you either boot openSUSE, or you “chainload” Windows or another Linux OS.
No. By default openSUSE (since 11.2) installs Grub in the boot sector of the root or boot partition and set the active flag to this partition (unless you unckeck that option in the boot advanced options). As a consequence, Grub seems to be in the MBR since it boots the computer, but that’s only because the Windows partition (if any) has been set inactive and the partition holding Grub has become the active one.
Normally it would be in /, but because /boot is a primary partition and / a logical one, the setup might have choosen /boot instead (since it is a little bit safer).
If you want to find out, just dd the first sector of each partition to standard output. In one or the other case you should see the string GRUB.
**dd if=/dev/sda2 bs=512 count=1
dd if=/dev/sda5 bs=512 count=1
**
You can read the mbr as well:
dd if=/dev/sda bs=512 count=1
Which of those binary garbages contains the string GRUB ?
A point of correction:
A ‘generic or XP’s’ MBR boot code can not directly boot any logical volume so that leave out sda5 “/”.
We know that grub stage 1 is not in the MBR, can not be in XP’s partition nor can it be is swap. That still leaves 2 different places it could have been written to.
Likely place is sda2 “/boot”
could also be in sda4 “W95 Ext’d (LBA)”.
So as to “please_try_again” last post, the 2 dd commands to run is:
dd if=/dev/sda2 bs=512 count=1
dd if=/dev/sda4 bs=512 count=1
That’s right. It would not boot directly from a logical partition. However you can perfectly choose to install Grub in a logical during Setup and it would do it (I currently have Grub in sda11) but it would never boot directly. Fortunately, when I do such things, I already have another Grub in MBR. So what would openSUSE setup do in such a situation, when you choose to install Grub in the root partition and it happens to be a logical one? More likely it will also install Grub in the MBR or in the extended partition. I’ll tip for the extended partition, since I already found Grub bootloader in there that I never installed myself.
BTW I already asked the following question (which nobody has answered yet): what sense does it make to activate the root partition if it is a logical one? That’s what openSUSE setup does: the option “activate” root partition is enabled by default. It doesn’t get unchecked if you choose a logical partition. And I guess (not 100% sure because I ususally rewrite my partition tables) but I think that it does in fact set the active flag to a logical partition (but don’t ask me where!)
Just wrote this quick and dirty script. It will look for the strings GRUB and NTLDR in all bootsectors of the specified device. Without argument it will check sda.
#! /bin/bash
dev=/dev/sda
"$1" ] && dev=/dev/$1
if -b $dev ] ; then
dd if=$dev bs=512 count=1 2> /dev/null | grep -q GRUB && echo "Grub found in MBR"
dd if=$dev bs=512 count=1 2> /dev/null | grep -q NTLDR && echo "NT Loader found in MBR"
for pt in `fdisk -l $dev | awk '/^\/dev/ { print $1 }'` ; do
dd if=$pt bs=512 count=1 2> /dev/null | grep -q GRUB && echo "Grub found in $pt"
dd if=$pt bs=512 count=1 2> /dev/null | grep -q NTLDR && echo "NT Loader found in $pt"
done
fi
As I said, it’s quick and dirty (no help or colored output).
please_try_again–I only have a old SuSe cd , so can not be sure on below.
So what would openSUSE setup do in such a situation, when you choose to install Grub in the root partition and it happens to be a logical one?
Would say that is a normal setup when you have multiple Linux’s installed or no primary partitions for Suse.
Old Suse let you select any partition/MBR/no install/install generic MBR or any combination for grub stage 1 install. Do not know what the default locations are, never used the default settings. Never ever install grub stage1 on a Fat32 or NTFS partition.
what sense does it make to activate the root partition if it is a logical one?
can not think of one, but know it will set partition active. Some third party boot managers will do the same thing.
(but don’t ask me where!)
it is set in the extended partition table “EPT”. Each logical volume does have its own EPT.
As for the script, it will do what is needed to find ‘grub’ but on no hdd’s MBR will it ever find “NTLDR”. NTLDR will only be found on a XP’s, ‘not sure just what all MS’s OS’s use ntldr’, partition’s volume boot record. You can say I’m being picky, it is simple and works. I did have to figure out just how to run a script.
I would not come to that idea and to tell you the truth, I don’t have FAT32 or NTFS partitions (except in virtual machines). However the concept ‘Grub on DOS’ rings a bell somehow. I guess that some people must have installed it on FAT16 partitions.
What sense does it make to activate the root partition if it is a logical one?
can not think of one, but know it will set partition active
I’m glad you agree with me on that point. I feel less lonely.
Another reason why it doesn’t make sense is that Linux doesn’t care whether its boot partition is active or not and DOS/Windows and others (all UNIX) requires a primary partition to boot. Finally that behaviour is kind of approximative from a decent Linux setup. Let us be picky !
it is set in the extended partition table “EPT”. Each logical volume does have its own EPT.
Oh yes. It’s just that the EPT contains only one partition geometry. So it’s kind of absurd to set a flag here to a unique partition. Or it wouldn’t be a flag anymore.
Tertium not datur! lol!
As for the script, it will do what is needed to find ‘grub’ but on no hdd’s MBR will it ever find “NTLDR”.
findgrub
Grub found in MBR
NT Loader found in /dev/sda1
Grub found in /dev/sda11
It will find NTLDR as soon as it is present in a boosector, but it would of course be only in a primary partition (agreed, no need to check the others - bad engeenering! But I said it was quick and dirty). I do not recall if the Windows partition needed to be the first one (that would not surprised me that much). I have always installed Windows in a logical NTFS partition (Yes Sir!) and kept ntldr and other boot stuff in the first partition (FAT16). It used to be me much easier to fix (there was a time when you couldn’t mount NTFS on Linux or anybody else. So having boot.ini and ntldr on a FAT partition was safer.)
NTLDR will only be found on a XP’s, ‘not sure just what all MS’s OS’s use ntldr’, partition’s volume boot record.
I could have greped for “MSDOS” too. Only NT based MS’ OS use ntldr. It excludes all DOS, Win 95/98 and Millenium. However I use ntldr on my old DOS partition (and so the script finds it).
You can say I’m being picky, it is simple and works.
I do not recall if the Windows partition needed to be the first one (that would not surprised me that much).
That is a miss conception. MS 98 and XP will boot just fine on a logical partition with NO primary partition on any hdd. They just will not install with out a primary partition, clean or repair. So I would never recommend it. They would need to be cloned to the logical partition. But sometimes Suse will rearrange the partitions and put XP into the extended position.
If grub stage 1 is put on a FAT32 partition ‘sometimes it happens in linux install’ , it will over write the needed Volume Boot Record. In that case the partition will be seen as RAW, due to the lose of the Bios Parameter Block.
Non of the above helps ‘qawtbh’ with his problem, so will close.
They look for a drive C: , which would become the first MS readable (FAT or NTFS/HPFS) logical of the first HD in the absence of any (MS readable) primary.
They just will not install with out a primary partition, clean or repair.
Correct.
So I would never recommend it.
I wouldn’t either. But sometimes you do things that you wouldn’t recommend.
Non of the above helps ‘qawtbh’ with his problem, so will close.