Solved Freebsd won't boot after clean install

Hey guys,

I've been trying to install FreeBSD on one of my computers for a while now. It's been consistently getting through the installation without error, but when I try to boot from the new system I just get a flashing _

I've tried using a variety of different settings. The most recent one I tried to use as close to default settings as possible, since I figure that's probably the most well tried path through the install. The options I used were:

Keyboard layout: United States of America Dvorak
domain: my.domain.name
Optional system components: lib32 (32 bit compatibility libraries), ports (ports tree)
Partitioning: auto (UFS), guided disk setup
disk: ada0 466 GB ATA hard disk
Use whole disk
Partition scheme: GPT
Partition:
200 MB efi
462 GB freebsd-ufs /
3.8 GB freebsd-swap

root password: not putting that here
Set up network: connected
Services to start at boot: sshd, dumpdev
System hardening: none
Add users: added a user for myself with mostly default options, but added user to wheel
exit
Open shell before exiting: No
install complete: reboot

The installation media I used was a USB drive.

Looking at the problem on Google returned some results from a while back about installing to SSDs, but I don't have an SSD in this machine.

This machine can preform an EFI boot, because that's how it booted from the install media.

Let me know if you can think of any specifics I should include that I haven't mentioned here. Thanks for any help you can give me getting this computer running!
 
I don't have any idea as to what is happening here, but it seems to me that the system is trying to boot, but for some reason doesn't continue. Unfortunately I don't have hands-on experience with UEFI but I can't help wonder if this page can be of some use:

https://wiki.freebsd.org/UEFI

At the very least you could try to make sure that the boot1.efifat is in place.
 
Hi, Try to boot single user with the USB disk and at the root prompt type gpart show.

You should see something like...
Code:
=>        40  1953525088  ada0  GPT  (932G)
          40        1024     1  freebsd-boot  (512K)
        1064  1946156024     2  freebsd-ufs  (928G)
  1946157088     7368039     3  freebsd-swap  (3.5G)
  1953525127           1        - free -  (512B)
with your disk partitions and size etc. Then try gpart set -a active ada0, and reboot without USB drive.
 
An EFI booting system will look more like this (mid-2011 Macmini) after gpart show
Code:
=>       40  500118112  ada1  GPT  (238G)
         40     409600     1  efi  (200M)
     409640    7979000     2  freebsd-ufs  (3.8G)
    8388640   41943040     3  freebsd-ufs  (20G)
   50331680   16777216     4  freebsd-swap  (8.0G)
   67108896   41943040     5  freebsd-ufs  (20G)
  109051936   41943040     6  freebsd-ufs  (20G)
  150994976  125829120     7  freebsd-ufs  (60G)
  276824096  222298112     8  freebsd-ufs  (106G)
  499122208     995944        - free -  (486M)

depending on how many partitions for file systems have been setup (I have 8 on the boot drive above :).
 
Thanks for your help guys. It looks like /dev/ada0p1 is a fat32 partition containing two files: /EFI/BOOT/BOOTX64.EFI and /EFI/BOOT/STARTUP.NSH, which I believe constitutes boot1.efifat being in place.

gpart show gives

Code:
=>      40    976773088    ada0    GPT (466G)   
        40       409600       1    efi (200M)
    409640    968474624       2    freebsd-ufs (462G)
 968884264      7888863       3    freebsd-swap (3.86)
 976773127    1                    - free - (512B)
 
=>      3        60620795     da0    GPT (29G)
        3            1600       1    efi (800K)
     1603             118       2    freebsd-boot (59K)
     1721         1504448       3    freebsd-ufs (735M)
  1506169            2048       4    freebsd-swap (1.0M)
  1508217        59112581            - free - (28G)

=>      3        60620795     diskid/DISK-14B1601492280025    GPT (29G)
        3            1600                                1    efi (800K)
     1603             118                                2    freebsd-boot (59K)
     1721         1504448                                3    freebsd-ufs (735M)
  1506169            2048                                4    freebsd-swap (1.0M)
  1508217        59112581                                     - free - (28G)

I notice the second and third disk here are both the USB it's booted off of. I don't know why it's repeated. The HDD had also been repeated similarly the first time I ran gpart show, but after I mounted /dev/ada0p1 and looked at /EFI/BOOT/BOOTX.EFI it didn't show up anymore.

running gpart set -a bootme ada0 gives the error
Code:
gpart: attrib 'bootme' : Operation not supported by device
It sounds like that might be the root of my problems?
 
running gpart set -a bootme ada0 gives the error
The bootme attribute must be set on a partition, not a whole disk, in your case you would set that on the second partition of your disk gpart set -a bootme -i 2 ada0.
This is not needed though since the installer takes care of this.
I would try to disable any legacy boot options/CSM in your UEFI/BIOS if any.

I just get a flashing
Not sure what you mean by that? Can you explain, please.

Like allready good-beastie said, try to boot without the USB-drives attached.
It's possible the "hang" during post. Especially USB3.0 drives have a tendency to cause that from my experience. If that's the case it helps to play with the USB3.0 compatibility options in the BIOS and see what works best.
 
Last edited by a moderator:
It's true that gpart set -a bootme -i 2 ada0 correctly sets the bootme attribute on ada0p2, and also that doing so doesn't help.
I'm using an ASUS P8Z68-V motherboard, and it looks like it doesn't have any legacy boot or CSM options. Booting without the USB-drive attached still just gives a flashing underline cursor.
 
It looks like /dev/ada0p1 is a fat32 partition containing two files: /EFI/BOOT/BOOTX64.EFI and /EFI/BOOT/STARTUP.NSH, which I believe constitutes boot1.efifat being in place.

gpart show gives

Code:
=>      40    976773088    ada0    GPT (466G)  
        40       409600       1    efi (200M)
    409640    968474624       2    freebsd-ufs (462G)
968884264      7888863       3    freebsd-swap (3.86)
976773127    1                    - free - (512B)
That sounds/looks to be correct. This is from a working system I have:

Code:
root@svr-nas-rl:~ # gpart show
=>        40  1172123488  mfisyspd0  GPT  (559G)
          40        2048          1  efi  (1.0M)
        2088        2048             - free -  (1.0M)
        4136    33554432          3  freebsd-ufs  (16G)
    33558568    33554432          4  freebsd-ufs  (16G)
    67113000   524288000          5  freebsd-ufs  (250G)
   591401000   524288000          6  freebsd-ufs  (250G)
  1115689000    56434528             - free -  (27G)

root@svr-nas-rl:~ # mount -t msdosfs /dev/mfisyspd0p1 /mnt
root@svr-nas-rl:~ # find /mnt
/mnt
/mnt/EFI
/mnt/EFI/BOOT
/mnt/EFI/BOOT/BOOTX64.EFI
/mnt/EFI/BOOT/STARTUP.NSH

You should be able to do a one-shot UEFI boot and see the disk. If the EFI partition or it's contents are messed up you won't see it.
 
Since your motherboard is from the Sandy Bridge generation there is a chance that the UEFI booting is buggy. I had a Sandy Bridge motherboard myself not long ago which simply refused to boot in UEFI mode. Maybe your only option is to install a MBR.
 
I had the exact same experience when I first tried FreeBSD 11. I actually have reinstalled like 12 times using USB, CD & DVD. I also tried most of the previous suggestions here but it did not work for me.

The only thing that did the trick for me is by copying the GPT boot loader and make it the default (I'm fairly new to FreeBSD btw). I'm afraid by default FreeBSD boots using the MBR code. Anyway after my last installation attempt I went straight to Shell and I ran this command:

gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 /dev/ada0

The number 1 in the -i parameter is my freebsd-boot partition. Only after doing this I was able to boot up successfully. Hope this help.
 
I think this is what you mean by a one shot boot.
1519069704977.png
Unfortunately doing that just results in a flashing underline cursor. In that case I tried with the flash drive in as you can see, but the same thing happens without the flash drive in.

I notice the flash drive shows up twice here, once with UEFI: in front and once without. Doing a one shot boot from the UEFI: listing starts the installer, so I'm pretty sure my mother board is not simply refusing to boot in UEFI mode. I also notice that the P1: entry doesn't say it's using UEFI, so that might be an issue.

I previously hadn't had a freebsd-boot partition, so I tried an install with a manual partition setup and made a freebsd-boot partition after the EFI partition. After that and gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 2 /dev/ada0 (2 for me instead of 1 because it was after my EFI partition) it booted correctly.
 
I previously hadn't had a freebsd-boot partition, so I tried an install with a manual partition setup and made a freebsd-boot partition after the EFI partition. After that and gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 2 /dev/ada0 (2 for me instead of 1 because it was after my EFI partition) it booted correctly.
I'm glad it's working now. Happy computing! Cheers.
 
Hi, I have the same issue after a fresh install of FreeBSD 12.2 on a ThinkPad x270.
Unfortunately, I am not clear about the solution here.
I run 'gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 /dev/ada0' successfully, where 1 is my freebsd-boot. However my FreeBSD doesn't boot, still.

Is there something I am missing?

Thank you for any help you can provide.
 
Back
Top