Date: Fri, 30 Mar 2018 23:07:16 +0200 From: Harry Schmalzbauer <freebsd@omnilan.de> To: "Alex V. Petrov" <alexvpetrov@gmail.com> Cc: freebsd-fs@freebsd.org Subject: Re: Need help for stupid: restotre efi boot Message-ID: <5ABEA704.9050004@omnilan.de> In-Reply-To: <a96155db-7baf-6973-cf07-10270bc5bcbe@gmail.com> References: <a564c366-ae98-bbdd-3d3c-3047edddb350@gmail.com> <5ABE7ECC.9070109@omnilan.de> <a96155db-7baf-6973-cf07-10270bc5bcbe@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Bezüglich Alex V. Petrov's Nachricht vom 30.03.2018 22:53 (localtime): > 31.03.2018 01:15, Harry Schmalzbauer пишет: >> Bezüglich Alex V. Petrov's Nachricht vom 29.03.2018 22:26 (localtime): >>> How restore efi boot, after command: >>> gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0 >> >> Hmm, I'm not sure I understand your problem, but I guess ada0p1 might >> have been your "efi" partition before you corrupted it with the command >> you quoted. >> If so, just do: >> newfs_msdos /dev/ada0p1 >> mount_msdosfs /dev/ada0p1 /mnt >> mkdir -p /mnt/EFI/BOOT >> cp /boot/boot1.efi /mnt/EFI/BOOT/BOOTx64.efi >> echo "BOOTx64.efi" > /mnt/EFI/BOOT/startup.nsh >> >> The latter is optinal for most UEFI implementations, likewise is the >> partition type (which should be "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" >> – gpart knows it under the alias "efi"). >> I'd suggest you check with "gaprt show ada0" and "gpart modify -t efi -i >> 1 ada0" before the newfs! >> >> Hope this helps, >> >> -harry > > > Thanks for the answer. > For me, the solution was: > dd if=/boot/boot1.efifat of=/dev/ada0p1 mount_msdosfs -o ro /dev/`mdconfig -a -t vnode -o readonly -f /boot/boot1.efifat` /mnt ls -lR /mnt/ The result is essentially the same. But the pre-imaged /boot/boot1.efifat most likely doesn't match your partition size. Not a real problem, but I always prefere the clean way – and for understanding. Likewise this post-note is meant for anybody else who stumbles across this thread and isn't ware about /boot/loader1.efifat. -harry
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5ABEA704.9050004>