Solved Unbootable system, only '_' or '-' blinking, disk is ok

I have rebooted the system (due to some page faults? system lost connectivity) and it didnt boot and is now stuck in bootloader, before showing the menu.

I have taken out SSD and did immediately a backup of all partitions, but there were no issues so ssd is ok, also smartctl didnt report anything.

Then I have checked the ram using memtest86+ but seems like everything is ok. Also all disks in bios are visible.

Is it possible that bootloader got corrupted? How to correct it (I dont have another freebsd but if needed I can set it up in KVM)?

I have seen this:

Create UEFI bootcode:
gpart bootcode -p /boot/boot1.efi -i1 ada0

Create BIOS bootcode:
gpart bootcode -b /boot/pmbr -p /boot/gptboot-i1 ada0

The issue is that I have absolutely no clue how the system was installed, can it be seen somehow on filesystem (I can import zroot on linux)?
 
What version of FreeBSD?

How to correct it (I dont have another freebsd but if needed I can set it up in KVM)?
Can you boot the FreeBSD install media?

Create UEFI bootcode:
gpart bootcode -p /boot/boot1.efi -i1 ada0
This is wrong.

I suggest actually looking if your system even has an efi partition. If there's no efi partition then the system can't EUFI boot at all.

The issue is that I have absolutely no clue how the system was installed, can it be seen somehow on filesystem (I can import zroot on linux)?
Don't need to import anything, just look at the partitions. freebsd-boot is used for CSM boot, efi is used for UEFI boots. freebsd-ufs means it's an UFS system, freebsd-zfs is a ZFS system. Just boot from the installation media, check the partitions and use the appropriate bootloader (gptboot(8) for UFS, gptzfsboot(8) for ZFS).
 
What version of FreeBSD?


Can you boot the FreeBSD install media?


This is wrong.

I suggest actually looking if your system even has an efi partition. If there's no efi partition then the system can't EUFI boot at all.


Don't need to import anything, just look at the partitions. freebsd-boot is used for CSM boot, efi is used for UEFI boots. freebsd-ufs means it's an UFS system, freebsd-zfs is a ZFS system. Just boot from the installation media, check the partitions and use the appropriate bootloader (gptboot(8) for UFS, gptzfsboot(8) for ZFS).

Yes, install media (12.2 dvd1 booted trough ventoy) works without any issues.

What I am worried is that some update came with updated bootloader and i have missed the "update your bootloader notice" so it would probably be best to use the image from installed zroot.
 
It is 12.2-RELEASE-p3 and works now after updating mbr and gptzfsboot.

For an info for anyone else, I have system on zfs partition and I have:

- boot into live cd sheel (btw this tool is really great: https://www.ventoy.net/en/index.html )
- imported zroot (zpool import -f zroot), it mounts over livecd mountpoints so you are having access to your system so the pmbr and gptzfsboot are the exact versions that you have on your system (and not from boot cd)
- updated the mbr and freebsd-boot partitions by running: gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0

What seems really strange to me is that it even got corrupted, I have put ssd trough s.m.a.r.t test and there is nothing wrong with it.

Before it happened the system has lost network connectivity and console was full of swap I/O errors. I am so sorry I didnt photo it before reboot but since I didnt do anything to the mbr or freebsd-boot partitions (after it is swap):
- some update required updating of bootcode and I have missed the notice (which is quite possible)
- something happened in regarding to the swap errors that corrupted the bootcode.
- something got wrong with ssd and it wasn't shown by smart.
 
imported zroot (zpool import -f zroot), it mounts over livecd mountpoints so you are having access to your system so the pmbr and gptzfsboot are the exact versions that you have on your system (and not from boot cd)
It's the same, you could have used the bootloader that's on the install media.

What seems really strange to me is that it even got corrupted, I have put ssd trough s.m.a.r.t test and there is nothing wrong with it.
SMART is nice but it's not perfect. It doesn't always detect errors or failures.

Anyway, good to hear it's solved and it's working again.
 
… I have put ssd trough s.m.a.r.t test and there is nothing wrong with it. …

This SSD was terribly wrong (near the foot of the page, 2021/07/16 01:03:08):

<https://lists.freebsd.org/archives/freebsd-current/att-0339/2021-07-16_00.53_typescript.txt>

– with a power on time of less than a hundred hours <https://bsd-hardware.info/?probe=7138e2a9e7&log=smartctl#nvme0> and no wrongness revealed by HP diagnostics (comparable to an extended S.M.A.R.T. self-test).

S.M.A.R.T. reading from a drive can not be a substitute for a sustained write test.
 
Back
Top