# Question: FreeBSD 11.2 to 12.0 - GPART/EFI



## mg16373 (Dec 14, 2018)

Some days ago I have installed a new server with 11.2-RELEASE-p6 and all was fine. Today I have upgraded to 12.0-RELEASE and the server reboots also correct. I have checked the installation and my zpool and have done a "zpool ugprade" to the latest feature-set. I'm not a newbie to FreeBSD (since 3.0-RELEASE) but now I have seen that the origin installation routine of FeeBSD 11.2 has created the following GPT map. I'm now a little bit "scared" to reboot the server after I have entered the following commands (see below) because I'm haven't enough experiences with EFI (KI don't need it). This machine is too far away from me for any experiments and I don't know what type of boot mode the "System" is using.

Commands entered after upgrade was completed:

```
760    10:56    gpart bootcode -p /boot/boot1.efi -i1 ada0
   761    10:56    gpart bootcode -p /boot/boot1.efi -i1 ada1
   762    10:56    gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada0
   763    10:56    gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada1[/FONT]

[FONT=Courier New]# gpart show
#
=>        40  3907029088  ada0  GPT  (1.8T)
          40      409600     1  efi  (200M)
      409640        1024     2  freebsd-boot  (512K)
      410664         984        - free -  (492K)
      411648    16777216     3  freebsd-swap  (8.0G)
    17188864  3889840128     4  freebsd-zfs  (1.8T)
  3907028992         136        - free -  (68K)

=>        40  3907029088  ada1  GPT  (1.8T)
          40      409600     1  efi  (200M)
      409640        1024     2  freebsd-boot  (512K)
      410664         984        - free -  (492K)
      411648    16777216     3  freebsd-swap  (8.0G)
    17188864  3889840128     4  freebsd-zfs  (1.8T)
  3907028992         136        - free -  (68K)

# zpool status
#
  pool: zroot
state: ONLINE
  scan: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    zroot       ONLINE       0     0     0
      mirror-0  ONLINE       0     0     0
        ada0p4  ONLINE       0     0     0
        ada1p4  ONLINE       0     0     0

errors: No known data errors
```


----------



## SirDice (Dec 14, 2018)

mg16373 said:


> ```
> 760 10:56 gpart bootcode -p /boot/boot1.efi -i1 ada0
> 761 10:56 gpart bootcode -p /boot/boot1.efi -i1 ada1
> ```


This is wrong and doesn't do what you think it does. The correct way to create the efi partition is to dd(1) the /boot/boot1.efifat image to your ada0p1 and ada1p1.


----------



## mg16373 (Dec 14, 2018)

SirDice said:


> This is wrong and doesn't do what you think it does. The correct way to create the efi partition is to dd(1) the /boot/boot1.efifat image to your ada0p1 and ada1p1.




```
:/boot # dd if=/boot/boot1.efifat of=/dev/ada0p1
1600+0 records in
1600+0 records out
819200 bytes transferred in 0.150046 secs (5459646 bytes/sec)

:/boot # dd if=/boot/boot1.efifat of=/dev/ada1p1
1600+0 records in
1600+0 records out
819200 bytes transferred in 0.099502 secs (8232960 bytes/sec)
```

done


----------



## SirDice (Dec 14, 2018)

mg16373 said:


> I don't know what type of boot mode the "System" is using.


You can tell by looking at the machdep.bootmethod sysctl(8):

```
root@maelcum:~ # sysctl machdep.bootmethod
machdep.bootmethod: BIOS
```

I don't have a working UEFI boot machine so I can't show the output, but it should indicate UEFI if that's the case.


----------



## mg16373 (Dec 14, 2018)

SirDice said:


> You can tell by looking at the machdep.bootmethod sysctl(8):
> 
> ```
> root@maelcum:~ # sysctl machdep.bootmethod
> ...



My machine boots via BIOS. SirDice I was born in 1970 and I don't need UEFI and have never ordered this *lol*
$ sysctl sysctl machdep.bootmethod
machdep.bootmethod: BIOS


----------

