windows entry for grub2

David Benfell benfell at
Tue Aug 4 20:22:19 UTC 2015

Quoting CeDeROM <cederom at>:

> Hello David :-)
> EFI is different than MBR/BIOS. I did not manage to boot Grub2/Linux on my
> new EFI machine. Only FreeBSD and Windows starts.

It *is* a very weird and poorly documented process and I haven't  
actually checked to see yet if I succeeded in getting grub to work.

Obviously, we want the grub-efi package. I think it *might* want the  
EFI partition to be the first on the disk (normal, but not always the  
case), but what is really weird here is having to switch the partition  
type between efi and bios-boot. GRUB only writes on a partition marked  
bios-boot and when it finds a directory there named EFI. And the  
firmware will only boot from it when it is marked efi. So (from memory):

gpart modify -i 1 -t bios-boot /dev/ada0

And when done

gpart modify -i 1 -t efi /dev/ada0

I also have the efi partition mounted as /boot/efi

Also, when issuing grub-install it is very important to specify the  
correct target. The default is *wrong* and, I'm guessing, how I  
screwed up my EFI partition in the first place. The invocation here  
seems to be:

grub-install --target=x86_64-efi /dev/ada0

You should then find a subdirectory /boot/efi/EFI/Grub with an efi  
file inside of it.

It looks like all this is extremely fragile. I had a crash (probably  
related to the KVM switch I use--I think I need to report this to the  
stable list) while the partition was mounted and I am currently unable  
to mount or modify the EFI partition. I get:

home-desktop# mount /boot/efi
mount_msdosfs: /dev/ada0p1: Operation not permitted
home-desktop# newfs_msdos /dev/ada0p1
newfs_msdos: /dev/ada0p1: Operation not permitted

I can't even delete the partition:

home-desktop# gpart delete -i 1 /dev/ada0
gpart: Device busy

I have rebooted the system a couple times since this first cropped up,  
so that didn't help. I may try going in with the gparted live disk.
> So I select OS to boot directly from BIOS menu (or Boot Menu F8). Have you
> tried that to repair Windoze boot? Maybe booy CD?

If the files I'm able to obtain from other systems don't work, I will  
have to buy the CD. That menu (accessed via F1 and F12 on my system)  
does not show a boot entry for Windows.

Also, apparently I was wrong about grub detecting Windows. It detects  
the efi files--which are presently missing on my system.
> I can give you files fromWin7  EFI boot partition if that helps..
> Best regards,
> Tomek
> --

David Benfell <benfell at>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: PGP Digital Signature
URL: <>

More information about the freebsd-questions mailing list