From owner-freebsd-questions@freebsd.org Tue May 12 13:55:40 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 E6A642F0603 for ; Tue, 12 May 2020 13:55:40 +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 49Lzpg5d5bz4H6g for ; Tue, 12 May 2020 13:55:39 +0000 (UTC) (envelope-from per@hedeland.org) Received: from localhost (localhost [127.0.0.1]) by mailout.easydns.com (Postfix) with ESMTP id CD9D6C25F5; Tue, 12 May 2020 13:55:38 +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 nFIvZPIPR8G2; Tue, 12 May 2020 13:55:38 +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 29A31C226C; Tue, 12 May 2020 13:55:36 +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 04CDtYPO061070 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 12 May 2020 15:55:34 +0200 (CEST) (envelope-from per@hedeland.org) Subject: Re: Trivially solved - Dual booting Windows 10 and FREEBSD 12.1-R on an ASUS UEFI laptop To: salvatorembartolotta@libero.it Cc: freebsd-questions@freebsd.org References: <1117249472.400830.1589220133531@mail1.libero.it> <1560477469.422170.1589267163580@mail1.libero.it> <1644337982.433672.1589285861644@mail1.libero.it> From: Per Hedeland Message-ID: <2662d005-fa4e-e8bb-49db-ed96cde04b22@hedeland.org> Date: Tue, 12 May 2020 15:55:34 +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: <1644337982.433672.1589285861644@mail1.libero.it> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49Lzpg5d5bz4H6g 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.59 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[209.157.228.81.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-0.19)[-0.195,0]; IP_SCORE(0.19)[ip: (0.21), ipnet: 64.68.200.0/22(-0.40), asn: 16686(1.22), country: CA(-0.09)]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[hedeland.org]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-0.21)[-0.208,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[libero.it]; RCVD_IN_DNSWL_LOW(-0.10)[10.202.68.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16686, ipnet:64.68.200.0/22, country:CA]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[] 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, 12 May 2020 13:55:41 -0000 On 2020-05-12 14:17, salvatorembartolotta@libero.it wrote: > >> Il 12 maggio 2020 alle 9.06 Salvatore Bartolotta via freebsd-questions ha scritto: >> >> >>> Il 12 maggio 2020 alle 0.17 Per Hedeland ha scritto: >>> >>> On 2020-05-11 20:02, Salvatore Bartolotta via freebsd-questions wrote:> Good afternoon (in the U.S.A.), >>>> I installed 12.1-R on an Asus laptop - well, almost. The partition editor, apparently, didn't see the 260MB EFI partition and wanted to create a _second_ EFI partition, in the middle of the disk,right before the rootfs (monted on /), what made little sense to me. I said "no", making the system, for the time being, unbootable. The installation completed except for that step. >>> I noticed that too, and did the same, but it didn't result in anunbootable system since I had the EFI partition already set up from anearlier install (which I don't recall wanting to create an EFIpartition, but I may be wrong about that)... >>>> nvd0 GPT layout:nvd0p1 260 MB EFI partitionnvd0p2 16MB M$ reserved partitionnvd0p3 256GB M$ system and data partitionnvd0p4 512KB freebsd-bootnvd0p5 2GB rootfs, mounted on /)nvd0p6 80 GB swap (on a 32GB RAM system, maybe overkill)nvd0p7 26GB varfs, mounted on /varnvd0p8 14GB tmpfs, mounted on /tmp, may be ovewrkill as wellnvd0p9 134GB usrfs, mounted on /usr....nvd0lastpartition 650MB M$ Recovery partition >>>> I hope there is some simple way to complete this FreeBSD installation, by adding the appropriate booting code to the _existing_ EFI partition. >>> It seems you also have a Windows installation - do you want to be ableto dual-boot? Otherwise I think you can find the info you need in theuefi(8) man page. AFAIR it pretty much amounts to "somehow"mount_msdosfs-mounting the EFI partition and copying /boot/boot1.efifrom the FreeBSD installation to /EFI/BOOT/BOOTX64.EFI(case-independent I believe, I actually have /EFI/Boot/bootx64.efi).Should be doable from either of the or (if present)choices in the installer. >>> --Per Hedeland >> >> >> Good night, >> >> I'd like to be able to dual-boot for the time being - multi-boot, at the end of the day. The live CD is certainly my friend, I am just not sure how I am supposed to do it. Should I install some UEFI shell/utility/... in the EFI nvd0p1 partition in order to manage the FreeBSD and Windows booting code, then install/point to the actual FreeBSD (and Windows) booting code (not /boot/boot1.efi, I suppose) ? Has anybody done anything like that? This is kind of moot considering what you write below, but since I already had written it when I saw your message, I guess I'll post it anyway - maybe it's useful to someone else. I do have a Windows/FreeBSD dual-boot setup on my laptop, and for any dual/multi-booting, I believe(d) you need a 3rd-party boot manager - and the subject is perhaps a bit too much to go into the details of here, but googling will find quite a few recipes. Most of them seem to be using either grub or rEFInd, I ended up using the latter and doing most of the setup from the Windows side. Googling now, I found a good summary (though not a recipe) at https://forums.freebsd.org/threads/dual-booting-windows-10-alongside-freebsd-11-0-release.59427/#post-341619 (it actually says that you *may* *not* need a 3rd-party boot manager...). Anyway, this is the contents of my EFI partition, originally created by the Windows installation: $ ls /mnt/EFI Boot Microsoft $ ls /mnt/EFI/Boot bootx64-freebsd.efi bootx64.efi refind.conf bootx64-windows-10.efi icons refind.conf.ORIG $ tail /mnt/EFI/Boot/refind.conf menuentry "FreeBSD" { loader \EFI\Boot\bootx64-freebsd.efi icon \EFI\Boot\icons\os_freebsd.png } menuentry "Windows 10" { loader \EFI\Boot\bootx64-windows-10.efi icon \EFI\Boot\icons\os_win.png } Here bootx64.efi is rEFInd, bootx64-freebsd.efi is a copy of /boot/boot1.efi from FreeBSD, and bootx64-windows-10.efi is (of course) the Windows loader, originally named bootx64.efi. AFAIR, this setup was all done from the FreeBSD Live CD. There was a bit more to getting it to work though - I had to create a boot entry for rEFInd (and occasionally have to re-create it), unclear why, using a Windows tool called EasyUEFI - there may be others. >> In the past, I had used some pay$$ware on BIOS (not EFI) machines, sure, but I'd like to be able to do everything - except for the necessary evil, the M$ Windows OS and some of its $program$ - open-source minded. The rEFInd boot manager is open source, as is grub of course - EasyUEFI is not AFAIK, but at least the version I used was free as in beer. > Good morning, > > the solution seems to be trivial: > > 1) Boot from FreeBSD live CD > 2) Mount_msdosfs the GPT EFI partition (e.g. on /mnt) > 3) copy (cp -i) /boot/boo1.efi from the live CD to the EFI partition, to e.g. /mnt/EFI/Boot > 4) Reboot the machine, access UEFI and create the FreeBSD entry - e.g. path /EFI/Boot/boot1.efi > > YMMV and at boot time, pressing the appropriate key (e.g. Esc) lets you select which OS to boot. > > Googling has brought me a number of long and complicated discussions and recipes on various system configurations and some confusion as well; reading _1_ minute the relevant UEFI(8) man page has brought me the solution (!). Shame on me... > > Maybe someone with docs commit access could put or rather rewrite this "solution" somewhere in the documentation (/FAQs?/handbook?/...), with some frills added (/grub/... configuration?). Great that you found such a straightforward solution! I suspect the complexity of the solution to a great degree depends on the quality of the "UEFI firmware", as discussed in the forum post I linked to above. At least with my laptop (Lenovo ideapad 320), I don't see any "builtin" opportunity to "access UEFI and create the FreeBSD entry", I had to use the EasyUEFI tool for that. And while I probably could have managed with *only* creating a "FreeBSD entry" instead of using rEFInd as boot manager, it's kind of nice to always get presented with a selection (with a timeout for the reply) and not having to remember to (on my laptop) repeatedly hit F12 in order to enter the "firmware boot manager" - but of course that's a matter of taste and usage patterns. --Per