From nobody Tue Apr 02 17:24:56 2024 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8FBN45GJz5FKR1 for ; Tue, 2 Apr 2024 17:25:00 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8FBM4mYBz4htZ for ; Tue, 2 Apr 2024 17:24:59 +0000 (UTC) (envelope-from guru@unixarea.de) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of guru@unixarea.de designates 178.254.4.101 as permitted sender) smtp.mailfrom=guru@unixarea.de Received: from [62.216.203.3] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rrhsX-0024aR-En for freebsd-questions@freebsd.org; Tue, 02 Apr 2024 19:24:57 +0200 Received: from localhost.my.domain (c720-1400094 [127.0.0.1]) by localhost.unixarea.de (8.17.1/8.14.9) with ESMTP id 432HOvpK002697 for ; Tue, 2 Apr 2024 19:24:57 +0200 (CEST) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.17.1/8.14.9/Submit) id 432HOukM002696 for freebsd-questions@freebsd.org; Tue, 2 Apr 2024 19:24:56 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Tue, 2 Apr 2024 19:24:56 +0200 From: Matthias Apitz To: freebsd-questions@freebsd.org Subject: Re: changing ext. USB disk to UEFI boot Message-ID: Reply-To: Matthias Apitz Mail-Followup-To: freebsd-questions@freebsd.org References: List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: FreeBSD 14.0-CURRENT r1400094 (amd64) X-message-flag: Mails in HTML will not be read! Please, only plain text. X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 62.216.203.3 X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.80 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.997]; MID_RHS_NOT_FQDN(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:178.254.4.101]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; HAS_XAW(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[unixarea.de]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[guru@unixarea.de]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:42730, ipnet:178.254.0.0/19, country:DE]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; HAS_XOIP(0.00)[]; R_DKIM_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[] X-Rspamd-Queue-Id: 4V8FBM4mYBz4htZ Nonsense, my da0p1 is to small with 512K (and this on a disk of 1TB) :-( I will buy a new one... matthias El día martes, abril 02, 2024 a las 06:18:40p. m. +0200, Matthias Apitz escribió: > > I own (for many years) an external USB disk of 1TB to test new FreeBSD > versions on my laptops before installing the system from source to it's > hard disk. This external USB disk boots fine on all my amd64 laptops. > > A new acquired ASUS laptop now detects only UEFI boot devices. I'm > attaching below what the FreeBSD's Wiki says and what the current > 'gpart list da0' shows about the USB disk. > > How can I modify the partition da0p1 to UEFI without touching the already > installed da0p2? Is it enough to carry out the creation of the MS-DOS > file system in da0p1 and copy the boot loader /boot/loader.efi to it? > > Thanks > > > https://wiki.freebsd.org/UEFI > > Bootable UEFI memory stick or Hard Disk > > To test UEFI booting on a memory stick or a hard disk, > create a GPT partition table with a small EFI partition and the rest > of the space dedicated to a FreeBSD UFS partition: > > # gpart create -s gpt da0 > # gpart add -t efi -s 40M da0 > # gpart add -t freebsd-ufs da0 > # newfs_msdos -F 32 -c 1 /dev/da0p1 > # mount -t msdosfs /dev/da0p1 /mnt > # mkdir -p /mnt/EFI/BOOT > # cp /boot/loader.efi /mnt/EFI/BOOT/BOOTX64.efi > # umount /mnt > # newfs -U -L FreeBSD /dev/da0p2 > # ... > > Current state of the drive da0: > > # gpart list da0 > > Geom name: da0 > modified: false > state: OK > fwheads: 255 > fwsectors: 63 > last: 1953525127 > first: 40 > entries: 128 > scheme: GPT > Providers: > 1. Name: da0p1 > Mediasize: 524288 (512K) > Sectorsize: 512 > Stripesize: 4096 > Stripeoffset: 0 > Mode: r0w0e0 > efimedia: HD(1,GPT,a555f52a-90e5-11e9-a3c2-90489a929e43,0x28,0x400) > rawuuid: a555f52a-90e5-11e9-a3c2-90489a929e43 > rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f > label: extboot > length: 524288 > offset: 20480 > type: freebsd-boot > index: 1 > end: 1063 > start: 40 > 2. Name: da0p2 > Mediasize: 274877906944 (256G) > Sectorsize: 512 > Stripesize: 4096 > Stripeoffset: 0 > Mode: r0w0e0 > efimedia: HD(2,GPT,e1c1853d-90e5-11e9-a3c2-90489a929e43,0x800,0x20000000) > rawuuid: e1c1853d-90e5-11e9-a3c2-90489a929e43 > rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b > label: extrootfs > length: 274877906944 > offset: 1048576 > type: freebsd-ufs > index: 2 > end: 536872959 > start: 2048 > 3. Name: da0p3 > Mediasize: 2147483648 (2.0G) > Sectorsize: 512 > Stripesize: 4096 > Stripeoffset: 0 > Mode: r0w0e0 > efimedia: HD(3,GPT,0bf60f9c-958a-11e9-8b7f-90489a929e43,0x20000800,0x400000) > rawuuid: 0bf60f9c-958a-11e9-8b7f-90489a929e43 > rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b > label: extswap > length: 2147483648 > offset: 274878955520 > type: freebsd-swap > index: 3 > end: 541067263 > start: 536872960 > 4. Name: da0p4 > Mediasize: 723177701376 (674G) > Sectorsize: 512 > Stripesize: 4096 > Stripeoffset: 0 > Mode: r0w0e0 > efimedia: HD(4,GPT,1f6fb912-958a-11e9-8b7f-90489a929e43,0x20400800,0x54306000) > rawuuid: 1f6fb912-958a-11e9-8b7f-90489a929e43 > rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b > label: extbackupfs > length: 723177701376 > offset: 277026439168 > type: freebsd-ufs > index: 4 > end: 1953523711 > start: 541067264 > Consumers: > 1. Name: da0 > Mediasize: 1000204883968 (932G) > Sectorsize: 512 > Stripesize: 4096 > Stripeoffset: 0 > Mode: r0w0e0 > > > -- > Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 > Public GnuPG key: http://www.unixarea.de/key.pub > -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub