can't install GRUB

I had openSUSE 11.2 installed, along with WinXP and Win7. In order to reinstall WinXP (unattended install DVD), I had to make it the first primary partition, so I deleted the small Linux boot partition that was the first primary, and moved the fat32 partition to be first. When I recreated the Linux boot partition, it ended up being the last primary partition, even after the extended partition, like this:

sda1 winxp 8gb
sda2 win7 28gb
sda3 extended
sda4 boot 200mb
sda5 data 200gb (ntfs)
sda6 swap 2gb
sda7 opensuse 8gb

I tried reinstalling openSUSE, and everything installs fine except GRUB. With the current config, am I breaking the 1024 cylinder rule? How can I switch sda3 with sda4, without having to delete sda3 first? Or maybe I’m completely off on this…
Should I use some windows boot loader instead of grub? I would prefer to use grub on principle.

Typically you don’t need a /boot partition

Ideally you should boot a Linux live CD or something like parted magic and let us see the real state of your partitioning with

fdisk -l

The info you have listed is really not sufficient for us to advise properly:

However. Typically I would have the boot flag * on the extended partition only and the menu.lst in the root partition under /boot/grub/menu.lst
If you had a /boot partition but had to delete it, you will have deleted the boot info. This can be restored with a suse live cd, but it’s complicated. Do you have a 11.2 cd or dvd? Just confirm that you plan to keep 11.2

So, according to your installation, this is what you have:

sda1  winxp 8gb
sda2  win7 28gb
sda3  extended
sda4  boot 200mb
sda5  data 200gb (ntfs)
sda6  swap 2gb
sda7  opensuse 8gb

To make this work, you would need to either:

  1. Install Grub into the MBR so as to “boot” openSUSE from /dev/sda7

OR

  1. Install Grub into /dev/sda3 and mark it active for booting.

With Option one, it will be some trouble to get back to a setup with Windows that would allow the installation of a service pack. See my generic write up here:

openSUSE Dual Booting with Windows 7 AND Loading Service Pack 1 for Windows 7

With option two, all works, but you would NOT want to run the Windows Partitioning Software and this setup is not normal and at least one user reported the entire disk was messed up after Windows made some changes to it. Here is some more information about partitioning.

Each hard drive can have up to four PRIMARY partitions, any of which could be marked active and bootable. No matter what you might hear, only one of the first four primary partitions can be booted from. That means you can boot from Primary partitions 1, 2, 3 or 4 and that is all. In order to boot openSUSE, you must load openSUSE and the grub boot loader into one of the first four partitions. Or, your second choice is to load the grub boot loader into the MBR (Master Boot Record) at the start of the disk. The MBR can be blank, like a new disk, it can contain a Windows partition booting code or generic booting code to boot the active partition 1, 2, 3, or 4. Or, as stated before, it can contain the grub boot loader. Why load grub into the MBR then? You do this so that you can “boot” openSUSE from a logical partition, numbered 5 or higher, which is not normally possible. In order to have more than four partitions, one of them (and only one can be assigned as extended) must be a extended partition. It is called an Extended Primary Partition, a container partition, it can be any one of the first four and it can contain one or more logical partitions within. Anytime you see partition numbers 5, 6 or higher for instance, they can only occur inside of the one and only Extended Primary partition you could have.

What does openSUSE want as far as partitions? It needs at minimum a SWAP partition and a “/” partition where all of your software is loaded. Further, it is recommended you create a separate /home partition, which makes it easier to upgrade or reload openSUSE without losing all of your settings. So, that is three more partitions you must add to what you have now. What must you do to load and boot openSUSE from an external hard drive? Number one, you must be able to select your external hard drive as the boot drive in your BIOS setup. Number two, you need to make sure that the external hard drive, perhaps /dev/sdb, is listed as the first hard drive in your grub device.map file and listed as drive hd0. I always suggest that you do not load grub into the MBR, but rather into the openSUSE “/” root primary partition which means a primary number of 1, 2, 3 or 4. If number one is used, then that will be out. You will mark the openSUSE partition as active for booting and finally you must load generic booting code into the MBR so that it will boot the openSUSE partition. I suggest a partition like this:

  1. /dev/sdb, Load MBR with generic booting code
  2. /dev/sdb1, Primary NTFS Partition for Windows
  3. /dev/sdb2, Primary SWAP (4 GB)
  4. /dev/sdb3, Primary EXT4 “/” openSUSE Partition Marked Active for booting (80-120 GB)
  5. /dev/sdb4, Primary EXT4 “/home” Your main home directory (Rest of the disk)

OK, For your disk setup, you might go with this:

  1. MBR Loaded with Generic Booting Code
  2. /dev/sda1 winxp 8gb, Must Load this to start Windows XP
  3. /dev/sda2 win7 28gb
  4. /dev/sda3 extended, Grub Loaded and Marked Active for Booting
  5. /dev/sda4 boot 200mb, Must Load this in grub to start Windows 7
  6. /dev/sda5 data 200gb (ntfs)
  7. /dev/sda6 swap 2gb
    7 /dev/sda7 opensuse 8gb, The grub Boot load in /dev/sda3 will load its menu and openSUSE OS from here.

Thank You,

I don’t want to do this, because if you resize or move partitions within the extended primary partition, it’s beyond my knowledge to get grub to point to the right sector. I say this based on a previous attempt, where I pretty much lost openSUSE on the logical partition, because I didn’t know how to get Grub to point to it.

  1. Install Grub into /dev/sda3 and mark it active for booting.
    … Further, it is recommended you create a separate /home partition, which makes it easier to upgrade or reload openSUSE without losing all of your settings.
    Thank you! I didn’t know it stored the settings. Other reasons were given that I didn’t really care about, so I chose not to have a /home partition. I do this with Windows as well, by moving user profiles to another partition. I may be creating a /home partition, but this is a discussion for another topic.

…OK, For your disk setup, you might go with this:

  1. MBR Loaded with Generic Booting Code
  2. /dev/sda1 winxp 8gb, Must Load this to start Windows XP
  3. /dev/sda2 win7 28gb
  4. /dev/sda3 extended, Grub Loaded and Marked Active for Booting
  5. /dev/sda4 boot 200mb, Must Load this in grub to start Windows 7
  6. /dev/sda5 data 200gb (ntfs)
  7. /dev/sda6 swap 2gb
    7 /dev/sda7 opensuse 8gb, The grub Boot load in /dev/sda3 will load its menu and openSUSE OS from here.
    From what I understand, the extended primary partition is not actually a partition, but a marker for the logical partitions, so how are you going to put the grub stage2 in a marker (rather than a partition)? Again, this is my perspective, correct me if I am wrong. I have dev/sda4 specifically to contain Grub stage 2. Are you saying I can have Grub stage 2 in the very beginning of the extended partition? That would be awesome because I could have one more primary to play with.

Also, do you know if my current setup has the 4th primary partition /dev/sda4 outside of the 1024 cylinder limit? It may not be important for me right now (if I follow your instructions), but I’d like to know.

ps. I want to keep the pretty graphical boot option afforded by stage 2, and I want to add other Linux distributions in further logical partitions in the future.

I’d have to handwrite all this, unless you tell me how to save the info to a file that I can access when booting into Windows, because that’s all that works right now. Would it be something like

fdisk -l > c:\partinfo.txt

Typically I would have the boot flag * on the extended partition only and the menu.lst in the root partition under /boot/grub/menu.lst
What would be easiest for me, if I wanted to be able to resize primary or logical partitions?

If you had a /boot partition but had to delete it, you will have deleted the boot info. This can be restored with a suse live cd, but it’s complicated. Do you have a 11.2 cd or dvd? Just confirm that you plan to keep 11.2
I already reformatted the root partition and installed openSUSE 11.3. However, the installation was successful on everything besides the package Grub. Probably because I gave it wrong info, but I feel like I’ve tried everything. My 11.2 network install CD is “broken”, according to the media test. So I downloaded the network install CD for 11.3.

From what I understand, the extended primary partition is not actually a partition, but a marker for the logical partitions, so how are you going to put the grub stage2 in a marker (rather than a partition)? Again, this is my perspective, correct me if I am wrong. I have dev/sda4 specifically to contain Grub stage 2. Are you saying I can have Grub stage 2 in the very beginning of the extended partition? That would be awesome because I could have one more primary to play with.

Also, do you know if my current setup has the 4th primary partition /dev/sda4 outside of the 1024 cylinder limit? It may not be important for me right now (if I follow your instructions), but I’d like to know.

ps. I want to keep the pretty graphical boot option afforded by stage 2, and I want to add other Linux distributions in further logical partitions in the future.
The Extended Primary Partition is special, but it still has the characteristics of any primary partition in that it can be marked active for booting and you can load the grub boot loader into it. In the openSUSE Booting section, you would pick a custom partition location of /dev/sda3 and you would elect to mark it active for booting. Consider first that Grub has multiple parts which don’t have to reside in the same place on a disk, the first or boot stage must be located in the active booting partition (or MBR) while the rest can be located in the openSUSE partition, including its boot menu.

If you place the primary root “/” partition into partitions 1, 2, 3 or 4, then there is no need to load grub into the MBR or into an Extended Primary Partition, just place it in the openSUSE partition. However, if openSUSE is located in a partition numbered 5 or higher, then you have only two choices. Load Grub into the MBR or into an Extended Primary Partition container. You have only so many choice that can boot. As stated before, loading Grub into the MBR does allow the booting of openSUSE from ANY partition, Logical or Primary.

The 1024 cylinder limit is an old problem which only exist with old computer BIOS’ made before 128 GB (or what ever the exact number was) was broken and is of no longer concern, but the error message in Grub has not been removed and will likely never be removed. As for a graphical boot, just keep the line gfxmenu (hd?,?)/boot/message there (where ? is the location of the grub menu partition) and follow my other Grub loading guide lines. Now as for the following terminal command:

su -
password:
fdisk -l

Just use your mouse to highlight, copy the text and then paste it into a message using the advance message text editor and place it all into a code “#” tag field (highlight the pasted text only and press the code # symbol). Here are the results when I run this command:

james@linux-dwqx:~> su -
Password: 
linux-dwqx:~ # fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00006dcf

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   976762879   488380416    7  HPFS/NTFS/exFAT
/dev/sda2       976762880   993540095     8388608   82  Linux swap / Solaris
/dev/sda3       993540096  1953503231   479981568   83  Linux

Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c0ff4

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048   156301311    78149632   83  Linux

I purchased a small SSD (80 GB) which is /dev/sdb1 and through my BIOS setup, boot openSUSE from it while Windows 7 and everything else is on /dev/sda.

Thank You,

It sounds like you are working with limited resources.
Saving the fdisk info should be simple especially if you have a network connection. Just paste it here:
SUSE Paste
select keep forever and send us the link

or save the text to a file and copy it to a flash drive and then use that in windows etc…