Skip to content

Instantly share code, notes, and snippets.

@enkunkun
Last active January 10, 2020 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enkunkun/690730f3df36c6248ab19315b1fbc73d to your computer and use it in GitHub Desktop.
Save enkunkun/690730f3df36c6248ab19315b1fbc73d to your computer and use it in GitHub Desktop.
Mount swapfile when booting from external storage (see: https://discussionsjapan.apple.com/thread/110201665 )
#!/bin/bash
sudo mv com.example.mountswap.plist /Library/LaunchAgents
sudo chown root:wheel /Library/LaunchAgents/com.example.mountswap.plist
sudo launchctl load com.example.mountswap.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.example.mountswap</string>
<key>ProgramArguments</key>
<array>
<string>diskutil</string>
<string>mount</string>
<string>-mountPoint</string>
<string>/private/var/vm</string>
<string>disk3s4</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment