# Post-install boot problems on Dell 660s



## blah44 (Nov 6, 2013)

So I got my shiny new PC and excitedly installed FreeBSD 9.2.

It seemed to go well. At first I used Windows 8 to shrink its own partition by 200 GB, then downloaded a 9.2 ISO, booted, and installed to the new partition. I created a swap, a UFS (mount at / specified), and it offered to create my boot partition so I let it.

However, once I tried to reboot it went nowhere! Complaints of no bootable media abound. I booted off the DVD again, ran `fdisk -B -b /boot/boot0 /dev/ada0`, and now instead of the no bootable media I get what looks like a botched menu - F1 ?? F6 PXE - and whatever I do (including letting it sit for a few seconds) it prints out a "#", once.

What am I doing wrong here? Or is there something about this machine BIOS/EFI that is going to prevent me from booting a non-windows OS off the internal drive? I had to mess with it quite a bit, disable secure boot, enable legacy, just to get it to boot off the DVD at all.


----------



## SirDice (Nov 6, 2013)

What scheme did you use? GPT or MBR? The boot0 is a boot manager, and depending on the scheme you used you need mbr or gptboot.


----------



## blah44 (Nov 6, 2013)

Aha! Looks like this system came set up with GPT from the factory. I needed to run `gpart bootcode -b` AND `-p`, discovered after reading here: 
http://www.wonkity.com/~wblock/docs/html/disksetup.html

So I am up and booting, awesome and thanks!

Except now I lost my Windows install, can I get that back by rerunning `gpart bootcode` with /boot/boot0 specified somewhere?


----------



## SirDice (Nov 6, 2013)

If it's GPT it's most likely Windows 7. Windows 7 uses UEFI boot in that case. The only way I got dual-booting working to some degree is by using the BIOS/UEFI boot selector. If it refuses to UEFI boot Windows you may need to edit the partition table by hand as I've done here: Thread 35897.


----------



## wblock@ (Nov 6, 2013)

blah44 said:
			
		

> Aha! Looks like this system came set up with GPT from the factory. I needed to run `gpart bootcode -b` AND `-p`, discovered after reading here:
> http://www.wonkity.com/~wblock/docs/html/disksetup.html
> 
> So I am up and booting, awesome and thanks!
> ...



The article above is for setting up a blank disk.  A disk with Windows on it does not need more bootcode, and writing the FreeBSD bootcode will overwrite the existing Windows stuff.

For multibooting Windows, EasyBCD is, well, easy.  It's free for personal use.  (Scroll to the bottom, click Register.)

However, it works with Windows, which has been partly or completely overwritten.  If it was just the bootcode, that can (maybe) be repaired with a Windows startup DVD.

Of course, if you made a backup before starting with FreeBSD, that could be used also.


----------



## blah44 (Nov 6, 2013)

I see that it is for a complete disk, what I was trying to say is that a portion of it clued me in to using -b and -p together.

I certainly have Windows 8. In FreeBSD fdisk says 
	
	



```
The data for partition 1 is: sysid 238 (0xee), (EFI GPT)
```
 That is GPT yes? It then claims <UNUSED> for partition 2, 3, and 4. FreeBSD `gpart list` shows, in addition to the expected FreeBSD partitions, a 500 MB EFI system partition, a 40 MB basic data partition, a 128 MB MS-reserved partition, another basic data at 490 MB, 11 GB Microsoft recovery partition, and the 257 GB basic data partition that for some reason claims to be linux-data, that should be my Windows 8 partition and leads me to believe I have not lost my data except for the boot loader.

Can I somehow tell FreeBSD to boot one of these recovery partitions, or the 257 GB partition I believe holds Windows?


----------



## wblock@ (Nov 6, 2013)

blah44 said:
			
		

> I see that it is for a complete disk, what I was trying to say is that a portion of it clued me in to using -b and -p together.
> 
> I certainly have Windows 8. In FreeBSD fdisk says "The data for partition 1 is: sysid 238 (0xee), (EFI GPT)". That is GPT yes?



Yes, but fdisk(8) is looking at the (fake) PMBR.  It does not understand GPT.  gpart(8) is the tool that understands GPT on FreeBSD.



> It then claims <UNUSED> for partition 2, 3, and 4.



Those are fake entries in the PMBR.


----------



## wblock@ (Nov 6, 2013)

blah44 said:
			
		

> FreeBSD gpart list shows, in addition to the expected FreeBSD partitions, a 500M EFI system partition, a 40M basic data partition, a 128M ms-reserved partition, another basic data at 490M, 11G Microsoft recovery partition, and the 257G basic data partition that for some reason claims to be linux-data, that should be my Windows 8 partition and leads me to believe I have not lost my data except for the boot loader.
> 
> Can I somehow tell FreeBSD to boot one of these recovery partitions, or the 257G partition I believe holds Windows?



UEFI complicates the issue.  Booting with Plop might work.


----------



## wblock@ (Nov 7, 2013)

Followup: I just went through this tonight on a Windows 7 system.  The FreeBSD install overwrites the bootcode.  The Windows system partition can be booted with Plop, but gives this error:

```
Windows failed to start.  A recent hardware or software change might be the
cause. To fix the problem:

  1. Insert your Windows installation disc and restart your computer.
  2. Choose your language settings, and then click "Next."
  3 . Click "Repair your computer."

If you do not have this disc, contact your system administrator or computer
manufacturer for assistance.

    File: \Boot\BCD

    Stats: 0xc000000f

    Info: An error occurred while attempting to read the boot configuration
          data.
```

I have a backup but wanted to solve this problem.  Also, I'm lazy.

The bad news is that a Windows recovery disk or partition seems to be required, or rather, it is probably not required but I have yet to locate instructions written by someone who knows or can describe what needs to be done without using magical Microsoft software.

The good news: this Acer system had a recovery partition.  Using Plop to boot that partition worked, but it is not a standard recovery partition, only offering two options: restore to factory, or restore the operating system but save user files somewhere.  Not wanting either of those, I picked Exit.  And this is where it got interesting: the system rebooted into the standard Windows partition.  Running a boot repair seems to be part of that Acer recovery boot, even if the user just picks Exit as soon as it starts.

If anyone can locate a description of solving this problem, preferably with the freshly-installed FreeBSD, please point it out.


----------



## blah44 (Nov 7, 2013)

Ah, Plop may well be my answer. As long as I can boot Windows once I can probably dig myself out of this hole, as my FreeBSD partition has no data of value yet. I started with GRUB but it turned out to be a major pain. I will give it a shot when I get home tonight and report back. Thanks again!


----------



## blah44 (Nov 8, 2013)

Hah, Plop installed to CD and ran great! Nice starfield and animations!

Sadly it does not want to boot any of my volumes at all, not even the FreeBSD volume that boots up great when there is no CD in drive. Ah well. I imagine Plop is failing on my GPT, either unsupported or mine is somehow more tricky than most it sees.


----------

