# mixed GPT and MBR boot disks



## waasnsteffl (Feb 24, 2022)

Hi,
Still rather pretty unexperienced with EFi etc, i would like to ask this.
i have one SSD with MBR, the second with GPT on my HP folio.
i like to keep jumping with F1/2/F5 from one to the other disk and have it automatically booting in the last booted slice.
Is thei possible like on the GPT defined SSD with "gpart bootcode -b /boot/boot0 ada0" without loosing my data
or are there other ways to do this, or do i have to step back to MBR/Legacy on my HP

ada0            447 GB  GPT
              ada0p1        260 MB  efi
              ada0p2        4.0 GB  freebsd-swap
              ada0p3        70 GB   freebsd-ufs  /
              ada0p4        70 GB   freebsd-ufs  
              ada0p5        303 GB  freebsd-ufs    /U      
and 
ada1            112 GB  MBR
              ada1s1        40 GB   ntfs
              ada1s2        72 GB   BSD
              ada1s2a     72 GB   freebsd-ufs    /  

Thanks for advice, Anton


----------



## SirDice (Feb 24, 2022)

waasnsteffl said:


> Is thei possible like on the GPT defined SSD with "gpart bootcode -b /boot/boot0 ada0" without loosing my data


Possible? Sure (FreeBSD won't stop you from shooting yourself in the foot). Will it work? No, not at all. EFI doesn't boot via the bootsector. You don't have a freebsd-boot partition with gptboot(8) or gptzfsboot(8) code, so even if you wrote the correct boot sector (/boot/pmbr) it will still not be able to boot. Your ada0 can only be booted in UEFI mode at the moment.

You might be able to remove your current efi partition and recreate a new efi partition, slightly smaller than you have now. Your swap could also be made a little smaller. As long as you create some free space for the freebsd-boot partition to exist. On a GPT disk you _need_ a freebsd-boot partition in order to boot it with CSM. 

Also note that boot0 is part of boot0cfg(8), which only works for MBR.

If you want a system that's capable of booting different versions of FreeBSD you'll want to use ZFS and boot environments (bectl(8) or beadm(1)). Through boot environments it's easy to select FreeBSD 13.0-RELEASE, 13-STABLE and 14-CURRENT for example.


----------



## waasnsteffl (Feb 24, 2022)

Thanks!
looks like i will stay using MBR further. sadly too little time for getting more experienced. What makes me extremly displeased is the so much userfriendly HP Bios, which forgets or unacitivates the last active slice and switches into uefi checks, even from legacy mode, when a usb device without active slice ist put in. so from now on it is not possible to boot, without making a slice newly active.

Greetings, Anton


----------



## SirDice (Feb 24, 2022)

I'm guessing the SSD with MBR holds your original Windows installation? You probably want to keep that. If not I would just reinstall it, using GPT this time. Set up windows to EUFI boot too. If everything is able to EUFI boot you can use rEFInd as your boot selector to select booting Windows or FreeBSD. Within FreeBSD you can use boot environments to boot different versions of FreeBSD if you want.


----------



## grahamperrin@ (Feb 25, 2022)

waasnsteffl said:


> my HP



Which model?



waasnsteffl said:


> uefi checks



I have worked with many HP models, but I can not visualise that. Can you share a photograph?

FYI efibootmgr(8)


----------



## waasnsteffl (Feb 26, 2022)

Hi and Thanks all.
Tooks me some time to get all i need working on my HP. Still MBR...

grahamperrin
I am not shure, what you meant i should picture ?
Its a HP 9470m, nice and fast enough hardware, was hard to find a newer bios, but could install one from 2018. But still the exactly same problems. If you left a USB without activated slice or boot0, when switched on, all the active slices on ada0 and ada1 disappears. And Bios switches to uefi memory and HD checking. Then you have to set them active, with booting from a usb bootstick again.
Btw, where is the Info, which slice is active, located? on HD itself or somewhere in the Bios area?


SirDice
Yes, Sadly i still need Windows7 for my hobby RC-flying, cause VirtualBox, otherwise great working, has USB problems and does not allow me updating  and configuring my RC hardware (Radiomaster TX16S and Graupner) through USB. No chance for more time to learn more about UEFI. And too much risk loosing data. At least i am curious to go into this next autumn.

Thanks again, Anton


----------



## grahamperrin@ (Feb 26, 2022)

Here, with an EliteBook 8570p with only one operating system (FreeBSD):


```
root@mowa219-gjp4-8570p-freebsd:~ # efibootmgr -v
Boot to FW : false
BootCurrent: 0000
Timeout    : 5 seconds
root@mowa219-gjp4-8570p-freebsd:~ #
```



waasnsteffl said:


> … HP 9470m, …



Thanks, two matches:

HP EliteBook Folio 9470m Notebook PC | HP® Customer Support
HP EliteBook Folio 9470m Ultrabook | HP® Customer Support


----------



## chrbr (Feb 26, 2022)

Dear Anton,
it is a very good attitude to prefer the safe side. May be you can get one or two disks for experiments - or even and old computer. I would also not touch the running Windows installation. And if I would use that computer for tests I would disconnect that disk to be safe.


----------

