Sergey_Galan Posted February 9, 2025 Share Posted February 9, 2025 (edited) I would like to provide my own version of opening the EFI section, which I have been using for a long time. How it differs from others: This is a button, in one click you can open and close the EFI section that you previously entered into the script. You will also have to enter the administrator password into the script (if you are afraid of this, do not use it). #!/bin/bash # OpenEFI # By Sergey_Galan (Serhii Halaniuk) # Copyright (c) 2018-2025, Sergey_Galan (Serhii Halaniuk). All Right Reserved ####################### pass=1234 name='Macintosh HD' ####################### Incorrect_password () { echo "ALERT:Incorrect password|" exit 1 } # All Volume EFI force-unmounted mountPoint=/Volumes/"$name" if [[ -e /Volumes/EFI ]]; then echo "$pass" | sudo -S echo "Ok" || Incorrect_password for efi in /Volumes/EFI*; do if [[ -e "$efi" ]]; then echo "NOTIFICATION: $(sudo -S umount -fv "$efi")" fi sleep 0.5 done # Volume EFI mounting # HFS elif diskutil list | grep -m 1 "$name" | grep "Apple_HFS"; then part=$(diskutil info "$mountPoint" | grep "Device Node:" | awk '{print $3}') disk=$(printf $part | sed 's/s[0-9]*$//') disk="$disk"s1 echo "$pass" | sudo -S echo "Ok" || Incorrect_password sudo -S umount -f $disk >/dev/null 2>/dev/null sudo -S fsck_msdos -fy $disk >/dev/null 2>/dev/null sudo -S diskutil mount $disk || sudo -S diskutil mount $disk && echo "NOTIFICATION: Volume EFI on $disk mounted" # APFS elif diskutil list | grep -m 1 "$name" | grep "APFS Volume"; then part=$(diskutil info "$mountPoint" | grep "APFS Physical Store:" | awk '{print $4}') part=/dev/"$part" disk=$(printf $part | sed 's/s[0-9]*$//') disk="$disk"s1 echo "$pass" | sudo -S echo "Ok" || Incorrect_password sudo -S umount -f $disk >/dev/null 2>/dev/null sudo -S fsck_msdos -fy $disk >/dev/null 2>/dev/null sudo -S diskutil mount $disk || sudo -S diskutil mount $disk && echo "NOTIFICATION: Volume EFI on $disk mounted" fi exit You must replace the pass value with your administrator password. pass=1234 Replace Macintosh HD with the name of the disk partition with the EFI partition you want to open (leave the quotes alone). name='Macintosh HD' For editing, the script is located here: Watch the video of me using the button Screen Recording 2025-02-09 at 12.54.11.mp4 OpenEFI.zip Edited October 25, 2025 by Sergey_Galan 2 3 Link to comment https://www.insanelymac.com/forum/topic/360650-openefi-button-to-open-the-efi-system-partition-esp/ Share on other sites More sharing options...
STLVNUB Posted June 24, 2025 Share Posted June 24, 2025 Why Not Create A Small Fat32 Partition At The Beginning Of The SSD No More Mucking Around With Stupid ESP 1 Link to comment https://www.insanelymac.com/forum/topic/360650-openefi-button-to-open-the-efi-system-partition-esp/#findComment-2834899 Share on other sites More sharing options...
Recommended Posts