Discussion:
EFI Bootstrap Question on 13.0
john via freebsd-questions
2021-04-19 14:30:08 UTC
Permalink
I updated to 13.0 successfully. I then upgraded ZFS because I found that
was necessary to import a ZFS pool mounted on iSCSI without forcing it.
Everything seemed to be working correctly until I upgraded a handful of
packages that changed since Friday morning.

The system won't boot. It stops in startup.nsh.

After upgrading ZFS I updated the bootcode according to the warning in
the Handbook. While the handbook says to run:

# gpart bootcode -p /boot/boot1.efifat -i 1 ada1

I didn't see "boot1.efifat" in /boot so I executed instead:

# gpart -p bootcode -p /boot/boot1.efi -i1 nvd0

Did I reference the wrong file for the bootcode?

I can mount the filesystem from the live CD and verify that I'm using
UEFI boot and that partition 1 is the EFI partition.

Recovery recommendations?
--
John R. Shannon
***@johnrshannon.com
john via freebsd-questions
2021-04-19 16:40:13 UTC
Permalink
Should it be possible to mount the efi partition as a msdosfs?

# mount -t msdosfs -o longnames /dev/nvd0p1 mountpoint


I'm getting:

msdos_fs: Invalid argument /dev/nvd0p1

gpart shows partition 1 of nvd0 as efi partition
Post by john via freebsd-questions
I updated to 13.0 successfully. I then upgraded ZFS because I found that
was necessary to import a ZFS pool mounted on iSCSI without forcing it.
Everything seemed to be working correctly until I upgraded a handful of
packages that changed since Friday morning.
The system won't boot. It stops in startup.nsh.
After upgrading ZFS I updated the bootcode according to the warning in
# gpart bootcode -p /boot/boot1.efifat -i 1 ada1
# gpart -p bootcode -p /boot/boot1.efi -i1 nvd0
Did I reference the wrong file for the bootcode?
I can mount the filesystem from the live CD and verify that I'm using
UEFI boot and that partition 1 is the EFI partition.
Recovery recommendations?
--
John R. Shannon
***@johnrshannon.com
john via freebsd-questions
2021-04-19 16:55:36 UTC
Permalink
I resolved my problem.

When I could not mount the efi partition I re-created it:

# newfs_msdos -F 32 -c 1 /dev/nvd0p1

mounted it and wrote the bootstrap code:

# mount -t msdosfs -o longnames /dev/ada0p1 mountpoint
# mkdir -p mountpoint/EFI/BOOT
cp /boot/loader.efi mountpoint/EFI/BOOT/BOOTX64.efi

The system boot now.
Post by john via freebsd-questions
Should it be possible to mount the efi partition as a msdosfs?
# mount -t msdosfs -o longnames /dev/nvd0p1 mountpoint
msdos_fs: Invalid argument /dev/nvd0p1
gpart shows partition 1 of nvd0 as efi partition
Post by john via freebsd-questions
I updated to 13.0 successfully. I then upgraded ZFS because I found
that was necessary to import a ZFS pool mounted on iSCSI without
forcing it.
Everything seemed to be working correctly until I upgraded a handful of
packages that changed since Friday morning.
The system won't boot. It stops in startup.nsh.
After upgrading ZFS I updated the bootcode according to the warning in
# gpart bootcode -p /boot/boot1.efifat -i 1 ada1
# gpart -p bootcode -p /boot/boot1.efi -i1 nvd0
Did I reference the wrong file for the bootcode?
I can mount the filesystem from the live CD and verify that I'm using
UEFI boot and that partition 1 is the EFI partition.
Recovery recommendations?
--
John R. Shannon
***@johnrshannon.com
Graham Perrin
2021-04-24 11:37:42 UTC
Permalink
# gpart bootcode … -i 1 …
In your case (and others), index 1 was the wrong target.

The screenshot at
<https://new.reddit.com/r/freebsd/comments/mvvloi/-/gvf25sf/>
demonstrates how writing bootstrap code can leave the file system not
only non-mountable, but irreparable.

I'm glad that you managed to recreate what's required.

Continue reading on narkive:
Loading...