Solved 15.0 Release - First boot failed to find bootable partition

Hi,

I have installed the latest 15.0 release onto my machine, the partition layout is as follows:

/dev/nda0p1 - EFI /boot/efi
/dev/nda0p2 - NTFS Windows Drive
/dev/nda0p3 - freebsd-swap none
/dev/nda0p4 - freebsd-ufs /

I follwewd through the installer and came to reboot the machine, I have rEFInd installed and that detects my BSD install and my windows install. When selecting the BSD entry form the menu I get the following error:

Failed to find bootable partition
ERROR: cannot open /boot/lua/loader.lua: no such file or directory.

I am then dropped to the 'OK' prompt.

Really stumped here as to what the issue is, would really appreciate some advice.

Thanks.
 
In the OK prompt (see loader_simp()) you can do:

Code:
lsdev

This lists all devices from which you can boot.

In the list, you should see "disk0p4" corresponding to your ufs partition (/dev/nda0p4).

If so, then do:
Code:
set currdev=disk0p4:
ls /boot/lua

If the file loader.lua is listed, do:

Code:
boot

If FreeBSD boots correctly, you write another post and we'll see what else we can do.
 
Thanks, this worked first time and booted me straight in. I imagine I need to make a change to the boot loader so will make another post to ask advice on this, thanks again.
 
In the OK prompt (see loader_simp()) you can do:

Code:
lsdev

This lists all devices from which you can boot.

In the list, you should see "disk0p4" corresponding to your ufs partition (/dev/nda0p4).

If so, then do:
Code:
set currdev=disk0p4:
ls /boot/lua

If the file loader.lua is listed, do:

Code:
boot

If FreeBSD boots correctly, you write another post and we'll see what else we can do.
What if ls /boot/lua fails: no such file or directory?
My machine has
nda0, Windows 11
nda1, FBSD 15.0
I was trying to mirror nda1 to nda2 using gpart tool. I think the last command I ran was
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 nda2
or
gpart bootcode -p /boot/boot1.efi -i 1 nda2
Don't know why I chose to reboot the system. Then the system won't boot.
 
Code:
OK lsdev
disk devices:
    disk0:             - I believe this disk is nda0, Windows installed. Irrelevant.
        disk0p1: EFI
        disk0p2
        ...
    disk1:            - FBSD zfs data disk, ada0. Irrelevant.
    
    disk2: 1953525168 X 512 blocks    - I believe this disk is nda1 has FBSD 15.0
        disk2p1: EFI
        disk2p2: FreeBSD boot
        disk2p3: FreeBSD swap
        disk2p4: FreeBSD ZFS

    disk3: 2000409264 X 512 blocks    - I believe this disk is nda2
        disk3p1: EFI
        disk3p2: FreeBSD boot
        disk3p3: FreeBSD swap
        disk3p4: FreeBSD ZFS

Of course both set currdev=disk2p4 and set currdev=dis3p4 failed.
 
Rich (BB code):
OK lsdev
       ...
       disk2: 1953525168 X 512 blocks    - I believe this disk is nda1 has FBSD 15.0
        disk2p1: EFI
        disk2p2: FreeBSD boot
        disk2p3: FreeBSD swap
        disk2p4: FreeBSD ZFS

    disk3: 2000409264 X 512 blocks    - I believe this disk is nda2
        disk3p1: EFI
        disk3p2: FreeBSD boot
        disk3p3: FreeBSD swap
        disk3p4: FreeBSD ZFS
Of course both set currdev=disk2p4 and set currdev=dis3p4 failed.
The syntax of ZFS "currdev" (or "rootdev") is currdev=zfs:dataset:.

loader_simp(8)
Rich (BB code):
     currdev   Selects the default device to loader the kernel from.  The
               syntax is:
                     loader_device:
               or
                     zfs:dataset:
               Examples:
                     disk0p2:
                     zfs:zroot/ROOT/default:


I was trying to mirror nda1 to nda2 using gpart tool. I think the last command I ran was
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 nda2
Seeing partitions disk2p1: EFI disk3p1: EFI, your machine seems to be UEFI booted, installing non-UEFI boot code won't have an effect.

You could also create a UEFI menu to choose from the machines boot disk menu on power up (activated by a function key):
Code:
efibootmgr  -c  -a  -L  FreeBSD -l nda2p1:/efi/freebsd/loader.efi
 
The syntax of ZFS "currdev" (or "rootdev") is currdev=zfs:dataset:.

loader_simp(8)
Rich (BB code):
     currdev   Selects the default device to loader the kernel from.  The
               syntax is:
                     loader_device:
               or
                     zfs:dataset:
               Examples:
                     disk0p2:
                     zfs:zroot/ROOT/default:
Well, syntax change isn't making difference. When I ran set currdev=zfs:zamd/ROOT/default: the return is "device not configured".
I just boot the machine using a flash drive, enter shell and import the pool on nda1. It turns out many datasets are gone! /etc, /usr/local/etc. What the heck!
Really don't remember what I did before this mess. Maybe seeing some message saying zfs is not up to date I upgraded zfs. But zfs upgrade shouldn't erase important directories like /etc, /usr/local/etc.
Damn...Luckily, no important data stored on this machine.
 
Well, syntax change isn't making difference. When I ran set currdev=zfs:zamd/ROOT/default: the return is "device not configured".
I didn't notice, OK lsdv should have shown
Code:
zfs devices:
       zfs:zamd
I have no idea why it doesn't.

I assume loader.efi(8) in /efi/boot/bootx64.efi or /efi/freebsd/loader.efi is up-to-date.

just boot the machine using a flash drive, enter shell and import the pool on nda1. It turns out many datasets are gone! /etc, /usr/local/etc....But zfs upgrade shouldn't erase important directories like /etc, /usr/local/etc.
Those directories are not gone (erased). A zpool-import(8) is not sufficient to mount all datasets.

To mount all datasets, after zpool-import(8), execute zfs-mount(8).

Example, booting a memstick installer USB drive, "Live System":
Code:
mkdir /tmp/zfs

zpool import -R /tmp/zfs zamd
zfs mount zamd/ROOT/default
 
I didn't notice, OK lsdv should have shown
Code:
zfs devices:
       zfs:zamd
I have no idea why it doesn't.

I assume loader.efi(8) in /efi/boot/bootx64.efi or /efi/freebsd/loader.efi is up-to-date.


Those directories are not gone (erased). A zpool-import(8) is not sufficient to mount all datasets.

To mount all datasets, after zpool-import(8), execute zfs-mount(8).

Example, booting a memstick installer USB drive, "Live System":
Code:
mkdir /tmp/zfs

zpool import -R /tmp/zfs zamd
zfs mount zamd/ROOT/default
That would be great. Will try another day.
Finger crossed.
 
So, I boot the machine using a memstick installer, select SHELL. Identify nda1 is the target disk via gpart show.
zpool import -R /tmp/zfs zamd
zfs mount zamd/ROOT/default
mount -t msdosfs /dev/nda1p1 /tmp/zfs/boot/efi

Now there is freebsd and boot directories under /tmp/zfs/boot/efi/efi.
cp /boot/loader.efi /tmp/zfs/boot/efi/efi/freebsd/
shutdown -r now

Still can't boot; same message as before.
Boot again using installer.
zpool import -R /tmp/zfs zamd
zfs mount zamd/ROOT/default
mount -t msdosfs /dev/da0s1 /boot/efi
cp /boot/efi/EFI/BOOT/* /tmp/zfs/boot/efi/efi/boot/
shutdown -r now

This time system boots.
Don' t know if it is efi/boot/bootx64.efi or bootia32.efi, or one of them together with efi/freebsd/loader.efi, that makes the effect.
 
Back
Top