Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Oct 2019 10:17:40 -0400
From:      mike tancsa <mike@sentex.net>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   replacing zfs disk (freebsd-boot vs freebsd-efi)
Message-ID:  <5bf91c8b-a101-a174-a08b-cda42a43a0b5@sentex.net>

next in thread | raw e-mail | index | archive | help
In the past when replacing a disk in a zfs pool that I boot from, simply
doing

gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0

where
    p1 = freebsd-boot
    p2 = freebsd-swap
    p3 = freebsd-zfs


works just fine (ie. replacing ada0).  However, on this one box, I
noticed the disk has both freebsd-boot and efi

    p1 = efi
    p2 = freebsd-boot
    p3 = freebsd-swap
    p4 = freebsd-zfs


If I replace ada0, what do I need to do in order to full restore boot
functionality to the disk ?

gpart bootcode -b /boot/pmbr -p /boot/boot1.efifat -i 1 ada0
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada0

vs
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0

?

And is it boot1.efi or boot1.efifat ? I am guessing I also need the lable ?

gpart modify -l efiboot2 -i 1 ada0



e.g. current ada0 is

Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 976773127
first: 40
entries: 128
scheme: GPT
Providers:
1. Name: ada0p1
   Mediasize: 209715200 (200M)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 20480
   Mode: r0w0e0
   efimedia: HD(1,GPT,a1ffb215-ff5c-11e8-98c7-ac1f6b70b306,0x28,0x64000)
   rawuuid: a1ffb215-ff5c-11e8-98c7-ac1f6b70b306
   rawtype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
   label: efiboot0
   length: 209715200
   offset: 20480
   type: efi
   index: 1
   end: 409639
   start: 40
2. Name: ada0p2
   Mediasize: 524288 (512K)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 209735680
   Mode: r0w0e0
   efimedia: HD(2,GPT,a20b59f0-ff5c-11e8-98c7-ac1f6b70b306,0x64028,0x400)
   rawuuid: a20b59f0-ff5c-11e8-98c7-ac1f6b70b306
   rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
   label: gptboot0
   length: 524288
   offset: 209735680
   type: freebsd-boot
   index: 2
   end: 410663
   start: 409640




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5bf91c8b-a101-a174-a08b-cda42a43a0b5>