Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Oct 2019 08:53:00 -0400
From:      mike tancsa <mike@sentex.net>
To:        Victor Sudakov <vas@sibptus.ru>, freebsd-questions@freebsd.org
Subject:   Re: replacing zfs disk (freebsd-boot vs freebsd-efi)
Message-ID:  <c2bb2150-586f-cd40-ff28-ce4def01d200@sentex.net>
In-Reply-To: <20191030085329.GA77044@admin.sibptus.ru>
References:  <5bf91c8b-a101-a174-a08b-cda42a43a0b5@sentex.net> <20191030085329.GA77044@admin.sibptus.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/30/2019 4:53 AM, Victor Sudakov wrote:
> mike tancsa wrote:
>> 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 ?
> May I suggest that if it's really a UEFI system, you probably don't need
> the freebsd-boot partition at all, nor any boot blocks or {P,M,V}BRs.
>
Thanks for the confirmation and explanation.  I wonder if an added note
after a re-sliver would be a good idea

--- zpool_main.c.orig   2019-10-30 08:44:12.688304000 -0400
+++ zpool_main.c        2019-10-30 08:49:40.292540000 -0400
@@ -5856,6 +5856,8 @@
                    "the following command will do it:\n"
                    "\n"
                    "\tgpart bootcode -b /boot/pmbr -p /boot/gptzfsboot
-i 1 da0\n\n",
+                   "\tor for EFI\n\n",
+                   "\tgpart bootcode -p /boot/boot1.efifat -i 1 da0\n\n",
                    cb.cb_poolname);
        }
 


> gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada0
> The above ^^^^^ should be unnecessary. Your UEFI firmware will find the
> partition of the "efi" type and try to load /EFI/BOOT/BOOTX64.EFI from
> there, which in turn will sniff your ZFS filesystems for the loader.

I think FreeBSD's install added it by default. I wonder if that was done
to make the disks portable between EFI and non EFI systems ? I will have
to test to see if thats the case.

    ---Mike





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c2bb2150-586f-cd40-ff28-ce4def01d200>