Hi, FreeBSD makes a bit complicated to dual boot an UEFI install when using the bsdinstall partition tool. Even though you don't modify the EFI partition (if already existing) FreeBSD will format it and therefore losing all your previous systems EFI loaders. The script should not format the EFI partition and use it if already existing or propose the user to create one if not found. Steps to reproduce: 1. Install any operating system that is not FreeBSD with a EFI partition 2. Boot FreeBSD installer 3. Create a freebsd-ufs partition (do not use auto partitioning!) 4. Install will format the EFI partition and you lose all your data on it.
13-Current not format too bsdinstall script, work 2019 PARTITIONS="$DISKSLICE GPT { 512K freebsd-boot, 1M efi, auto freebsd-ufs / } #!/bin/sh -x # Make diskname independante gpart modify -l freebsd-boot -i 1 ada0 gpart modify -l efi -i 2 ada0 gpart modify -l root -i 3 ada0 # Make EFI happy mount_msdosfs /dev/gpt/efi /media/ mkdir -p /media/EFI/BOOT/ cp /boot/loader.efi /media/EFI/BOOT/BOOTX86.efi umount /media/ FreeBSD-13.0-CURRENT-amd64-20200206-r357606-disc1.iso not format efi partition
(In reply to David Demelier from comment #0) sorry, misunderstand you bug
Yes we shouldn't format an existing EFI partition.
(In reply to Andrey Fesenko from comment #1) I've tried to check the 12.1 version code in bsdinstall but could not find that part. I've only tried in 12.1 though. Has it changed in 13-CURRENT? I'll give a try to make sure.
I tested this with FreeBSD 13.2, albeit with two FreeBSD installs on separate partitions. I was asked whether to reinstall the FreeBSD EFI loader, I said no, and the EFI partition was not reformatted. Maybe this is fixed now. I don't think I have a good test with a non-FreeBSD OS, but I'm open to suggestions.