Last active
August 29, 2015 14:18
-
-
Save fourdollars/4a287fee05bd4717aaba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "=== Clear all EFI boot entries ===" | |
sudo apt-get --yes install efibootmgr | |
sudo efibootmgr -v | grep ^Boot[0-9A-F][0-9A-F][0-9A-F][0-9A-F] | cut -c 5-8 | while read boot; do | |
sudo efibootmgr -v -b $boot -B | |
done | |
sudo efibootmgr -O | |
sudo efibootmgr -v | |
echo "=== Clear all partitions ===" | |
for dev in mmcblk0p1 mmcblk0p2 mmcblk0p3 mmcblk0p4; do | |
if mount | grep $dev > /dev/null; then | |
sudo umount /dev/$dev | |
fi | |
done | |
sudo swapoff -a | |
sudo parted -s /dev/mmcblk0 rm 1 rm 2 rm 3 rm 4 | |
sudo parted -s /dev/mmcblk0 print |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment