Changing from BIOS to UEFI and update issues


#1

I did a hardware refresh on my computer, and have seen a couple of issues that I’m not sure how to handle.

The first of these is that while the last time I rebuilt the machine, I did GPT rather than MBR, but my system was old enough that it was still using BIOS rather than UEFI. So my question is, what is the easiest way to get the drives booting on UEFI. I was going to attempt to reinstall into a new BE last night, but as soon as I said “build in a BE,” the installer said “Okay! Let’s do this!” without asking any questions, which made me think it was probably going to keep the same settings as the other BEs on the system (BIOS). So my first question is how do I manage to get my machine to boot UEFI rather than BIOS?

The second question/issue is probably related. I have the red update available icon in the sysadm-client tray icon as soon as I log in. So whether I go in to the sysadm client, and click “Apply Updates” or log out and click “restart and perform upgrades” or however it is worded, the system simply reboots and the next time I log in, it gives me the red sysadm client icon. I also noticed the following in my pc-updatemanager-auto.log"

Updating pkgng config…
Unmounting stage BE…
Unmounted successfully
GRUB configuration updated successfully
Renamed successfully
GRUB configuration updated successfully
Renamed successfully
GRUB configuration updated successfully
Activated successfully
Starting syscache…
Your update is finished! Please reboot to load into the new boot-environment

GRUB? I have been running the BSD loader since last April.
I suspect this is related to the UEFI thing…?

Is it even worth switching over?

Thanks,
–vr


#2

By "hardware refresh, do you mean you installed a new UEFI capable motherboard?


#3

Yessir. Went from an AMD Phenom X4 840 to an Intel i7-6850 on an Asus X99-E motherboard. Which is akin to going from a Cessna 182 to a Gulfstream V…


#4

On your BIOS look look for something that says “Enable Legacy Boot.” And disable it, also look for “Boot from Secure Boot Only” and disable it. Then install TrueOS from media DVD/USB BUT when you get to the install option, choose “install into BE” then let it run make sure it’s to BE and not to disk thogh, once you login, you will have to download your programs again, but all the settings should be retained. Also if you can, try to avoid MBR and use GPT.


#5

The drives are already GPT. I made sure of that the last time.


#6

You need an EFI System Partition on Your boot-drive’s disk. Do You have created one? Also called ‘ESP’ when abbreviated.


#7

That’s a good point, I didn’t realize he was just doing a partition. I thought he was doing full disk installation.


#8

gpart list
on the current boot drives. If you don’t already have an EFI/ESP/UEFI partition things could get dicey.


#9

I apparently have a free space for it…

$ gpart show
=> 34 488397101 ada0 GPT (233G)
34 6 - free - (3.0K)
40 256 1 freebsd-boot (128K)
296 1792 - free - (896K)
2088 484270080 2 freebsd-zfs (231G)
484272168 4096000 3 freebsd-swap (2.0G)
488368168 28967 - free - (14M)

=> 34 488397101 ada1 GPT (233G)
34 6 - free - (3.0K)
40 256 1 freebsd-boot (128K)
296 1792 - free - (896K)
2088 484270080 2 freebsd-zfs (231G)
484272168 4096000 3 freebsd-swap (2.0G)
488368168 28967 - free - (14M)


#10

@VulcanRidr you made a zfs mirror out of those didn’t you?
If so, I’m wondering if we muck around with one and don’t touch the other that leaves you in a position you can fall back to if something goes wrong.

the freebsd-boot and the free space after winds up being about 1M, I’m not in front of a UEFI machine so I can’t check how much is typically allocated (I think it’s 1M, but may be 2M).

Edit:
this is an interesting thing; perhaps the partitioning of freebsd-boot should be large enough to simply change the partition type to EFI. Then all you’d need to do is copy the efi boot mgr stuff in.


#11

I saw a FreeBSD thread and I believe that that free space after the freebsd-boot was where they ended up putting the efi stuff…And I think it was about 800k in size. I’ll have to see if I can find the thread from the mailing list.

I found the thread:
https://lists.freebsd.org/pipermail/freebsd-stable/2016-December/086461.html

Wasn’t sure if that was FreeBSD specific or if the same applies to TrueOS.


#12

TrueOS is FreeBSD so it should be fine.


#13

To make it clearly understood, if any reader didn’t know already:
EFI System Partition is needed for every EFI-booted OS: BSD, Linux, Apple, Microsoft, whatever. Nothing TrueOS/FreeBSD specific here.

Two points:

If You can, make the EFI System Partion 512MB, to be prepared for future multiboot installations.

If You only boot one OS, much less is needed.

I have no TrueOS/FreeBSD available right now.

But I can show You OpenBSD’s default configuration. Here it is:

$ mount | grep sd1i
/dev/sd1i on /esp_ type msdos (local, mask=0555)

$ df | grep 'Filesystem|sd1i’
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
/dev/sd1i 460K 244K 216K 53% 512 0 100% /esp_

$ ls -R /esp_/
total 8
8 dr-xr-xr-x 1 root wheel arch 4.0K May 12 2017 efi/

/esp_/efi:
total 8
8 dr-xr-xr-x 1 root wheel arch 4.0K May 12 2017 boot/

/esp_/efi/boot:
total 472
224 -r–r--r-- 1 root wheel - 111K Nov 12 15:22 bootia32.efi
248 -r–r--r-- 1 root wheel - 124K Nov 12 15:22 bootx64.efi


#14

My TrueOS UEFI disk:

gpart show ada0
=>       40  488397088  ada0  GPT  (233G)
         40     204800     1  efi  (100M)
     204840  479762432     2  freebsd-zfs  (229G)
  479967272    8388608     3  freebsd-swap  (4.0G)
  488355880      41248        - free -  (20M)

mount -t msdosfs /dev/ada0p1 /mnt
[mremski@aleutia 124] ls -l /mnt
total 8
drwxr-xr-x  1 root  wheel   8.0K Oct 10 16:21 efi/
[mremski@aleutia 125] ls -l /mnt/efi/
total 8
drwxr-xr-x  1 root  wheel   8.0K Oct 10 16:21 boot/
[mremski@aleutia 126] ls -l /mnt/efi/boot/
total 360
-rwxr-xr-x  1 root  wheel    96K Oct 10 16:21 bootx64-trueos.efi*
-rwxr-xr-x  1 root  wheel   221K Oct 10 16:21 BOOTx64.efi*
drwxr-xr-x  1 root  wheel   8.0K Oct 10 16:21 icons/
-rwxr-xr-x  1 root  wheel    24K Oct 10 16:21 refind.conf*

[mremski@aleutia 128] df -h /mnt
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ada0p1    100M    1.1M     99M     1%    /mnt

I’m not sure where refind gets installed (guessing the whole “first sector” thing) or how the ESP gets formatted, but we can probably figure that out. Heck if you wanted to you could download the latest ISO, make a mdconfig a node and then mount it (similar to Linux loopback mount for ISO images). That would let you look at any/all scripts on the install media, give you access to things like refind, all kinds of good stuff.

Edit:
How to mount an iso image

[root@aleutia] ~# mdconfig -a -t vnode -f ~mremski/Downloads/latest-server.iso 
md0
[root@aleutia] ~# mount -t cd9660 /dev/md0 /mnt
[root@aleutia] ~# ls /mnt
.cshrc               fbsd-version         mntuzip              tmp
.profile             home                 net                  trueos-media
bin                  lib                  pcbsd-media          trueos-media-details
boot                 libexec              proc                 trueos-media-local
COPYRIGHT            liveroot             rescue               trueos-server
dev                  media                root                 usr
dist                 memfs                sbin                 uzip
etc                  mnt                  sys                  var
[root@aleutia] ~# umount /mnt
[root@aleutia] ~# mdconfig -d -u 0

#15

Regarding:
I’m not sure where refind gets installed (guessing the whole “first sector” thing) or how the ESP gets formatted…

  1. Everything except bootx64-trueos.efi is part of refind.

  2. The machine’s built-in firmware boots refind’s BOOTx64.efi.

  3. There is no “first sector thing”. That would be BIOS. But it isn’t BIOS. IT’s EFI. No first sector is involved.

  4. EFI System Partition gets formatted by OS-installer in a EFI-standardized form of FAT.


#16

Thanks. random characters to meet the minimum
edit:
If there is enough space to do so after freebsd-boot. If not, it becomes more install to new disk.
so in theory, @VulcanRidr should be able to do the following on ada0 and ada1:
use gpart to expand his freebsd-boot partition
do newfs-msdos -F32 /dev/ada0p1
mount -t msdosfs /dev/ada0p1 /mnt
mkdir -p /mnt/efi/boot
cp bootx64-trueos.efi, BOOx64.efi, refind.conf and icons/ to /mnt/efi/boot

The bits copied to the efi/boot directory, he should be able to get by doing the mount latest iso?

Then obviously cross fingers before rebooting…