The officially official Devuan Forum!

You are not logged in.

#1 Yesterday 20:11:48

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 226  

[SOLVED] MBR and efi booting issue

I was recently gifted a HP 15 dy-1023 laptop computer with 4-cores and 12gb ram and and I am not having any success with a working grub install.  Any idea or help is appreciated. 

I have updated the laptop BIOS to the latest version and the BIOS settings shows that Legacy Mode is "enabled" which disables the "secure boot" option.  The Legacy Boot options are listed in the BIOS. But the BIOS also says that the UEFI options will be a higher precedent.  After making these changes, the MBR USB flash drive was recognized and the live drive booted.  I immediately wiped the old proprietary system, created a new legacy msdos MBR on the drive and created the /root and /swap partitions.  The live install completed normally.  I used refracta-tools to build the snapshot and installed from a daedalus legacy mbr install (no gpt drive or UEFI, thus a regular grub install).   

The only way that I can get this install to boot is to use supergrub boot disk. 

My troubleshooting is mostly trial and error, after researching the need for EFI installs using extra partitions like a 1mb unformatted partition if using a gpt drive on a legacy system, a /efi (fat32) partition, and a /boot (ext2) partition.  I have tried the install using both options together and individually using legacy grub and grub-efi-amd64 but I still get the same HP error upon booting.  The error is this:

Boot Device Not Found
Please Install an Operating System
Hard Disk - (3FO)

I think this is a hardware and/or grub install issue since it will boot using supergrub.

Final note... everything that deals with U(EFI) in the BIOS is supposedly disabled, and the hard drive has a msdos master boot record.  But the install does have  /sys/firmware/efi folder and it is populated with some files and folders , which leads me to believe that it is actually trying to use efi.  Is this correct?  If so, this may be part of the problem.  I read some posts on a different linux forum board about HP laptops not actually having true legacy bios functions but a simulated ability, which makes me confused.  Just mentioning this as a possible consideration.

I like legacy technology and I have fought this GPT and UEFI thing as long as I can.  My question is, what do I need to do to successfully get this thing to boot into Devuan?  If I have to start over and reinstall, no problem.

Offline

#2 Today 02:58:13

rbit
Member
Registered: 2018-06-12
Posts: 52  

Re: [SOLVED] MBR and efi booting issue

first thing that comes to mind is, ensure the boot partition has the "boot" flag - if /boot is not a separate partition, then make sure the root partition has the boot flag

Offline

#3 Today 09:35:12

Camtaf
Member
Registered: 2019-11-19
Posts: 463  

Re: [SOLVED] MBR and efi booting issue

Try using grub install from the live disk...

I found that I needed to be connected to the internet for grub to install properly....

Last edited by Camtaf (Today 09:37:04)

Offline

#4 Today 11:21:49

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 226  

Re: [SOLVED] MBR and efi booting issue

Thank you both for your suggestions.

first thing that comes to mind is, ensure the boot partition has the "boot" flag

The /boot partition 1gb, is formatted ext2, and the boot flag is active.

Try using grub install from the live disk

I did this as one of my efforts to work around this issue, but not from the live disk.  I ran "grub-install /dev/nvme0n1" while booted with the aid of supergrub.  This command installed grub to the beginning of the drive.  Should I have installed it to the /boot partition instead?  For over 19+ years of using linux, I have always installed grub to the drive and not a partition.  Does efi change this behavior?

Offline

#5 Today 12:19:11

rolfie
Member
Registered: 2017-11-25
Posts: 1,249  

Re: [SOLVED] MBR and efi booting issue

Not so simple, MBR/GPT and legacy/UEFI gives you 4 possible combinations.

Here are my thoughts: You want a legacy installation, should be possible.

Bios setting: can't you set the bios to legacy driver first? Since its a laptop this might be limited. On my mainboards its possible.

CSM mode is an emulation of the old legacy bios behaviour on every uefi bios you can find on the market. No exception. CSM has been dropped on new designs nowadays.

Install media: I do not use live media or refracta installer, they are limited, at least for me and my wish to encrypt every OS I do install. I use the netinstall. That works for sure.

Booting the install media: on an uefi PC you have to pay attention how you boot the usb stick. When you stick that in and look at the boot options you get, you will see the stick twice. Example: its from Sandisk, you will get a Sandisk entry and a UEFI Sandisk entry in the boot options. For your legacy install make sure you boot the entry without the UEFI prefix. This topic is also important for grub-install. Only when booted in legacy mode you can run the legacy grub-install.

/boot-Partition: I would use ext4.

MBR partitioning: every tool should leave about 1MB free space before the first partition. This space is used by grub for a hidden installation of this famous stage2 files. No bios_grub or ESP required.

GPT partitioning: you could do a legacy installation on a GPT disk too. But its a bit more complicated. Since the GPT scheme needs 34 sectors instead of only 1 for the MBR, you need a bios_grub partition (no filesystem, 1MiB is fine, I give it 8MiB to be on the safe side, bios_grub flag needs to be set). grub installs its stage2 into this bios_grub partition. No ESP required for legacy.

grub-install in legacy mode goes into the MBR. No need to install it to /boot. You need to specify the device for the installation. The boot flag has to be set either to the separate /boot or to /.

grub-install in uefi-mode is a completely different beast. You do not specify a device, can be left off. Some kB of the bootloader goes into the ESP, all the rest is installed into /boot. The booting mechanism is completely different from the old legacy days.

grub installs fine without any network connection in both legacy as efi mode installs, at least from the netinstall. the live/refracta stuff may be differernt, I never use this path.

Since the laptop has an uefi bios /sys/firmware/efi will be present and have entries, but cause no harm. Actually some of that stuff will be required to be able to boot from USB sticks ...

I hope this gives you some background. I would use a netinstall for a fresh installation. That should do the job.

PS: some HP laptops resist anything but Windows. Lets see if we can tame this one.

Last edited by rolfie (Today 12:22:13)

Offline

#6 Today 12:31:50

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,362  

Re: [SOLVED] MBR and efi booting issue

Afaict, grub2 is too large to fit into the traditional 440 bytes of MBR and it does require a boot loader space of at least 1Mb prior to the first partition.
https://www.gnu.org/software/grub/manua … b.html#MBR

EDIT: There is however the issue of accessing an nvme drive which for grub requires a bios that implements the driver. This may mean that you must use the UEFI bios for booting with grub2, unless the legacy bios implements the nvme driver.

For UEFI boot, the boot loader is kept in a FAT filesystem, and the UEFI bios provides nvme driver support. grub2 documentation is not very clear about UEFI boot as it mixes it up with the notion of "secure boot", which is an optional function for UEFI boot. It also mingles it up with having a GUID Partiion Table (GPT) which is a different choice.

If you use UEFI boot, you install a different grub package, like grub-efi-amd64 and let it spin its magic.

Offline

#7 Today 13:23:43

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 226  

Re: [SOLVED] MBR and efi booting issue

Thanks guys, I appreciate this information.  I will never understand this UEFI think unless I actually use and experience it.  So, I need to continue trying and learning.  I will follow up on this and let you know how it goes, after I read it a few times ... (-;

I am thinking that instead of trying and forcing the legacy BIOS and MBR thing, I just may try and use the intended UEFI install without the secure boot option and see how that goes.  I will follow up on this when I have something to report... like success, hopefully.

Offline

#8 Today 15:23:11

rolfie
Member
Registered: 2017-11-25
Posts: 1,249  

Re: [SOLVED] MBR and efi booting issue

I am thinking that instead of trying and forcing the legacy BIOS and MBR thing, I just may try and use the intended UEFI install without the secure boot option and see how that goes.

Good approach. Learn it now. In the long run efi is the future.

And I must say I like GPT partitioning. No more fiddling with extended partitions and logical drives.

Last edited by rolfie (Today 15:23:57)

Offline

#9 Today 16:03:21

Andre4freedom
Member
Registered: 2017-11-15
Posts: 183  

Re: [SOLVED] MBR and efi booting issue

I agree to rolfie,
Your laptop computer seems to be fairly recent. That means it's no use to fiddle with MBR and Legacy BIOS modes.
To successfully install Devuan Daedalus:
- completely reset your BIOS/Firmware settings and
- DISABLE just "Secure Boot"
- boot your PC with a Daedalus USB stick
- wipe the disk completely
- let the setup program configure your disk
- modify the setup to reduce the root filesystem
- add a /home partition (ext4) into the now free place
  (of course you can set up any partition you like, but leave the EFI partition unchanged)
- let the installer do it's work
- Then reboot to check if the system behaves as planned
- Now you may re-install as you like, but leave the boot structure unchanged, then it should work well.

BTW, EFI (UEFI) mode with Secure Boot disabled and the disk in GPT mode is preferable.
Possibly you don't need my advice, still, sometimes it's good to be reminded of it.
Good luck

Offline

#10 Today 19:58:50

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 226  

Re: [SOLVED] MBR and efi booting issue

Success!

I used the devuan_daedalus_5.0.1_amd64_netinstall.iso to install onto this 5 year old HP laptop.  It boots fine and I thank each of you for your input. 

Andre4freedom, thank you for that list above.  It is exactly what I did and it worked.  Now I am good to go with a fairly modern laptop.

Thanks again guys!

-niXer

Offline

Board footer