# FreeBSD 11.1 installer overwriting windows boot partition



## buenyamin (Nov 17, 2017)

After installing FreeBSD, I was unable to boot Windows 7.
Could it be possible that the FreeBSD installer had overwrittten the windows boot loader?

If so, how can I install FreeBSD while avoiding the destruction of my windows installation / boot partition ?


----------



## poorandunlucky (Nov 17, 2017)

xforce said:


> After installing FreeBSD, I was unable to boot Windows 7.
> Could it be possible that the FreeBSD installer had overwrittten the windows boot loader?
> 
> If so, how can I install FreeBSD while avoiding the destruction of my windows installation / boot partition ?



How did you install it?  What options did you choose, namely, when it came to disk partitioning?


----------



## buenyamin (Nov 18, 2017)

poorandunlucky said:


> How did you install it?  What options did you choose, namely, when it came to disk partitioning?



I used ZFS, and selected a separate harddrive for freebsd in the installer, but the Installer broke my Windows EFI / Boot partition which was not on the drive selected


----------



## HL1234 (Nov 18, 2017)

Yes, I found that:
https://www.freebsd.org/doc/en/books/faq/install.html#idp55902696
or this tread may help:
https://forums.freebsd.org/threads/14222/


----------



## Terry Mester (May 4, 2018)

FreeBSD Installation has Ruined my Windows XP Three Times

I have now suffered this same problem three times after installing BSD V11.1 on an internal Hard Drive with Windows XP installed.  [N. B. It was also a newly installed Windows system so I didn't lose any Windows stuff.  I had previously tried out Linux Debian which did not cause this problem, and created a Menu to choose to boot from either Linux or Windows.]

I don't want to make a fourth attempt without knowing it will work.  I had used the Guided Partition option which I assume is the problem.  What exactly do I do in the Manual Partition to create a Boot Menu for both BSD and Windows XP?


----------



## gnath (May 4, 2018)

Thread 14222 is a good starting point.
I understand that BSD grub2 create windows menu but I have not tried myself. Also guided install formate full disk.


----------



## Terry Mester (May 5, 2018)

I had already read that Thread.  It doesn't provide an answer as to whether the FreeBSD Installer can create a Boot Menu with Windows.  The one guy (gwb) used Linux to create a Boot Menu.  I'm trying to determine if BSD can create one.  I don't recall seeing any GRUB2 in the BSD Installer.  The BSD Installation Guide claims that it will work with Windows on a partitioned Drive.


----------



## gnath (May 5, 2018)

I use grub2 menu from devuan for booting. But have to enter stanza for freebsd manually. Freebsd has few ports. Check which one suits you & sees windows.


----------



## michael_hackson (May 5, 2018)

Hi Terry, I am interested in the same thing and used the answers from HL1234 to get further.
His first link to the handbook doc states:

*3.7.*
Can Windows® co-exist with FreeBSD?
If Windows® is installed first, then yes.  FreeBSD's    boot manager will then manage to boot Windows® and FreeBSD.    If Windows® is installed afterwards, it will    overwrite the boot manager.  If that    happens, see the next section.

Then it's said in Thread 14222 by Dr_Phoenix that:


> The problem is in the Win7, this OS will not allow you to make changes in it's boot sector, so if FreeBSD or Linux replaces it's by self BootManager win7 will not run and showing you the critical error message at the boot time.



And then he suggests a method working for him which involves doing the partitioning before having any OS installed at all.

Another solution in the same thread is posted by rden:


> If they are all on disk0 why bother with grub - it's an unessesary extra step with zero gain, just copy out FreeBSD's boot1 and load it from win7 boot manager.  Fast, simple, elegant and user-friendliest boot selection.
> (Used to have XP, FBSD and Win7 all booting from Win7 boot manager - until I removed Win7 and went back to XP's boot manager.)



Which to me seems like the most convenient setting.

- - - - - 
The rest can be found in the handbook under https://www.freebsd.org/doc/handbook/bsdinstall-partitioning.html.
Take note that I read in one of our threads that the "Guided Partitioning" overwrote the files to the other OS (not sure if he went to install on whole disk or partition only) and if this is the case you should pick "Manual Partitioning" to make sure that the other OS will not be overwritten when installing FreeBSD to a partition.

Also asys makes a terrific job explaining the difference between partitioning with Windows or FreeBSD in this thread: Thread 59633.

If you take time and decide to go forth with this I will be glad to follow your updates in this thread. 

Cheers!


----------



## Terry Mester (May 6, 2018)

gnath said:


> I use grub2 menu from devuan for booting. But have to enter stanza for freebsd manually. Freebsd has few ports. Check which one suits you & sees windows.


The terms 'grub2', 'devuan' and 'stanza' are not familiar to me, and sound like features or Distros in Linux.  I don't recommend using the Linux Grub Menu with FreeBSD.  BSD needs to provide its own Menu.



michael_hackson said:


> Hi Terry, I am interested in the same thing and used the answers from HL1234 to get further.
> ...
> If you take time and decide to go forth with this I will be glad to follow your updates in this thread.


Hi Michael,
The statement in Paragraph 3.7 of the Guide is not proving correct:  "If Windows® is installed first, then yes. FreeBSD's boot manager will then manage to boot Windows® and FreeBSD".  The Guided Partition tool renders Windows XP unbootable.  I advise you to not attempt installing FreeBSD unless you have first backed up everything on your Hard Drive.  You don't want to risk losing anything.

If I cannot get an answer as to how to do this right now with Version 11 then I'll have to install BSD on a second 'slave' Hard Drive, and use the Computer's BIOS Menu to boot from the slave Drive to load BSD.  My preference is to have the Windows and BSD OS' on the master Drive, and then store my Files on the slave Drive to protect them against OS malfunctions such as the Windows Bluescreen horror which recently caused me a nightmare.

I recommend to the FreeBSD Foundation that they delay the release of Version 12 until it can incorporate a Boot Menu for different Operating Systems on one Drive -- just like Linux provides.  FreeBSD is going to have a hard time finding converts if it cannot provide users the ability to boot either BSD or Windows from one Hard Drive.


----------



## michael_hackson (May 6, 2018)

Terry:
I think you are missing some important points in the post I did.
I also went in the line of avoiding the "Guided Partitioning" and doing the "Manual Partitioning" instead. This step can be found in the installation chapter of the handbook I linked you.

Also, in my opinion, the safest route would be to just install FreeBSD that way and then try to copy the necessary boot files into Windows 7's own Boot Manager.  Not sure how you missed that but no harm in being more precise.

I am certainly sure that they will not postpone the release date only to enable FreeBSD's Boot Manager to boot other systems apart from FreeBSD when according to handbook it already should be possible + that there are fixes for this issue in the forum. I would say that, that would not be their foucus, but I can be wrong. 

Lastly I can make sure that I will try to set this up myself as soon as I have time and a proper backup on my files and then I will get back to you with exactly what I did to make it work, or not work for that sake. 

On a sidenote I can go with the custom and recommend you to contribute to FreeBSD and look into the Boot Manager and see if you can modify it correctly to boot other systems for your need and then be a part of the development.


----------



## Phishfry (May 6, 2018)

I suggest a MBR disk scheme with FreeBSD boot0cfg(8). It has worked for years.
https://dririan.com/2012/07/using-boot0cfg/


----------



## shepper (May 6, 2018)

Some of the above problems are due to Microsoft initially using a single sector bootloader (WinXP/Win7) and later using the first 2 sectors for the bootloader.  Grub2 or FreeBSD gtp/efi, typically install on the first 2 sectors.  On an existing WinXP/Win7 install, the start of the Windows partition would be over-written by the 2 sector bootloader.  Using the single sector MBR disk scheme, as suggested by Phishfry, should work as long as your hardware does not demand EFI.


----------



## michael_hackson (May 6, 2018)

Through some more digging I found this excellent thread on the subject, describing exactly how to do it with boot0cfg, as Phishfry and shepper proposed: Thread 28925.
Together with some eye-candy: 




At this point I feel so sure I could even go on with this without having a backup, lol. (Will not though.)

Thank you both for stepping in and pointing in the direction of boot0cfg. Highly appreciated.


----------



## Terry Mester (May 7, 2018)

michael_hackson said:


> ... the safest route would be to just install FreeBSD that way and then try to copy the necessary boot files into Windows 7's own Boot Manager.  Not sure how you missed that but no harm in being more precise. ...


My Windows version is XP which may respond differently from 7.



michael_hackson said:


> ... I am certainly sure that they will not postpone the release date only to enable FreeBSD's Boot Manager to boot other systems apart from FreeBSD when according to handbook it already should be possible + that there are fixes for this issue in the forum. I would say that, that would not be their foucus, but I can be wrong.   ...


You need to consider this problem from the perspective of an 'average' computer user  -- not 'advanced' users.  Manually setting up a Boot Menu is way too complicated for the average user.  I personally want to see FreeBSD become much more widespread so that Software Developers will write Software for BSD.  This necessitates that the BSD installation process be completely idiot-proof.  It's not acceptable from a programming perspective that installing FreeBSD would ruin the existing Windows installation.  The BSD Programmers should have tested out the Installer Partition Tool with different Windows versions to verify whether or not it creates a Boot Menu.  If it doesn't work with Windows XP then there should be a warning message in the Installer.  This problem with XP should have been discovered by BSD Programmers fifteen years ago.



shepper said:


> Some of the above problems are due to Microsoft initially using a single sector bootloader (WinXP/Win7) and later using the first 2 sectors for the bootloader.  Grub2 or FreeBSD gtp/efi, typically install on the first 2 sectors.  On an existing WinXP/Win7 install, the start of the Windows partition would be over-written by the 2 sector bootloader.  ...


Thanks for this information.  This is undoubtedly my problem.  Over-writing the second Sector (1) would corrupt a major Windows System File, and this problem would be irreparable.  I'll have to go with installing BSD on my slave Hard Drive which I can select from the BIOS Boot Menu.


----------



## Terry Mester (May 10, 2018)

Terry Mester said:


> ... Over-writing the second Sector (1) would corrupt a major Windows System File, and this problem would be irreparable.  ...


I think I figured out a way to get around this problem of BSD using the Second Sector for the Boot Menu.  When installing Windows, you can create 3 Partitions with the First being a Dummy Partition of the smallest size possible (a few Kilobytes), the Second being for the Windows Installation, and the Third unformatted space for the FreeBSD installation.  When the BSD installer erases the Second Sector it will only impact the Dummy Partition -- leaving the Windows Partition unaffected.  However, I am reluctant to now try this out because it would take about four hours to reformat and reinstall Windows and BSD.  If Michael or someone tries this out please let us know the results.


----------



## michael_hackson (May 10, 2018)

If you are in no hurry I will set this up in due time. Although I, and the others in this thread, has told you the specific steps to take and I don't think that your scenario will be any different than mine.


----------



## shepper (May 10, 2018)

I wondered if one of the opensource parition managers (GParted), could shrink the windows partition by one sector from the start of the NTFS patition and then enlarge the boot partition by one sector?
GParted Manual


----------



## Deleted member 48958 (May 10, 2018)

xforce said:


> FreeBSD 11.1 installer overwriting windows boot partition
> After installing FreeBSD, I was unable to boot Windows 7.


It's not a bug, it's a feature


----------



## Terry Mester (May 11, 2018)

michael_hackson said:


> ... Although I, and the others in this thread, has told you the specific steps to take and I don't think that your scenario will be any different than mine.


There has been no definitive suggestion for safely installing FreeBSD with Windows *XP*.  The suggestions haven't been determined absolutely safe.  There was a suggestion for using 'foreign' OS Boot Menus like Linux's GRUB.  However, I'm trying to determine a safe process within BSD.  Using a foreign Menu is rather tacky.



shepper said:


> I wondered if one of the opensource parition managers (GParted), could shrink the windows partition by one sector from the start of the NTFS patition and then enlarge the boot partition by one sector?


I think the problem with this suggestion would be that the Second Sector (1) is already used by Windows, and there's no way to undo that once Windows is installed.


----------



## Terry Mester (May 14, 2018)

Terry Mester said:


> I think I figured out a way to get around this problem of BSD using the Second Sector for the Boot Menu.  When installing Windows, you can create 3 Partitions with the First being a Dummy Partition of the smallest size possible (a few Kilobytes), the Second being for the Windows Installation, and the Third unformatted space for the FreeBSD installation.  ...


Well, this method doesn't work because the 'FreeBSD Installer / Partition Editor' is somehow deficient rendering it incapable of recognizing the unused Disk space.  I reformatted and reinstalled Windows XP (after Windows screwed-up on me again) on a 12GB 2nd Partition on my 19.5GB Hard Drive.  The 1st Windows Partition is just the 8MB minimum. The following summary is what the 'FreeBSD Installer / Partition Editor' provided:
ada0                19GB MBR
    ada0s1        7.8MB ntfs
    ada0s2        19GB EBR
         ada0s5   12GB ntfs
    ada0s3        7.9MB BSD

For some reason the 2nd Windows Partition (Slice in BSD) is numbered as Slice 5 as a subpartition to Slice 2.  The BSD Slice / Partition is numbered as "3", but is only 7.9 MEGA Bytes because the BSD Partition Editor is not recognizing the 7.5 GIGA Bytes of unused space on the Drive which has been subsumed into Slice 2.  If someone can explain what is happening here I will be most delighted.  It appears to me as if Windows XP created a second Boot Record (EBR) for Partition 2.  However, Windows does recognize the 7.5GB of unused space in its Disk Manager.  Why isn't the BSD Partition Editor recognizing it?

~~~~~
On a separate issue; prior to reformatting I noticed that, when BSD first starts right after the Computer's BIOS concludes, when you press the <DOWN ARROW> Key the following comes on the Screen:
-
FreeBSD/x86 boot
Default: 0:ad(0,a)/boot/loader
boot:_

This 'boot' prompt responds with "No" when entering anything other than "/boot/loader" -- which begins loading FreeBSD.  What is this prompt?  Is this the FreeBSD Boot Menu?


----------



## michael_hackson (May 14, 2018)

As far as your post considering, I think you should not install Windows on a second partition in an already Windows install, no? Because now you have this first Windows dummy you are speaking of, as a main install showing the hdd capacity to total 19 Gig and then you have another install of Windows, in another partition, showing the total of 19 Gig in hdd space.

If you want that to even work remotely you will have to install FreeBSD in a partition under ada0s2. instead of ada0, and then target ada0s2 with boot0cfg as the installation is complete. In this case you would have at total 6~ Gig of free space and you'd also like to set up a proper swap on this system.

*WARNING: *Why I am saying that this may "remotely" work is because I don't know how boot0cfg will treat your method since the targeted drive is now an EBR and not an MBR, as you clearly can understand when you look in the FreeBSD installer. So your options are as follows:

1. Try this method I present to you, targetting ada0s2.
2. Ditch your dummy partition: Make a proper clean install of Windows XP so you have only one Windows on your hdd as an MBR record and after that follow the guides and advices that you have been presented. Essentially for you this means that you will do the same thing that you have done but the installer will show the free space in ada0 (where you'd want it considering your post) instead of in ada0s2, where it is at the moment.

*Question of curosity: *What will you use your 6~ Gig FreeBSD system (discounting swap space) for?


----------



## michael_hackson (May 14, 2018)

On a second thought it may be very hard to accomplish this in ada0s2 since the FreeBSD will most likely put it's booter in ada0s2 and as far as my knowledge goes your system may boot into the MBR environment of ada0. I lack sufficient skills to tell if your system boots from ada0s2 or ada0 at this point.

So I think you can remove the first option above and go with option number 2.

Good luck.

Ps. Or you could always try option 1 and see if it works (you know it works if your system boots into FreeBSD and not Windows) but I'd suggest option 2.

Still not sure why you 2018 want to Dual-OS on an 19,5 GB hard drive, but that is actually none of my business.

*Also: *Don't think this thread should be used anymore regarding this subject because from the start I viewed you as the TS but later I realised that was not the case so I should give an apology to xforce for occupying his thread.


----------



## Terry Mester (May 14, 2018)

michael_hackson said:


> As far as your post considering, I think you should not install Windows on a second partition in an already Windows install, no? ...


I tried creating this Dummy Partition because FreeBSD was screwing-up my Windows installation when it was the 1st Partition, and so I thought this would avoid the problem caused by a 2-Sector Boot Loader mentioned in Post #13.  I have no idea why Windows XP created that EBR.  I have 7.5GB for the BSD installation which allows for 3GB for 'swap'.  I intend to use a second 40GB Slave Hard Drive for storing all my personal files (Windows and BSD) to protect them against OS failures.



michael_hackson said:


> If you want that to even work remotely you will have to install FreeBSD in a partition under ada0s2. instead of ada0, and then target ada0s2 with boot0cfg as the installation is complete. In this case you would have at total 6~ Gig of free space and you'd also like to set up a proper swap on this system. ...


I tried this, and it doesn't work.  The Partition Editor will only allow you to create the BSD Partition at 'ada0'.



michael_hackson said:


> *...*
> 2. Ditch your dummy partition: Make a proper clean install of Windows XP so you have only one Windows on your hdd as an MBR record and after that follow the guides and advices that you have been presented. Essentially for you this means that you will do the same thing that you have done but the installer will show the free space in ada0 (where you'd want it considering your post) instead of in ada0s2, where it is at the moment. ...


I will try this for about the sixth time once someone in the know can tell me how to have BSD create a Boot Menu like Linux.  Nobody has yet provided an answer to this within FreeBSD.  That 'boot0cfg' Command appears to only change the Partition which boots up.  It does not seem to create a Boot Menu like Linux.  Also, if the BSD Boot Loader uses two Sectors instead of one, then there is no way for BSD to be installed on a Partition with Windows because it will irreparably screw-up Windows.



michael_hackson said:


> *Question of curosity: *What will you use your 6~ Gig FreeBSD system (discounting swap space) for?


For starters I wish to switch to BSD for all of my Internet work since the Windows XP Firewall is no longer safe.  My Windows system was hacked and corrupted while on the Internet last December which is what led me to search for another OS.  I had installed Linux Debian in February which successfully set up a working Boot Menu -- the first time, but when running Debian it screwed up my older Monitor which led me to try out FreeBSD.  I'm afraid that it's looking like FreeBSD might turn into a dud as well.



michael_hackson said:


> ...
> Ps. Or you could always try option 1 and see if it works (you know it works if your system boots into FreeBSD and not Windows) but I'd suggest option 2.


No this does *not* mean that it's working.  This is exactly the problem with the FreeBSD Installer:  it corrupts the Windows installation rendering it unbootable.  I, and every other user who wishes to use a Windows / BSD Partition Drive, expect BSD to provide a Boot Menu to select either Windows or BSD -- just as Linux does!  Absolutely nobody here has yet confirmed as to whether or not FreeBSD can provide such a Boot Menu.  It seems not.



michael_hackson said:


> Still not sure why you 2018 want to Dual-OS on an 19,5 GB hard drive, ...
> *Also: *Don't think this thread should be used anymore regarding this subject because from the start I viewed you as the TS but later I realised that was not the case ...


Yes this is the proper Thread to use for this topic of the BSD Installer screwing-up the Windows installation.  The Forum administrators don't like duplicate Threads on a single topic / problem.


----------



## Terry Mester (May 15, 2018)

shepper said:


> Some of the above problems are due to Microsoft initially using a single sector bootloader (WinXP/Win7) and later using the first 2 sectors for the bootloader.  Grub2 or FreeBSD gtp/efi, typically install on the first 2 sectors.  On an existing WinXP/Win7 install, the start of the Windows partition would be over-written by the 2 sector bootloader.  Using the single sector MBR disk scheme, as suggested by Phishfry, should work as long as your hardware does not demand EFI.


Are you certain this is accurate?  According to 'dririan' on his Blog "Using boot0cfg on FreeBSD to configure the bootloader / July 14, 2012" (https://dririan.com/2012/07/using-boot0cfg/); FreeBSD's boot0 "fits entirely in the MBR’s boot code area (which is 440 bytes)".  Doesn't this mean that the BSD Boot Code fits entirely within Sector 0?

~~~~~
Is there anyone here with knowledge who can answer my question from Post #21:
when BSD first starts right after the Computer's BIOS concludes, when you press the <DOWN ARROW> Key the following comes on the Screen:
-
FreeBSD/x86 boot
Default: 0:ad(0,a)/boot/loader
boot:_

This 'boot' prompt responds with "No" when entering anything other than "/boot/loader" -- which begins loading FreeBSD.  What is this prompt?  Is this the FreeBSD Boot Menu?


----------



## michael_hackson (May 15, 2018)

If you currently don't have a proper setup you will run into problems and the thing is when using MBR partitioning the boot loader occupies a "free" sector, without interfering with any of the system files, and there is where FreeBSD boot loader will reside. The thing you are raising questions for to shepper is the GPT-scheme, which is different.

I got my own solution to this through Phishfry's suggestion of using boot0cfg on an MBR but somehow you and I have come to different conclusions.

You seem eager but bare with me and give me the time to do this myself and  I'll give you a hands-down guide in private conversation.

My process will most likely look as the YouTube link I have in my post before and I can imagine that the menu that you are looking for will look like the end of the video. Honestly, without trying yet, I can't see any different outcome.

Posting anymore here seems unecessary since other people reading this thread should be able to find the answers already. I could give you the recommendation of searching for more information regarding different boot loaders and partitioning schemes to come to an understanding of how it works.


----------



## ucomp (May 15, 2018)

Terry Mester said:


> ........
> Is there anyone here with knowledge who can answer my question from Post #21:
> when BSD first starts right after the Computer's BIOS concludes, when you press the <DOWN ARROW> Key the following comes on the Screen:
> -
> ...



( sorry. didn't read the thread, only the last sentence   ( maybe I try in 1/2 an hour) : )

this is stage  2 :
If the boot process is interrupted at stage two, the following interactive screen is displayed:

Example 12.2. boot2 Screenshot
>> FreeBSD/i386 BOOT
Default: 0:ad(0,a)/boot/loader
boot:

Stage two, boot2, is slightly more sophisticated, and understands the FreeBSD file system enough to find files. It can provide a simple interface to choose the kernel or loader to run. It runs loader, which is much more sophisticated and provides a boot configuration file. 
---
( https://www.freebsd.org/doc/handbook/boot-introduction.html )


----------



## shepper (May 16, 2018)

Terry Mester said:


> Are you certain this is accurate?


Most LInux distributions allocate 1MB for grub: reference=https://wiki.archlinux.org/index.php/GRUB



> Create a mebibyte partition (+1M with _fdisk_ or _gdisk_) on the disk with no file system and with partition type GUID 21686148-6449-6E6F-744E-656564454649.
> 
> Select partition type BIOS boot for fdisk, ef02 for gdisk.
> For parted set/activate the flag bios_grub on the partition.
> This partition can be in any position order but has to be on the first 2 TiB of the disk.


A traditional sector, circa windows xp/7, is 512 bytes: reference=  https://en.wikipedia.org/wiki/Disk_sector.


----------



## Terry Mester (May 17, 2018)

shepper said:


> ...
> A traditional sector, circa windows xp/7, is 512 bytes: reference= https://en.wikipedia.org/wiki/Disk_sector.


It would appear that the first part of FreeBSD's Boot Manager (boot0) fits entirely within Sector 0, and so this wouldn't run over into the Windows Partition which would begin on Sector 1.  This wouldn't be the cause of the problem I'm experiencing.



ucomp said:


> ( sorry. didn't read the thread, only the last sentence   ( maybe I try in 1/2 an hour) : )...
> ---
> ( https://www.freebsd.org/doc/handbook/boot-introduction.html )


Okay, I'm not getting the Boot Menu message shown in Example 12.1 when my Computer boots up:
Example 12.1. boot0 Screenshot
F1 Win
F2 FreeBSD
Default: F2

I don't know if this problem is unique to BSD V11.1, or existed on older Versions, since no BSD programmer has responded to this Thread, but V11.1 is definitely defective.  I hope that a BSD programmer will show up here soon to explain.


----------



## Terry Mester (May 19, 2018)

HALELUIAH!!!!!  SUCCESS AT LAST!!!!! SUCCESS AT LAST!!!!! SUCCESS AT LAST!!!!! 
I've achieved SUCCESS AT LAST!!!!!   
The following Command Line successfully installed the FreeBSD Boot Menu:
boot0cfg -Bv -b boot0 -f /boot/mbrbackup -o update -s 1 -t 100 ada0

After this Command the FreeBSD Boot Menu comes up after the BIOS as follows:
F1 Win
F2 FreeBSD

F6 PXE
Boot: F1

[N. B.  This Menu waits about six seconds for you to press F1/F2/F6 before loading the default F1 (Windows OS).  You can change "-s 1" to "-s 2" in the boot0cfg Command Line if you want BSD to be the default.]  I don't know what PXE is, but pressing F6 causes the Computer's BIOS to be unable to boot up.

My success in fixing the Boot Menu does not mean that BSD V11.1 is not defective.  This Menu should have been successfully created by the FreeBSD Installer.  /  My old Master Boot Record file stated at the end: "Invalid partition table ^@Error".  Hopefully one of you can explain what this means.


----------



## Terry Mester (Jun 6, 2021)

I have had to reinstall FreeBSD on a new Hard Drive after my old Drive fried.  The aforementioned solution in Post #30 to fix the Boot Menu is not working from the Live CD.  Can I fix the Boot Menu from the Live CD, or will I have to reformat again?


----------



## covacat (Jun 6, 2021)

it should work just specify the correct path for the backup file and boot0
ex -f /tmp/backupmbr.test -b /somepath/with/boot0


----------



## SirDice (Jun 6, 2021)

Note that boot0cfg(8) only works for MBR partitioned disks and UFS. It does not work for GPT or ZFS.


----------



## Alain De Vos (Jun 6, 2021)

I always installed a small linux partition & grub to boot freebsd & windows and this always worked.
Linux gparted allows to shrink any ntfs partition


----------



## Terry Mester (Jun 8, 2021)

covacat said:


> it should work just specify the correct path for the backup file and boot0
> ex -f /tmp/backupmbr.test -b /somepath/with/boot0


I tried the following two Commands, and got the ensuing Error Messages:
`boot0cfg -Bv -b /boot/boot0 -f /boot/mbrbackup -o update -s 1 -t 100 ada0`
boot0cfg: can't open file /boot/mbrbackup to write backup:  Read-only file system

`boot0cfg -Bv -b /ada0/boot/boot0 -f /ada0/boot/mbrbackup -o update -s 1 -t 100 ada0`
boot0cfg: can't open file /ada0/boot/mbrbackup to write backup:  Read-only file system



SirDice said:


> Note that boot0cfg(8) only works for MBR partitioned disks and UFS. It does not work for GPT or ZFS.


My FreeBSD setup is UFS.  Thanks for the caution.



Alain De Vos said:


> I always installed a small linux partition & grub to boot freebsd & windows and this always worked.
> Linux gparted allows to shrink any ntfs partition


I don't have Linux installed.  I like the FreeBSD Boot Menu which is simple and compact -- no muss no fuss.  My Post #30 command line `boot0cfg` works from the Hard Drive FreeBSD installation.


----------

