From owner-freebsd-questions@freebsd.org Sun Mar 29 20:19:28 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A78F2617D8 for ; Sun, 29 Mar 2020 20:19:28 +0000 (UTC) (envelope-from bch@online.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48r6Pc2Tz9z4TFL for ; Sun, 29 Mar 2020 20:19:15 +0000 (UTC) (envelope-from bch@online.de) Received: from x230a1 ([84.189.156.132]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M3UlW-1jJCY736zy-000aci for ; Sun, 29 Mar 2020 22:14:01 +0200 From: Christian Barthel To: freebsd-questions@freebsd.org Subject: Convert to EFI boot loader Date: Sun, 29 Mar 2020 22:14:00 +0200 Message-ID: <87v9mmrkaf.fsf@barthel.ch> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:rA0J7gzNbgNj6uBBp5wcjY/qCfzQx/11ZGRe07lmlnHX1puIAto YOC3xHKZ1lEquS+7MD0n3A8XYoXjqJz6By3jWq5DYyL0c91EKGrEHTVpKz1UDvPojMpm36E Scap6sIkK/b4WAlH4bvIHZ8v9CksA2v4CgopTUrK6TvpF/KN+DkbuFqosUPndcf+edrqq2O uGTn64Qjrjy02aSHEZQNg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:0/tsX0s1V5c=:ZuzOaXLyp5LqozU5dfYZaE 1/dWW/+Ry6kT4a419QGv8zEHFt5KU35qbbpfolzZUXwgmd5gyKBIngmGYWwqpl9X4xmQNpJr4 KcygmLgAgFuvQy82z4OkphBSla9YZf1s/zwolaCONG9Qm223UpH+8CBh9KBIqwR8d+SdYsd8H 3O4Po1Z4ogAXOLOBNeXvD/K5KO+S6YPTuTzxTbYVX85jYX1OWkU0kXyctiTbGjTeq4nZT/ueP zRbIfeamjMDWCmKRGiM8qA9GmVLk8kwgvpGxEskWfwkdFEa3OtSAemv6CA6GGt9HJTccPR/T6 DLqf/LRs67dDXaiF9W+G6HaOXdGYUVwrJVYxkQsA88m605Rb1IkeQrkKAQXgm3MzWtNRjBzLI ayyEpo39lPqgqIe82aLH7v55NrGGg+kI6zjuOJ5PjcxXOIJILgwwRgBcutDEGXAvEmW+68c72 f2gDbXGTna2XtJeCYFqJwBAdAAZdGMDPzrAnudiCeRRYU8+39FfatWgn/KSrHY8jguMT/rO35 yeHObWLy6oa80+ohrnORXsrHm3SfkQP5rF8C74wis1bjqrbHp3L/dWtk+U6L8cQa2LH1CACTX zINtuIdKB6KHrP2yBX63gpYseY1FL2XEBmZrhzmfOzYIDeNfVREzmY4RRny88t5oJyr+KPTJe 3b1emUGLrre9h6rGgjfn5xezqM3XtDJDzBKbz0GpgkreBEaz5RXMNM66I9F1GKGKStnhGbyn5 5IPBZyJOQ3ISz8V/E7b1/VWpiAjMegmG98m5zsWoxLo9I+15zFhHaWm7VLhQECrhRvyyB/R8P yRoG3ayUOJA9Bm7kfxg/ni2ceN8nGwaRveVYmshhSj+95abN3w= X-Rspamd-Queue-Id: 48r6Pc2Tz9z4TFL X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of bch@online.de designates 212.227.126.130 as permitted sender) smtp.mailfrom=bch@online.de X-Spamd-Result: default: False [0.29 / 15.00]; ARC_NA(0.00)[]; SUBJECT_ENDS_SPACES(0.50)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:212.227.126.128/25]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[online.de]; NEURAL_SPAM_LONG(0.05)[0.047,0]; RCVD_IN_DNSWL_NONE(0.00)[130.126.227.212.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-0.56)[-0.556,0]; IP_SCORE(0.60)[ip: (1.96), ipnet: 212.227.0.0/16(-1.11), asn: 8560(2.16), country: DE(-0.02)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[132.156.189.84.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2020 20:19:28 -0000 Hello I'd like to convert an existing FreeBSD 12.1 installation (that is using GPT / freebsd-boot / encrypted ZFS) to EFI (the reason for this is that I want to plug the disk into a ThinkPad X230 instead of a ThinkPad X201). The former layout on the X201 notebook using the legacy freebsd-boot partition looks like: 40 7814037088 ada0 GPT (3.6T) 40 1024 1 freebsd-boot (512K) 1064 984 - free - (492K) 2048 16777216 2 freebsd-swap (8.0G) 16779264 7797256192 3 freebsd-zfs (3.6T) 7814035456 1672 - free - (836K) I then adapted this layout with the commands: gpart delete -i 1 ada0 gpart delete -i 2 ada0 gpart add -b 40 -s 409600 -t efi ada0 gpart add -b 409640 -s 1024 -t freebsd-boot ada0 gpart add -b 411648 -s 7G -t freebsd-swap ada0 The current layout looks like this: $ sudo gpart show /dev/ada0 => 40 7814037088 ada0 GPT (3.6T) 40 409600 1 efi (200M) 409640 1024 2 freebsd-boot (512K) 410664 984 - free - (492K) 411648 16777216 3 freebsd-swap (8.0G) 17188864 7796846592 4 freebsd-zfs (3.6T) 7814035456 1672 - free - (836K) I then did the above commands to install the bootloader: gpart bootcode -p /boot/boot1.efifat -i 1 ada0 (*) gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada0 I can mount ada0p1 and see the efi/boot/BOOTx64.efi loader. But when I am trying to start the system on the X230, it's not working: pressing on the Lenovo X230 and selecting the disk does not boot the system. It tries a different source afterwards. Am I missing something? Additional observations: Interestingly enough, the disk still boots on the X201 (maybe due to the legacy freebsd-boot loader at index 2?). The X230 BIOS option is set to "UEFI Only". I tested "Legacy" and "Both" as well. With the "Legacy" option being selected, I get the message that "No gptzfsboot loader found" (or something similar to this). Instead of using the above (*) gpart(1) command, I also tried dd if=/boot/boot1.efifat of=/devada0p1 but there was no visible change to the gpart(1) command. I discovered a similar article at [1] and the author is doing almost the same. [1] https://ashish.blog/2018/06/freebsd-uefi-boot/ -- Christian Barthel