Created
June 28, 2017 11:01
-
-
Save phiros/4d2176e2e1ee9084fd39182a6448c837 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
#!/usr/bin/env bash | |
if [[ $UID != 0 ]]; then | |
echo "Must be run as root (Try: sudo ${0})" | |
exit 1 | |
fi | |
echo "This script nukes dockers graph directory & any btrfs subvolumes in it" | |
echo "Abort with ctrl+c now if you don't want this to happen (nuking starts in 10s)" | |
sleep 10 | |
systemctl stop docker | |
btrfs subvolume list / | grep var/lib/docker | awk '{print "/" $9}' | xargs btrfs subvolume delete | |
rm -rf /var/lib/docker | |
echo "Restart docker with: " | |
echo -e "\tsystemctl start docker" | |
echo "" | |
echo "You can check dockers status with:" | |
echo -e "\tsystemctl status docker" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment