Menu

Manual stanza for booting FreeBSD in non-EFI mode

2015-02-14
2015-02-16
  • Marcin Nowrot

    Marcin Nowrot - 2015-02-14

    Hi Roderic,

    I'd like to create a manual stanza for booting FreeBSD 10.1. This is my listing from diskutil

    /dev/disk0
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *500.3 GB   disk0
       1:                        EFI EFI                     209.7 MB   disk0s1
       2:          Apple_CoreStorage                         465.3 GB   disk0s2
       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
       4: 0FC63DAF-8483-4772-8E79-3D69D8477DE4               10.0 GB    disk0s4
       5:                 Linux Swap                         4.0 GB     disk0s5
       6: 83BD6B9D-7F41-11DC-BE0B-001560B84F0F               524.3 KB   disk0s6
       7:                FreeBSD UFS                         19.3 GB    disk0s7
       8:               FreeBSD Swap                         799.1 MB   disk0s8
    /dev/disk1
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:                  Apple_HFS Mac OS X               *464.9 GB   disk1
                                     Logical Volume on disk0s2
                                     BC334570-4582-4A93-9920-812E40A7996E
                                     Unlocked Encrypted
    

    I've tried the following but so far without success

    menuentry "FreeBSD 10.1" {
            icon \EFI\refind\icons\os_freebsd.png
            volume 7:  # 6: did not work either
            loader \boot\loader
    } 
    

    but so far woithout success. Could you please tell me what should be put into the "volume" entry of the stanza? Are the stanzas EFI-only or can they boot also systems that are using legacy BIOS boot loader?

    Thanks again and Best Regards,

    Marcin

     
  • Roderick W. Smith

    Manual boot stanzas work only for EFI-mode booting, I'm afraid. rEFInd should detect a BIOS-mode FreeBSD boot loader and present it on your menu. In fact, it should even identify it as FreeBSD and show you an appropriate icon. You'll need a hybrid MBR, probably with your FreeBSD partition in it, for this to work, though.

     
  • Marcin Nowrot

    Marcin Nowrot - 2015-02-16

    Thanks for confirming that the manual stanzas are EFI-only - I've removed the entry from refind.conf

    In fact, it should even identify it as FreeBSD and show you an appropriate icon. You'll need a hybrid MBR, probably with your FreeBSD partition in it, for this to work, though.

    I do have a hybrid MBR that contains a protective EFI, bsd-boot, bsd-ufs and bsd-swap partitions. Bsd-boot has a bootable flag set up. However what I see in the menu are two generic linux (Tux) icons which both boot FreeBSD. Probably I need to clean up MBR somewhere, but do you know of any tools that could tell me what's in each partition MBR and also in the MBR of the entire disk?

     
  • Roderick W. Smith

    There's no such thing as a "partition MBR." The term "master boot record (MBR)" refers exclusively to the first sector of the entire hard disk. The first sector of a partition is something referred to as a partition boot record (PBR), or simply the partition's "boot sector."

    Whatever the terminology, you can use dd to copy whatever you want from a disk device to a file and then use hexdump to examine it, as in:

    sudo dd if=/dev/disk0 of=disk0.mbr bs=512 count=1
    hexdump -C disk0.mbr
    

    (I'm not 100% positive that hexdump is available in OS X, but you can probably find a port if it's not there by default. Alternatively, you can use any binary editor of your choice.)

    Change /dev/disk0 to whatever the appropriate disk or partition identifier is.

    Check the ScanVolumeBootcode() function in rEFInd's refind/lib.c source code file to see how it's identifying BIOS boot loaders. As you can see, it mostly looks for strings that are believed to uniquely identify particular boot loaders. If those strings happen to be present where they're not expected, a misidentification can occur. In your case, there could be a bug that's causing FreeBSD to be misidentified as Linux, or it could be that your disk has a "Linux" boot loader installed that's actually booting FreeBSD. For instance, if you installed GRUB to boot FreeBSD, rEFInd would identify it as Linux, since GRUB is most often associated with Linux, despite the fact that it can launch several other OSes.

     

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.