Cannot boot into GRUB on legacy BIOS system

Hi,

I went through the installation process for openSUSE Tumbleweed. I used the recommended partitioning. When I rebooted, I got a BIOS error that an operating system could not be found. I am using legacy BIOS. I was able to boot into to the system using the live usb, and everything was working.

Does anyone know the issue?

Thanks.
Rohan

Hi and welcome to the Forum :slight_smile:
Can you boot from the live usb, open a terminal and show the output from the following fdisk command;


su -
fdisk -l
exit

Boot live linux, run bootinfoscript/bootinfoscript at master · arvidjaar/bootinfoscript · GitHub, upload results to https://susepaste.org/.

IMHO you need to manually set legacy BIOS booting during installation.
Partitioning differs from UEFI, etc.

Installed TW netinstall on a Coreboot machine last weekend, no such thing as a BIOS/UEFI selection menu here…

Wanted to boot a BIOS TW on a Gigabyte board set to BIOS yesterday, the board didn’t find the SSD with TW until I chose in the BIOS options “reset to failsafe defaults”. Afterwards the SSD and a HDD were identfied as bootable with BIOS installs…

Turn on “CSM Support” in mobo settings. Then proceed with installation. For disk partitioning you need MBR, not GPT.
(GPT with Linux is possible, but I not tried it yet, and Windows requires [BIOS+MBR [b]or UEFI+GPT]).

CSM Support
Enables or disables UEFI CSM (Compatibility Support Module) to support a legacy PC boot process.
Enabled
Enables UEFI CSM. (Default)
Disabled
Disables UEFI CSM and supports UEFI BIOS boot process only.

From 4. Installation - Howto Install openSUSE on Your Computer :

For disk partitioning you need MBR, not GPT.

Yepp, but that’s been the default here for any TW I installed (though I always use EXT4, not BTRFS…).

Hi,

Sorry, I meant the Install USB, not the Live USB. I booted from the Install USB and selected the “Load Linux Kernel”, then I selected /dev/sda1, and it booted into the installed system. I think the only problem is the bootloader.

Here is the output for fdisk:


rohan@XPS-L702X:~> sudo fdisk -l
[sudo] password for root: 
Disk /dev/sda: 238.49 GiB, 256060514304 bytes, 500118192 sectors
Disk model: SAMSUNG SSD PM83
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: gpt
Disk identifier: CD225F90-F864-4A27-A6A6-3691A4C44708

Device         Start       End   Sectors   Size Type
/dev/sda1       2048 495923199 495921152 236.5G Linux filesystem
/dev/sda2  495923200 500118158   4194959     2G Linux swap


Disk /dev/sdb: 14.93 GiB, 16008609792 bytes, 31266816 sectors
Disk model: Cruzer          
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: 0x4b07bb88

Device     Boot Start     End Sectors  Size Id Type
/dev/sdb1        3480   12047    8568  4.2M ef EFI (FAT-12/16/32)
/dev/sdb2  *    12048 9082879 9070832  4.3G 17 Hidden HPFS/NTFS
rohan@XPS-L702X:~> 

fdisk print command:


Disk /dev/sda: 238.49 GiB, 256060514304 bytes, 500118192 sectors
Disk model: SAMSUNG SSD PM83
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: gpt
Disk identifier: CD225F90-F864-4A27-A6A6-3691A4C44708
First LBA: 34
Last LBA: 500118158
Alternative LBA: 500118191
Partition entries LBA: 2
Allocated partition entries: 128

Device         Start       End   Sectors Type-UUID                            UUID                                 Name Attrs
/dev/sda1       2048 495923199 495921152 0FC63DAF-8483-4772-8E79-3D69D8477DE4 F56A8F79-4A3B-421A-BB56-1BEE50BD3AA6      LegacyBIOSBootable
/dev/sda2  495923200 500118158   4194959 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F D1A644EA-39F2-479A-8F6F-6D2D7B2BD4C9  

Thanks,
Rohan

Hi
Disk /dev/sda does not have the boot flag set.


fdisk /dev/sda
a
1
w

The a for set boot flag, the 1 to select sda1, the w to write, then you should see the * against /dev/sda1 from the fdisk -l output.

Hi,

The command a in fdisk does not work when I tried it, and it doesn’t come up on the help screen.

When I typed x to go to expert mode, there was a command A to “toggle the legacy BIOS bootable flag”. Is that the one you are talking about? /dev/sda1 already shows “LegacyBIOSBootable” when typing p.

Thanks,
Rohan

Then you may need to set the pmbr_boot flag.

I think you can set it this way:

Yast → System → Boot Loader

The next screen should have an entry for “Protective MBR flat”. Change the setting to “set” to set that flag. Then click “Okay”.

If that doesn’t solve your problem, then post the output from:

parted /dev/sda print

(you will need to run that as root).

Hi,

Unfortunately that did not work.

Parted output:


Model: ATA SAMSUNG SSD PM83 (scsi)
Disk /dev/sda: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: pmbr_boot

Number  Start   End    Size    File system     Name  Flags
 1      1049kB  254GB  254GB   btrfs                 legacy_boot
 2      254GB   256GB  2148MB  linux-swap(v1)        swap


Thanks,
Rohan

What is the output from:

cat /etc/default/grub_installdevice

Hi
You still have not set the boot flag… follow through with the command you discovered in the previous post.

The other option of course is a re-install and re-configure the disk to dos…

Hi,

Here is the output:

rohan@XPS-L702X:~> cat /etc/default/grub_installdevice 
/dev/disk/by-uuid/50cf2f1d-3fdb-47e6-8737-e741ac6156f3
activate
generic_mbr
rohan@XPS-L702X:~> ^C
rohan@XPS-L702X:~> 


Thanks,
Rohan

Hi, I tried turning it on and off, the asterisk next to /dev/sda1 never appeared…

Thanks,
Rohan

That actually looks okay. The current “fdisk” does not show a “*” for active partition when GPT partitioning is used. But the legacy_boot flag is set, so it should be fine.

The BIOS should not care about that. If the pmbr_boot flag is set, that makes it look as if the protected partition is bootable.

The other option of course is a re-install and re-configure the disk to dos…

Yes, it is possible that the BIOS is confused by GPT. But this would be the first time I have come across that.

Hmm, one more test (addressing the OP).

Can you provide the output from this:


fdisk /dev/sda
x
d
q

To explain. The “x” switches to expert mode.
The “d” in expert mode tells it to dump (in hexadecimal) the MBR (first sector).
The “q” quits without saving anything.

Here’s what I am looking for. The dump output should end in “55 aa” which is a flag saying that this disk is bootable. And there should be what look like boot code in the first few lines.

Are you sure? AFAICR, 55 AA is quite simply an end of MBR sector flag, whether on MBR disk or GPT disk. On a MBR disk, the boot “flag” is an 80 byte at any of offsets 0x1BE, 0x1CE, 0x1DE or 0x1EE, which flag is often found also on PBR sectors on Linux disks.

Here’s a look at this area on one of my GPT disks from using DFSee partitioning tool:

Actual unedited log of my DFSee session:
http://fm.no-ip.com/Tmp/Dfsee/ab250/dfsL084.txt
740x5040 .png of the session tail (vast majority).
http://fm.no-ip.com/SS/dfs-gpt-3sects.png

Highlights are:
partitions listing (fdisk -r- -w-)
1st sector HEX dump (t Hex)
2nd sector synopsis (gf)
2nd sector HEX dump (t Hex)
7th partition boot sector synopsis (t Hex)
7th partition boot sector HEX dump

Quite often BIOS will refuse to attempt to boot from MBR (i.e. - jump to loaded code) if this flag is not present.

the installer usually is able to correctly determine if the system runs in legacy/csm or uefi - auto-selects the correct type for the main boot drive - and installs grub in the correct mode
fdisk shows the drive is set as GPT, but OP says the board is set to use legacy/csm - simple answer: a legacy/csm is unable to boot a gpt drive - simple as that
possible fixes: either re-install with the boot drive formated as mbr - or change to uefi

btw: about coreboot: although it’s able to run in uefi mode many coreboot devices are set to legacy/csm - so no really point mention it