Unable to dualboot with MBR partition

I want to dual boot Windows and FreeBSD, but I get this error message.

Non-bootable Disk
The existing partition scheme on this disk (MBR) is not bootable on this platform. To install, it must be repartitioned. This will destroy all data on the disk.

I do not want to destroy my existing Windows installation, is there a way to dual boot Windows and FreeBSD on MBR partition scheme?
 
I want to dual boot Windows and FreeBSD, but I get this error message.

What version of Windows?
Is it using the whole disk?

I do not want to destroy my existing Windows installation, is there a way to dual boot Windows and FreeBSD on MBR partition scheme?

Upto W10, sure. Maybe not 11?

Canonical method:
. defrag 'dose.
. shrink 'dose using disk tools buried in Control Panel
. install FreeBSD (etc) in free space
. run boot0cfg(8) install to update MBR code, select active slices etc
. happy multibooting
 
I use a linux partition to triple boot. Linux has GRUB which can easily configured to boot.
Windows,Linux,FreeBSD.

There is also a Windows tool
Allowing to boot multiple operating systems.
 
I want to dual boot Windows and FreeBSD, but I get this error message.

"Non-bootable Disk
The existing partition scheme on this disk (MBR) is not bootable on this platform. To install, it must be repartitioned. This will destroy all data on the disk."

Where are you, running what, when you see that message?

From FreeBSD installation media, choose LiveCD and run # gpart show -p [* was -t, oops *]

E.g. one of mine, with Win10:
Code:
=>       63  250069617    ada0  MBR  (119G)
         63       1985          - free -  (993K)
       2048    1185792  ada0s1  ntfs  (579M)
    1187840   80353280  ada0s2  ntfs  (38G)
   81541120   67108864  ada0s3  fat32lba  (32G)
  148649984  100663296  ada0s4  freebsd  [active]  (48G)
  249313280     756400          - free -  (369M)
 
Can you post the output of
Code:
gpart show -p
For freebsd you have normally a freebsd-boot & freebsd-ufs/freebsd-zfs partition .
For windows an ms-reserved & ms-basic-data & ms-recovery partition.
 
What version of Windows?
10
Is it using the whole disk?
No, i un-partitioned 200GBs of my Windows 10 installation for my FreeBSD installation

Where are you, running what, when you see that message?
On my USB drive with flashed installation image (FreeBSD-14.0-RELEASE-amd64-disc1.iso)

I see the message when i pick the Auto (UFS) in partitioning, it asks me If I wanted to use the whole disk (nda0) or partition it to share it with other operating system and when i choose Partition i got that message

From FreeBSD installation media, choose LiveCD and run # gpart show -t

E.g. one of mine, with Win10:

nda0 MBR (932G)
- free - (993K)
1 ntfs [active] (50M)
2 nfts (736G)
- free - (195G)

Canonical method:
. defrag 'dose.
. shrink 'dose using disk tools buried in Control Panel
. install FreeBSD (etc) in free space
. run boot0cfg(8) install to update MBR code, select active slices etc
. happy multibooting
Is that boot0cfg -o update ?
 
10

No, i un-partitioned 200GBs of my Windows 10 installation for my FreeBSD installation

Ok, so Windows sees it as free space? Care needed, it will still see it as free when it's being used by FreeBSD!

On my USB drive with flashed installation image (FreeBSD-14.0-RELEASE-amd64-disc1.iso)

I see the message when i pick the Auto (UFS) in partitioning, it asks me If I wanted to use the whole disk (nda0) or partition it to share it with other operating system and when i choose Partition i got that message

Hmm, you likely have to choose manual UFS instead. I find that message bemusing, but I last partitioned for 12.3-R.

nda0 MBR (932G)
- free - (993K)
1 ntfs [active] (50M)
2 nfts (736G)
- free - (195G)

Yeah, sorry, I meant gpart show -p as Alain said; fixed above.

Is that boot0cfg -o update ?

No, just boot0cfg -B to install, standard options should be fine.

Later run it with other switches for ticks delay, which slices to offer etc. Use -v for verbosity, and check the EXAMPLES.
 
I see that Smithi has more experience setting up FreeBSD on MBR partitions. Follow his suggestions would be best. I am glad you wish to dual boot with Windows and test out FreeBSD. Nomadbsd.org is a method to boot and run from a USB flash drive stick. Wish you success in finding a method to use and run FreeBSD on your computer.

Use the following 4 commands to understand your disk layout
Code:
camcontrol devlist
geom disk list
gpart status
gpart show -lp

Code:
gpart recover
# if the "disk partition corrupted" message comes up, recover the end partition table


Yes, I recognize this forum is a FREEBSD forum, Yet I can see that the 1 NTFS [active] (50m) ESP EFI partition probably has room for a couple of GPT boot files. For MBR it is boot0 , boot1, boot2 documented boot files. The FreeBSD slices make use of 1 primary partition.
GPT Files below:
/EFI/freebsd/bootx64.efi and a
/EFI/ghostbsd/bootx64.efi
/EFI/refind
/EFI/BOOT/bootx64.efi

https://ghostbsd.org/download
https://ghostbsd.org/download select either MATE or community supported XFCE. I know with your unpartitioned space of 195G. GhostBSD could create 3 partitions of GPT and use https://www.rodsbooks.com/refind/index.html rEFInd to select which one GPT partition to boot. The problem comes in from Windows selecting MBR partition scheme with 4 primary partitions and not the newer better GPT scheme with 128 partitions. Question, why is 1 ntfs and not a standard partition in FAT16, or FAT32 msdos partition for the ESP EFI partition? Next if I am WINDOWS(tm) I need 3 partitions minimum for my Windows OS, if you are another O/S and you need 2 primary partitions, 1 primary for data/boot , 2nd for a primary swap partition (loaded up by the /etc/fstab entry for swap partition). Let me screw you out of that choice to dual boot windows, because there is ONLY 1 primary partition left of the total 4 primary partitions available in MBR (master boot record) partition scheme. Look at buying an external USB 3.0 SSD drive either Sandisk Extreme 1050Mbytes a second transfor, or a Samsung T7, or a Crucual USB to NVME drive, or a UGreen Case, or a USB 3.0 to SATA cable to a SATA drive. Install FreeBSD (this primary forum ) or GhostBSD booted up from a USB flash drive stick using the Live Media (no install, 4G dram size), 15 minutes time and you have a usable BSD MATE desktop (based on FreeBSD ). GBI app to install to unpartitioned freespace on a USB SSD of your choice.

Welcome your comments.
Here is the exact sequence of commands I am working to create a ZFS bootable file system for x86_64 on a USB SSD.
https://ghostbsd-arm64.blogspot.com/2024/04/create-ghostbsd-usb-ssd-500gb-or-larger.html Implementing X86_64 USB SSD
https://ghostbsd-arm64.blogspot.com/2023/12/zfs-boot-on-root-setup-for-usb-ssd.html ZFS boot on root setup for USB SSD
Ugreen Case and NVME M.2 recommendations at the end of this blogspot.com post:
https://ghostbsd-arm64.blogspot.com/2024/01/hdmi-audio-sound-patches-into-ghostbsd.html
 
here is more ideas about installing freebsd in a windows dual oot configuration.

3327, [4/9/24 4:41 AM]
To address the challenge of setting up a dual-boot configuration with Windows and GhostBSD on a Master Boot Record (MBR) scheme disk, especially with the constraints you've outlined (195GB of unpartitioned space, one free primary partition slot, and the intention to use a FreeBSD swap partition alongside a primary data/kernel boot partition for GhostBSD), we need a strategy that works within the limitations of MBR.

Given that MBR supports up to four primary partitions, and you've indicated only one slot is available, we have a bit of a puzzle. Utilizing a logical partition within an extended partition for either GhostBSD or its swap space would be the typical advice, but MBR's primary partition limit complicates this for FreeBSD-based systems like GhostBSD, which prefer primary partitions for their root filesystems.

Fred Finster, [4/9/24 4:44 AM]
i see this as a NO CAN DO with MBR scheme unless using slices. thats were I left it. I just wondered ifyou had somw whiz bang solution using freebsd slices on that one primary solution.

3327, [4/9/24 4:48 AM]
Here's the theory for a strategy for dual-boot setup, but the installer doesn't support it. It would be easier to use Grub if it were available.

Windows Setup:
Assuming Windows is already installed, it must occupy at least one primary partition. The NTFS 50MB boot partition you mentioned seems to be a small system-reserved partition, common in Windows installations, which may or may not count towards your primary partition limit depending on how it's set up.

Primary Partition for GhostBSD:
Use the remaining free primary partition for GhostBSD's root filesystem. During the GhostBSD installation, select this partition. GhostBSD can be installed on a primary partition without issues. The installer should allow you to manually partition the free space.

Swap Space Solution:
Instead of creating a separate swap partition, which isn't feasible due to the MBR limitation, consider using a swap file within GhostBSD. FreeBSD supports swap files, and they can be created on an existing filesystem without the need for a separate partition.

Adapting the Installation:

Install GhostBSD: During the installation process, allocate the entire remaining free primary partition to GhostBSD.

Configure Swap File: After installation, you can create a swap file. Here's how you could do it on GhostBSD/FreeBSD:


**** We need to do this in the installer. ****
# Create a 2GB swap file (adjust size as needed)
dd if=/dev/zero of=/usr/swap0 bs=1m count=2048
chmod 0600 /usr/swap0
echo 'md99 none swap sw,file=/usr/swap0,late 0 0' >> /etc/fstab

Bootloader Configuration:

The last piece of the puzzle is configuring your bootloader. GhostBSD uses FreeBSD's bootloader by default, which should recognize your Windows installation and add it to the boot menu automatically.

If you decide to use a third-party bootloader (i.e., rEFInd), you'll need to install and configure it to recognize both your Windows and GhostBSD installations. For MBR setups, GRUB would be a more straightforward choice as it's well-documented for dual-booting on MBR systems but it is not enabled in the GhostBSD installer.

Final Steps:

Reboot after the installation and swap file setup are complete.

Verify that the bootloader presents you with options to boot either into Windows or GhostBSD.

Select GhostBSD to ensure it boots correctly and the swap is activated (use swapinfo to check).

3327, [4/9/24 4:49 AM]
Well, it is something like that.

3327, [4/9/24 5:11 AM]
You know my opinion, we have been talking about this for 6 years, installing two operating systems on a single disk is a bad idea as it is a single point of failure. You should consider having the operating systems on separate disks instead to reduce your risk and loss. in the 1970s, my parents paid $63,000 for a 3 bedroom house in the suburbs.My dad made $25,000 a year. My mom made $20,000 a year.That same house in 2024 would sell for almost $400,000.I would never be able to afford the house I grew up in.
 
Hmm, you likely have to choose manual UFS instead. I find that message bemusing, but I last partitioned for 12.3-R.
Ok tried installing it manually (before I did that I went to the shell and put the boot0cfg -B /dev/nda0 command, pressed enter and no answer no error supped out hopefully a successful install), but when i put freebsd-boot label on a partition it says that it is invalid, so i just followed this partition scheme [Example 1. Creating Traditional Split File System Partitions] without the freebsd-boot and the installation process went without a problem. But when I rebooted the system I get the boot manager seeing my Windows and FreeBSD installations, but when i want to boot in to FreeBSD it could not and just gave me little #'s when i pressed 3.

F1 Win
F2 Win
F3 FreeBSD

F6 PXE
Default: F1

I did actually try GhostBSD, it was good and it worked out of the box on the Laptop I want to install FreeBSD on. But as a Main-Linux user I like to customize and I would like to understand how a system works from scratch. I would switch to it again if FreeBSD install just cant be installed without wiping out my SSD or spending a lot of time trying to install FreeBSD on my machine.
 
When i install freebsd in drop into the shell and do everything manually. That is also an option. But hard to explain online.
Some choices have to be made.
-Which bootloader from which O.S.
-MBR of GPT partition scheme.
-EFI-partition or not
-UFS or ZFS for FreeBSD.
-Freebsd-boot partition or not.
Etc ...

The FreeBSD-installer only handles the most common cases.
 
Hmm, you likely have to choose manual UFS instead. I find that message bemusing, but I last partitioned for 12.3-R.

Later run it with other switches for ticks delay, which slices to offer etc. Use -v for verbosity, and check the EXAMPLES.

Ok tried installing it manually (before I did that I went to the shell and put the boot0cfg -B /dev/nda0 command, pressed enter and no answer no error supped out hopefully a successful install),

Just run boot0cfg -v /dev/nda0 alone or with other switches to get full info. Show that here in a code block.

but when i put freebsd-boot label on a partition it says that it is invalid, so i just followed this partition scheme [Example 1. Creating Traditional Split File System Partitions] without the freebsd-boot and the installation process went without a problem.

The handbook is seriously messed up more than ever, unless accepting its emphasis on only using GPT (which you can't without losing your W10)
or ZFS (which I suggest not trying in this case).

Ignore anything or anyone suggesting options for GPT not MBR, or other than UFS on MBR.

You want Guided partitioning on MBR, using existing layout, where you can add (or use, if it's still there) slice 3. You can subdivide if desired, but you need to create the swap out of your 195GiB slice; it does NOT need a slice of its own.

May I suggest installing the just released
FreeBSD 13.3
at this time, in case there's a difference in 14's installer?

Upgrading that to 14 is simple afterwards.

But when I rebooted the system I get the boot manager seeing my Windows and FreeBSD installations, but when i want to boot in to FreeBSD it could not and just gave me little #'s when i pressed 3.

I think you'd not finished the installation, or not committed what's selected (Finish) maybe?

Another 'gpart show -p nda0' to check progress might help.





I did actually try GhostBSD, it was good and it worked out of the box on the Laptop I want to install FreeBSD on. But as a Main-Linux user I like to customize and I would like to understand how a system works from scratch.

Yep.

I would switch to it again if FreeBSD install just cant be installed without wiping out my SSD or spending a lot of time trying to install FreeBSD on my machine.

It shouldn't. Is there anything in the BIOS like secureboot that might make difficulties?

Too much information beats too little, and can save time.
 
Hmm, you likely have to choose manual UFS instead. I find that message bemusing, but I last partitioned for 12.3-R.

Ok tried installing it manually (before I did that I went to the shell and put the boot0cfg -B /dev/nda0 command, pressed enter and no answer no error supped out hopefully a successful install),

Just run boot0cfg -v /dev/nda0 alone (or with other switches) to get full info. Show that here within a code block?

but when i put freebsd-boot label on a partition it says that it is invalid, so i just followed this partition scheme [Example 1. Creating Traditional Split File System Partitions] without the freebsd-boot and the installation process went without a problem.

The handbook is seriously messed up more than ever, unless accepting its emphasis on only using GPT (which you can't without losing your W10) or ZFS (which I suggest not trying, in this case).

Ignore anything or anybody suggesting options for GPT not MBR, or other than UFS on MBR, in this particular case.

You want Guided partitioning on MBR, using existing layout, where you can add (or use, if it's still there) slice 3. You can subdivide if desired, but you need to create the swap out of your 195GiB slice; it does NOT need a slice of its own.

May I suggest installing the just released
FreeBSD 13.3
at this time, in case there's a difference in 14's installer?

Upgrading 13 to 14 is simple afterwards.

But when I rebooted the system I get the boot manager seeing my Windows and FreeBSD installations, but when i want to boot in to FreeBSD it could not and just gave me little #'s when i pressed 3.

I suspect you'd not finished the installation, or not committed what's selected ('Finish') perhaps?

Hmm, could nda0 slice 3 be beyond reach of the BIOS?

Another 'gpart show -p nda0' to check progress might help, along with 'boot0cfg -v nda0'

I did actually try GhostBSD, it was good and it worked out of the box on the Laptop I want to install FreeBSD on. But as a Main-Linux user I like to customize and I would like to understand how a system works from scratch.

Yep.

I would switch to it again if FreeBSD install just cant be installed without wiping out my SSD or spending a lot of time trying to install FreeBSD on my machine.

It shouldn't. Is there anything in the BIOS like secureboot that might make difficulties?

Too much information beats too little, and can save time.
 
The FreeBSD-installer only handles the most common cases.

Too much information beats too little, and can save time.

Select GhostBSD to ensure it boots correctly and the swap is activated (use swapinfo to check).

Thank you so much for all of your help and time spend helping me to get this issue solve. But I currently do not have the time to solve this in my view a complex issue.

For now I will reinstall GhostBSD once again to just have any kind of BSD operating system on my laptop to use and understand FreeBSD.

Again I can not thank you all enough for putting your time in to helping me solve this. :)
 
What you're looking for is this:

Code:
slippy# gpart show ada0
=>        63  1953525105  ada0  MBR  (932G)
          63   209715093     1  ntfs  (100G)
   209715156         108        - free -  (54K)
   209715264  1698693120     2  freebsd  [active]  (810G)
  1908408384    29360128     3  freebsd  (14G)
  1937768512    15756648     4  fat32  (7.5G)
  1953525160           8        - free -  (4.0K)

slippy# boot0cfg -v ada0
#   flag     start chs   type       end chs       offset         size
1   0x00      1:  0: 1   0x07   1023:255:63           63    209715093
2   0x80   1023:255:63   0xa5   1023:255:63    209715264   1698693120
3   0x00   1023:255:63   0xa5   1023:255:63   1908408384     29360128
4   0x00   1023:255:63   0x0b   1023:255:63   1937768512     15756648

version=2.0  drive=0x80  mask=0xf  ticks=182  bell=# (0x23)
options=packet,update,nosetdrv
volume serial ID a8a8-a8a8
default_selection=F2 (Slice 2)
slippy#

As people above have mentioned,

Code:
gpart bootcode -b /boot/boot0 ada0

should do the trick.

Note that Windows may expect to boot from partition 1. My previous laptop had Windows XP on partition 3. It booted fine. On the current laptop Windows 10 wouldn't boot unless it was from partition 1.
 
What you're looking for is this:

Code:
slippy# gpart show ada0
=>        63  1953525105  ada0  MBR  (932G)
          63   209715093     1  ntfs  (100G)
   209715156         108        - free -  (54K)
   209715264  1698693120     2  freebsd  [active]  (810G)
  1908408384    29360128     3  freebsd  (14G)
  1937768512    15756648     4  fat32  (7.5G)
  1953525160           8        - free -  (4.0K)

slippy# boot0cfg -v ada0
#   flag     start chs   type       end chs       offset         size
1   0x00      1:  0: 1   0x07   1023:255:63           63    209715093
2   0x80   1023:255:63   0xa5   1023:255:63    209715264   1698693120
3   0x00   1023:255:63   0xa5   1023:255:63   1908408384     29360128
4   0x00   1023:255:63   0x0b   1023:255:63   1937768512     15756648

version=2.0  drive=0x80  mask=0xf  ticks=182  bell=# (0x23)
options=packet,update,nosetdrv
volume serial ID a8a8-a8a8
default_selection=F2 (Slice 2)
slippy#

As people above have mentioned,

Code:
gpart bootcode -b /boot/boot0 ada0

should do the trick.

Thanks cy@, about the same as mine with Win10 above in post #4, and OP's, except both use 2 slices - in my case a boot / recovery slice.

I wasn't aware that gpart command was the same as boot0cfg -B

Note that Windows may expect to boot from partition 1. My previous laptop had Windows XP on partition 3. It booted fine. On the current laptop Windows 10 wouldn't boot unless it was from partition 1.

Mine (Thinkpad T430s) came as a refurb with W10 on MBR (with recovery memstick) so I pruned that, adding a fat32 and space for FreeBSD, then 12.3.

OP also has 2 ntfs slices, and both ours boot W10 from s1.

Still no clue what the mystery error msg was about ...
 
Back
Top