Menu

Help with FreeBSD

Dizzle
2019-08-10
2022-05-06
  • Dizzle

    Dizzle - 2019-08-10

    Help with FreeBSD

    Grub2Win set up great on my device. I am trying to boot to FreeBSD with it,
    but I am having problems.

    I have added the entry on the menu, but when run I get the error "grub did
    not find a root partition with file /boot/bootloader".

    And in fact this file bootloader is not there. I have been trying to figure
    this out on my own for about 40 hours now so I thought I would ask for help.

    It appears that FreeBSD isn't actually bundled with grub2win, right?

    How can I add it? I have already downloaded several ISO and img files for
    the FreeBSD program, but just cant figure out how to make Grub2Win to load
    them.

    Thanks for any help and your patience.

     
  • Drummer

    Drummer - 2019-08-10

    Hi Dizzle,

    I'm sending you an email with some additional questions and info.

    Dave

     
  • Drummer

    Drummer - 2019-08-15

    Hey Ed,

    Just wanted you to know that I did not just arbitrarily drop support of FreeBSD.
    The GNU Grub entries required have changed considerably over the last couple of years and continue to change:

    menuentry 'FreeBSD Two years ago ' --class freebsd --class icon-freebsd {
    set rootfile=/boot/loader
    getpartition file $rootfile root
    kfreebsd $rootfile
    }

    This was something that Grub2Win could automatically generate.

    menuentry 'FreeBSD Today ' --class freebsd --class icon-freebsd {
    insmod zfs
    set root='(hd0,gpt4)'
    search --no-floppy --fs-uuid --set $UUID
    kfreebsd /boot/kernel/kernel
    kfreebsd_loadenv /boot/device.hints
    kfreebsd_loadenv /boot/kernel/linker.hints
    set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ada0p4
    set kFreeBSD.vfs.root.mountfrom.options=rw
    set kFreeBSD.module_path="/boot/kernel;/boot/modules
    }

    Now the GNU Grub entry has become quite complex and obscure.
    The setup seems to change every couple of months.

    I feel bad for Dizzle. I did give him the current configuration so he could try custom code.
    However, I don't think Grub2Win can support this any longer.


    Contrast FreeBSD with the Windows entry, which is quite simple and hasn't changed a bit for many years.

    menuentry 'The Windows EFI Boot Manager Five years ago ' --class windows --class icon-windows {
    set efibootmgr=/efi/Microsoft/Boot/bootmgfw.efi
    getpartition file $efibootmgr root
    chainloader $efibootmgr
    }

    menuentry 'The Windows EFI Boot Manager Today ' --class windows --class icon-windows {
    set efibootmgr=/efi/Microsoft/Boot/bootmgfw.efi
    getpartition file $efibootmgr root
    chainloader $efibootmgr
    }

    My three cents,

    Dave

     

    Last edit: Drummer 2019-08-16
  • Matheus Garcia

    Matheus Garcia - 2020-09-30

    If your machine has EFI support you can simply chainload the EFI bootloader to boot FreeBSD.
    menuentry 'FreeBSD' {
    chainloader /boot/loader.efi
    }

    This does work and is rather simple. I'm not sure if this does work for machines without EFI though.

     
  • Drummer

    Drummer - 2020-09-30

    Hi MGP,

    This may work for some EFI systems definitely not for BIOS systems though.

    However, the FreeBSD installer likes to create its own EFI partition, separate from the Windows or Linux EFI partition and sometimes strangely formatted.

    The location of the FreeBSD boot loader within this EFI partition is also not consistent. Often altered by the installation options the user enters.

    Anyway, I hope this methodology works out for you.

    Thanks,

    Dave

     
  • Matheus Garcia

    Matheus Garcia - 2020-09-30

    Even though this is the old boot method, it still works for many people:
    menuentry 'FreeBSD' {
    kfreebsd /boot/loader
    }

    As far as I know, however, this method doesn't work for systems with EFI enabled.

     

    Last edit: Matheus Garcia 2020-09-30
  • Matheus Garcia

    Matheus Garcia - 2021-10-23

    Can confirm kfreebsd /boot/loader still works for non-EFI hardware, as of FreeBSD 13. Only tested with ZFS, though.

    For EFI hardware, chainloader /boot/loader.efi still is the way to go.

     
  • Matheus Garcia

    Matheus Garcia - 2021-11-24

    For EFI hardware:

    set root=(hdX,Y)
    chainloader /boot/loader.efi
    boot
    

    For non-EFI hardware:

    set root=(hdX,Y)
    kfreebsd /boot/loader
    boot
    

    For EFI hardware + ZFS:

    set root=(hdX,Y)
    chainloader /@/boot/loader.efi
    boot
    

    For non-EFI hardware + ZFS:

    set root=(hdX,Y)
    kfreebsd /@/boot/loader
    boot
    
     
  • Simon Baldwin

    Simon Baldwin - 2022-05-05

    I tried this option:
    set root=(hd0,3)
    kfreebsd /boot/loader
    boot

    On my bios install of freeBSD 13.0 but it wouldn't boot from Grub2WIn. I got a message
    "Couldn't boot FreeBSD, you have to load the kernel first."

     
    • Ed  P

      Ed P - 2022-05-05

      That sounds like you need to turn off your machine's EFI's Secure Boot option.

       
  • Drummer

    Drummer - 2022-05-05

    Hi Simon,

    I haven't had much luck with FreeBSD over the last couple of years.
    The boot code has become very complex and varies unpredictably.
    For theses reasons, Grub2Win can no longer automatically generate FreeBSD boot code.

    Please send me your Grub2Win diagnostics and a directory listing of your FreeBSD /boot directory and I'll see if I can help with some sort of manual configuration. I'm not optimistic.

    Dave

     
  • Simon Baldwin

    Simon Baldwin - 2022-05-05

    Thanks for your kind offer, I'll have a look and get back on here...

     
  • Drummer

    Drummer - 2022-05-05

    Hey Ed,

    I believe Simon said this was a BIOS machine. There is no Secure Boot in BIOS machines.

    Thanks again,

    Dave

     
  • Simon Baldwin

    Simon Baldwin - 2022-05-06

    Yes its a BIOS machine, no uefi or secure boot. Again thank you Dave but I found another solution for the dual boot and am using BCD on this machine. Grub2Win works great for me on another machine helping prevent Windows taking over on a triple boot Linux/Windows/ChromeOS machine.

     
  • Drummer

    Drummer - 2022-05-06

    Hi Simon,

    Cool. Glad that worked out for you.

    Dave

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.