Skip to content

Micky1979/findesp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

findesp

Command Line to find the associated EFI System Partition from a given disk object or mount point

Usage

findesp /

or

findesp /dev/disk04s3

or

findesp disk05s2

or

findesp disk2

It returns the BSD Name of the ESP like "disk0s1"

Also support finding associated ESP of the phisycal disk of any apfs container/apfs partition, corestorage/file vault and so on.

I made this script for Clover Bootloader/Chameleon/Enoch if devs are intrested, may be used in the installer.

How to build it from command line

cd /folder/containing/findesp/findesp.xcodeproj
xcodebuild -project findesp.xcodeproj -alltargets -configuration Release

...binary should be found at ../findesp/build/Release/

How to use in a script

Bashers can found easy to check for the output this way:

#!/bin/bash
disk="disk2" # suppose is an apfs container

esp=`findesp $disk`

if [[ -n $esp ]] && [[ $esp == disk* ]] ; then
  echo "EFI System Partition for $disk is $esp"
else
  echo "ESP not found.."
fi

About

Command Line to find the associated EFI System Partition for a given disk object or mount point

Resources

License

Stars

Watchers

Forks

Packages

No packages published