Re: changing ext. USB disk to UEFI boot

From: Paul Mather <paul_at_gromit.dlib.vt.edu>
Date: Thu, 04 Apr 2024 12:05:22 UTC
On Apr 4, 2024, at 5:03 AM, Matthias Apitz <guru@unixarea.de> wrote:


> This is the start of the partition table of the /dev/nda0 device
> (still with Windows and looked at from the working USB-key):
> 
> # gpart list nda0
> Geom name: nda0
> modified: false
> state: OK
> fwheads: 255
> fwsectors: 63
> last: 1000215182
> first: 34
> entries: 128
> scheme: GPT
> Providers:
> 1. Name: nda0p1
>   Mediasize: 272629760 (260M)
>   Sectorsize: 512
>   Stripesize: 0
>   Stripeoffset: 1048576
>   Mode: r0w0e0
>   efimedia: HD(1,GPT,be8d2f98-9d0b-4887-b93d-5f8fa172a50f,0x800,0x82000)
>   rawuuid: be8d2f98-9d0b-4887-b93d-5f8fa172a50f
>   rawtype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
>   label: EFI system partition
>   length: 272629760
>   offset: 1048576
>   type: efi
>   index: 1
>   end: 534527
>   start: 2048
>   ...
> 
> Three things which are calling my attention:
> 
> - the size is 260M (and not 40M as in our Wiki explained)
> - the label is 'EFI system partition'
> - it is the first partition starting a 2048 and its 'index' is 1


For comparison, here is the start of my FreeBSD 14 system, originally installed via the BSD installer from FreeBSD 13:

# gpart list ada0
Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 1953525127
first: 40
entries: 128
scheme: GPT
Providers:
1. Name: ada0p1
   Mediasize: 272629760 (260M)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e2
   efimedia: HD(1,GPT,652a5d29-e2ab-11ed-83ed-ac87a33b749b,0x28,0x82000)
   rawuuid: 652a5d29-e2ab-11ed-83ed-ac87a33b749b
   rawtype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
   label: efiboot0
   length: 272629760
   offset: 20480
   type: efi
   index: 1
   end: 532519
   start: 40
   [[...]]


The EFI partition that resulted is at index 1, but starts at sector 40.  I believe I may have set the label manually, but don't remember exactly.  Like your example, the type is "efi" (rawtype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b).

Could be that an EFI partition type at index 1 is the winning combination, but I'll let someone with better understanding of UEFI rule on that. :-)


> I will by a new USB disk and start vom scratch and also with the above
> values.


I would also suggest that before trying that you just perform a standard install of FreeBSD onto the new USB disk and see whether the resulting partition table it lays down becomes visible to the new laptop.  That would be a method that's easily reproducible in the future.

Cheers,

Paul.