Grub won't install

I am trying to install the i586 version of OpenSuSE onto a Dell Dimension 3000. And during the last phase of the install where it installs Grub I receive the message: An error occurred during boot loader installation. Retry boot loader configuration?

The hard drive has:
sad1 - Fat16 DOS7
sda2 - Extended
sda5 - NTFS Windows XP
sda6 - swap
sda7 btrfs
sda8 xfs
And in running gparted it says the partition table: msdos

This is my second attempt at installing Linux on this HD. In reading the help it was recommended to install grub on the root partition which I did.
However when I try and boot I get the selection to either boot dos or to boot Windows XP.

So, how can I get grub installed to where I get the selection of linux, DOS, or Windows XP?

Searched for solutions but didn’t find one. In the mean time I will keep searching…

Probably this problem:

I.e. grub2 cannot be installed after the MBR because there’s not enough space (your first partition probably begins at sector 63, as was the standard upto Windows XP), and the installer doesn’t support to install it to the btrfs root partition.

Workarounds:

  • Re-partition your hard disk from scratch using YaST, the MBR gap would be big enough then and it might also give better performance, but all data and existing operating systems will be lost of course
  • Use ext4 as root filesystem instead of btrfs
  • create a separate /boot partition (ext2) and install grub there

Thank you for the ideas to try and will do so in the am.

Since the fist partition is DOS (FAT16), would it be a good thing to shrink it and put the /boot partition in as a primary partition?

If you have enough spare space there – sure.

Or, maybe, you could shrink it only slightly, and move it to the right, so that it begins at sector 2048 instead of sector 63. You can probably do that with “gparted”. And then your installed opensuse should be able to be rescued by installing grub in the MBR.

Is this an EFI machine?? You can totally confuse things if you have both a MBR and a EFI install or at any time in the past tried that. I ask because a FAT is an indication that the drive may have been setup as an EFI boot at some time. Look into the FAT partition and see if it has EFI boot files.

With the partitioning shown in the first post, no it isn’t EFI. I think Dell stopped making the Dimension line before EFI machines were readily available.

I seldom look up hardware if people don’t take the time to give full specs. Like they think we know every brand and model :stuck_out_tongue:

The fat partition looked specious and not know the size or looking up the specs of the model I thought I’d check it would match the problem. You should avoid mixing EFI and MBR on the same media. Yes it can be done on some but it just does not make sense and is bound to cause problems at some point

No, the machine is too old for that. Nice thought though.

Understandable… In this case there really is a FAT16 partition with DOS on it.

Thankfully I have avoided the problems with EFI for now.

OK, getting back on track here…

OK some success! Linux 13.2 is installed as well as GRUB. Created a /boot partition in the ext4 format and the root is in ext4 format as well.

The downside is that the GRUB menu has no selection for DOS. I can re install but how would I go about that?

And There is a selection in GRUB for Windows XP but after selecting it the screen goes blank and the curser flashes.

The output of an fdisk -l is:
Disk /dev/sda: 74.5 GiB, 80026361856 bytes, 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
Disklabel type: dos
Disk identifier: 0x00022a3b

Device Boot Start End Sectors Size Id Type
/dev/sda1 63 1429846 1429784 698.1M 6 FAT16
/dev/sda2 4192965 156280319 152087355 72.5G f W95 Ext’d (LBA)
/dev/sda3 2232320 4192255 1959936 957M 82 Linux swap / Solaris
/dev/sda4 * 1431552 2232319 800768 391M 83 Linux
/dev/sda5 4193028 60372331 56179304 26.8G 7 HPFS/NTFS/exFAT
/dev/sda6 60372992 98879487 38506496 18.4G 83 Linux
/dev/sda7 98881536 156278783 57397248 27.4G 83 Linux

Partition table entries are not in disk order.

and the df is:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda6 18819812 6840260 11000508 39% /
devtmpfs 248464 4 248460 1% /dev
tmpfs 252996 88 252908 1% /dev/shm
tmpfs 252996 1092 251904 1% /run
tmpfs 252996 0 252996 0% /sys/fs/cgroup
/dev/sda4 379525 35315 320095 10% /boot
/dev/sda7 28684612 81528 28603084 1% /home

Is that the FAT a real DOS OS?? :open_mouth:

In that case not absolutely sure that openSUS will detect that.You should not need to reinstall. But you may have some hand editing to do. But first go to Yast -boot loader - boot loader options and be sure that the probe foreign OS box is ticked if it is untick and re tick to make an apparent change then accept (OK)

If it does not work then we will have to do a chain load and I’m not certain how to do that in Grub 2 you usually don’t need to. But DOS is so old it may simply not recognize it and need to be told explicitly where and what to boot

You should not need to reinstall. Let’s try to add a boot entry for your DOS.

You will need to edit a file as root. Th e file is in the directory “/etc/grub.d”
The name of the file is “40_custom”.

Add these 5 lines to the end of the file.


### entry to boot DOS 7 on "/dev/sda1"
menuentry "Boot DOS 7 on /dev/sda1"   {
            set root=(hd0,1)
            chainloader +1
}

The first of those lines is just a comment, and does nothing.

After you have added those lines, run the command:


# grub2-mkconfig -o /boot/grub2/grub.cfg

That should regenerate the boot configuration, and incorporate the additional lines.

That should allow you to boot DOS.

I’m not sure about booting XP. I expect that when you boot DOS, you actually get a Windows boot menu allowing you to choose between DOS and XP. It will probably work for both. But you will have to test that to find out.

If it still does not work, then you will have to move grub2 to the MBR so that you can set the DOS partition to be active while still using grub2 to boot.

Considering it is a WinXP machine, I doubt that. Also, the info posted seems to indicate not.:wink:

BTW: A lot of the older WinXP installs actually had a DOS partition by default, strange considering it was supposed to be their first full abandonment of DOS.

I suspect you are right. The early XP versions, if they had that DOS partition, booted from that partition, if my memory serves me.:\

Just to add:
You can also put those lines into /boot/grub2/custom.cfg if you like (create the file if it doesn’t exist), this gets loaded by grub.cfg on boot.
Or you can also put them into /boot/grub2/grub.cfg, between those lines:

### BEGIN /etc/grub.d/90_persistent ###### END /etc/grub.d/90_persistent ###

Things put there will be taken over when grub.cfg is recreated…
:wink:

I never saw a DOS partition on a fresh Windows XP install, not even the first versions. Windows XP (the installation CD) doesn’t even contain DOS.

Of course everything is possible on a pre-installed system though… (the manufacturer/seller might have pre-installed both DOS and Windows XP)

What did you do exactly, step by step? Did you shrink some partition? Did you move some partition? If yes, which one(s)? Booting often depends on absolute disk address (in case if Windows as well) so any change in disk locations may cause problems.