From owner-freebsd-questions@freebsd.org Tue May 26 21:30:55 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 D9D9D2F46A4 for ; Tue, 26 May 2020 21:30:55 +0000 (UTC) (envelope-from per@hedeland.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 49WnFW3tJPz40DT for ; Tue, 26 May 2020 21:30:55 +0000 (UTC) (envelope-from per@hedeland.org) Received: by mailman.nyi.freebsd.org (Postfix) id 84FFB2F46A3; Tue, 26 May 2020 21:30:55 +0000 (UTC) Delivered-To: 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 83BA22F481F for ; Tue, 26 May 2020 21:30:55 +0000 (UTC) (envelope-from per@hedeland.org) Received: from mailout.easydns.com (mailout.easydns.com [64.68.202.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49WnFV2LpBz405H for ; Tue, 26 May 2020 21:30:54 +0000 (UTC) (envelope-from per@hedeland.org) Received: from localhost (localhost [127.0.0.1]) by mailout.easydns.com (Postfix) with ESMTP id 2E43DC09DB; Tue, 26 May 2020 21:30:53 +0000 (UTC) Received: from mailout.easydns.com ([127.0.0.1]) by localhost (emo12-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yiQnDhnMExT1; Tue, 26 May 2020 21:30:53 +0000 (UTC) Received: from hedeland.org (81-228-157-209-no289.tbcn.telia.com [81.228.157.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easydns.com (Postfix) with ESMTPSA id 9E525C09C8; Tue, 26 May 2020 21:30:49 +0000 (UTC) Received: from pluto.hedeland.org (pluto.hedeland.org [10.1.1.5]) by tellus.hedeland.org (8.15.2/8.15.2) with ESMTPS id 04QLUlAj016754 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 26 May 2020 23:30:48 +0200 (CEST) (envelope-from per@hedeland.org) Subject: Re: rEFInd and _two_ FREEBSD systems on the same disk on the same UEFI laptop To: salvatorembartolotta@libero.it References: <1590634251.1341132.1590515827296@mail1.libero.it> Cc: questions@freebsd.org From: Per Hedeland Message-ID: Date: Tue, 26 May 2020 23:30:47 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <1590634251.1341132.1590515827296@mail1.libero.it> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49WnFV2LpBz405H X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of per@hedeland.org has no SPF policy when checking 64.68.202.10) smtp.mailfrom=per@hedeland.org X-Spamd-Result: default: False [-0.80 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[81.228.157.209:received]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.978]; NEURAL_HAM_LONG(-0.73)[-0.728]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[hedeland.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_SHORT(0.11)[0.106]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[libero.it]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16686, ipnet:64.68.200.0/22, country:CA]; RCVD_TLS_LAST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[64.68.202.10:from] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2020 21:30:55 -0000 On 2020-05-26 19:57, Salvatore Bartolotta via freebsd-questions wrote: > > Has anyone installed two BSD (say -RELEASE and -STABLE) on the same disk on the same UEFI machine using rEFInd? Yes - I routinely have two different -RELEASE installs, and "upgrade" by replacing the older one. Allows for quick switch-back when the new version is b0rken, as well as easily finding the config tweaks that I had forgotten when upgrading (since the complete previous version is still available - and mounted). > Setting up dual booting - Windows 10 and FreeBSD-whatever - via rEFInd is just a matter of bcdediting a path and copying the appropriate .efi files. (duh). > > The /boot/boot1.efi copied in \EFI\FreeBSD-STABLE does its job and loads the _first_ FreeBSD system, as says uefi(8). What if I want to boot _another_ FreeBSD system on the _same_ GPT-partitioned disk? The solution I use can also be found in uefi(8), but it's really ugly - if anyone knows of a cleaner way, I'd be happy to learn about it. Anyway, uefi(8) says: 3. boot1.efi searches partitions of type freebsd-ufs and freebsd-zfs for loader.efi. [...] I.e. you can control which partition/install gets booted by making sure that it's the only one that has a loader.efi file. So: $ df Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/ada0p7 25389052 11405824 11952104 49% / devfs 1 1 0 100% /dev /dev/ada0p6 25389052 22339544 1018384 96% /oldroot /dev/ada0p9 127953980 67120872 50596792 57% /local fdescfs 1 1 0 100% /dev/fd procfs 4 4 0 100% /proc $ ls {/oldroot,}/boot/loader.efi* /boot/loader.efi /oldroot/boot/loader.efi.dontuse Switching amounts to # mv /oldroot/boot/loader.efi.dontuse /oldroot/boot/loader.efi # mv /boot/loader.efi /boot/loader.efi.dontuse # reboot (You can get away with using .dontuse on only one of them if you trust that the search order will always be the same, and you can remember what it is.) I *said* it was ugly...:-) I haven't looked into any of the stuff you discuss below (which seems nice) - my (quite possibly incorrect) understanding is that FreeBSD's boot1.efi has to be loaded from the "EFI system partition", meaning that e.g. rEFInd is out of the picture for selection between FreeBSD partitions/installs. --Per > Specifying the GUID of the partition in the menuentry stanza i.e. > ... > volume GPTGUID > loader boot/boot1.efi > .... > > isn't enough and does not work(TM). > > I suppose rEFInd_x64.efi can't access the second system without an appropriate ufs driver. There are, indeed, drivers for linux filesystems (ext2, ext4, etc.) in the rEFInd directory. And FreeBSD? > > How am I supposed to solve the problem _within_ FreeBSD with rEFInd? > > My apologies for the crazy/mad question and many thanks in advance for your help, pointers, suggestions.