"Critical software update required for your Mac" loop after erasing EFI partition

So I accidentally erased the EFI partition when I was trying to erase my usb and im now stuck in a "Critical software update required for your Mac" loop, Ive already tried: resetting nvram and pram, reinstalling macOS big sur from recovery mode, using a mobile hotspot and updating in safe boot but none of them worked, what can I still do to solve this problem?

I also cannot wipe my disk.

diskutil list internal:

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:       Microsoft Basic Data EFI                     313.5 MB   disk0s1
   2:                 Apple_APFS Container disk1         500.0 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +500.0 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD - Data     369.1 GB   disk1s1
   2:                APFS Volume Preboot                 503.7 MB   disk1s2
   3:                APFS Volume Recovery                622.1 MB   disk1s3
   4:                APFS Volume VM                      1.1 GB     disk1s4
   5:                APFS Volume Macintosh HD            15.3 GB    disk1s5
   6:              APFS Snapshot com.apple.os.update-... 15.3 GB    disk1s5s1

I finally got a disk to back up the mac and I was able to clean install big sur and that solved it. Thanks for the help!


Solution 1:

Why not boot to internet recovery and reinstall the current OS to let the installer write a good system and migrate your existing apps and data back in place.

I would probably get a good backup, since at some point you’ll need to wipe your disk, but the steps above do not intentionally break things or delete data. The worst that will happen is you have your data intact and render the Mac unbootable. Unless there is hardware failure or the filesystem is also damaged, no real risk is added by reinstalling the OS.

Solution 2:

If you can boot from an Ubuntu live flash drive, then you can use the gdisk command to change the partition type from 0700 back to EF00. If necessary, you can then format the partition using the mkfs.vfat command.

Example steps are given below.

  1. Boot from Ubuntu installer flash drive to a live version of Ubuntu.

  2. Open a Terminal window. (press control-option-T)

  3. Enter the command lsblk to get the name of the internal disk. In this example, the name is nvme0n1. Older Macs will probably have the name sda.

  4. Enter the commands below to change the partition type back to EFI.

    sudo gdisk /dev/nvme0n1
    t
    1
    ef00
    w
    y
    
  5. FAT32 format the partition. Older Macs would probably use sda1 in place of nvme0n1p1.

    sudo mkfs.vfat -F 32 -n EFI /dev/nvme0n1p1
    
  6. Enter the exit command to close the Terminal window.

  7. Power off Ubuntu.