- Joined
- Aug 28, 2020
- Messages
- 21
With hackintoshing requiring regular updates to OpenCore on the EFI partition, I became frustrated at needing to manually mount EFI each time, either via the terminal, or using Clover etc.
Given macOS no longer uses fstab, or at least fiddles with it through automounter, I found it surprisingly difficult to automount the EFI partition. Lots of web sites tell you how to stop a drive automounting, but that's the opposite of what I wanted. So:
BEST METHOD (IMHO):
1. Create the following script using textedit or similar, and save as 'mount-EFI.sh'. Make it executable with chmod +x.
where partition-UUID is the EFI partition's UUID.
2. Create the following plist, again using TextEdit or similar:
Where "/Users/username/mount-EFI.sh" refers to the location of your script in Step 1.
Ensure the shell script 'mount-EFI.sh' created in step 1 is located at the path specified e.g. /Users/username/mount-EFI.sh
3. Save the plist as 'com.user.mount-EFI.plist'
4. Place 'com.user.mount-EFI.plist' in ~/Library/LaunchAgents
5. Edit the sudoers file to allow your user to mount using diskutil without requiring a password:
a. run the following terminal command: sudo visudo
b. add the following to your sudoers file: username ALL = (ALL) NOPASSWD: /usr/sbin/diskutil
c. save and exit your sudoers file
ALTERNATIVE (uses the Automator Application):
1. Create the mount-EFI.sh as above
2. Use Automator Application to create an app called 'mount-EFI.app' or similar, which runs the mount-EFI.sh script
2. Launch “mount-EFI.app” as a startup item for any user you wish
3. Make sure your sudoers file is edited as above
NOTE: this will allow you to run 'sudo diskutil' in a terminal without needing a password. There is likely to be a workaround for this if you are concerned!
Given macOS no longer uses fstab, or at least fiddles with it through automounter, I found it surprisingly difficult to automount the EFI partition. Lots of web sites tell you how to stop a drive automounting, but that's the opposite of what I wanted. So:
BEST METHOD (IMHO):
1. Create the following script using textedit or similar, and save as 'mount-EFI.sh'. Make it executable with chmod +x.
#!/bin/sh sudo diskutil mount -mountPoint /System/Volumes/Data/EFI/partition-UUID |
where partition-UUID is the EFI partition's UUID.
2. Create the following plist, again using TextEdit or similar:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.user.loginscript</string> <key>ProgramArguments</key> <array><string>/Users/username/mount-EFI.sh</string></array> <key>RunAtLoad</key> <true/> </dict> </plist> |
Where "/Users/username/mount-EFI.sh" refers to the location of your script in Step 1.
Ensure the shell script 'mount-EFI.sh' created in step 1 is located at the path specified e.g. /Users/username/mount-EFI.sh
3. Save the plist as 'com.user.mount-EFI.plist'
4. Place 'com.user.mount-EFI.plist' in ~/Library/LaunchAgents
5. Edit the sudoers file to allow your user to mount using diskutil without requiring a password:
a. run the following terminal command: sudo visudo
b. add the following to your sudoers file: username ALL = (ALL) NOPASSWD: /usr/sbin/diskutil
c. save and exit your sudoers file
ALTERNATIVE (uses the Automator Application):
1. Create the mount-EFI.sh as above
2. Use Automator Application to create an app called 'mount-EFI.app' or similar, which runs the mount-EFI.sh script
2. Launch “mount-EFI.app” as a startup item for any user you wish
3. Make sure your sudoers file is edited as above
NOTE: this will allow you to run 'sudo diskutil' in a terminal without needing a password. There is likely to be a workaround for this if you are concerned!
Last edited: