Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(ZFS): update UEFI loader instructions for 13+ #408

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions documentation/content/en/books/handbook/zfs/_index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1335,11 +1335,13 @@ For systems using EFI to boot, execute the following command:

[source,shell]
....
# gpart bootcode -p /boot/boot1.efifat -i 1 ada1
# mount_msdosfs /dev/ada1p1 /boot/efi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default this will automatically be mounted (bsdinstall puts it in fstab) and so will fail with mount_msdosfs: /dev/ada1p1: Device busy. If you need to mount it manually for whatever reason, mount -t msdosfs is better than mount_msdosfs (which is a bit of an implementation detail).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction, it "may fail." You're assuming the disks were created with bsdinstall. There are more than a few FreeBSD disks roaming about that were installed with sysinstall or were manually partitioned to match disks installed long ago.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realise. I deliberately said by default at the start of the sentence to fully acknowledge there are other ways to get a working FreeBSD system. That is, by default it will fail. That doesn't mean it will always fail.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this?

mount -t msdosfs -u /dev/ada1p1 /boot/efi

# cp /boot/loader.efi /boot/efi/efi/boot/bootx64.efi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes amd64

Copy link
Author

@msimerson msimerson Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. Most of the other FreeBSD docs I've seen only copy loader.efi to bootx64.efi, as that's correct likely ~99% of the time. The wiki page and man page note there is no 32-bit UEFI support.

The two options 'x64' and 'aa64' would cover probably 99.9% of cases.

# cp /boot/loader.efi /boot/efi/efi/boot/bootx64.efi
or
# cp /boot/loader.efi /boot/efi/efi/boot/bootaa64.efi

To cover all cases, perhaps borrow from the convention used in the loader.efi man page?

# cp /boot/loader.efi /boot/efi/efi/boot/bootXXX.efi (see uefi(8) for values to replace ‘XXX’ with)

I don't have enough knowledge to explain why we don't just direct users to only copy it to the designated FreeBSD spot:

# cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi

# umount /boot/efi
....

Apply the bootcode to all bootable disks in the pool.
See man:gpart[8] for more information.
See man:gpart[8] and man:loader.efi[8] for more information.
====

[[zfs-zpool-history]]
Expand Down
Loading