Created
December 5, 2018 03:09
-
-
Save ChrisCarini/59700046d51915c2f7c58393fb2f9a95 to your computer and use it in GitHub Desktop.
Hard drive testing / break-in process commands
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
sudo badblocks -nvs -o ~/badblocks${DEVICE_TO_TEST//\//_}.txt -b 4096 ${DEVICE_TO_TEST} |
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
DEVICE_TO_TEST=/dev/sda1 | |
START_BLOCK= | |
LAST_BLOCK= | |
sudo badblocks -nvs -o ~/badblocks${DEVICE_TO_TEST//\//_}.txt -b 4096 ${DEVICE_TO_TEST} ${LAST_BLOCK} ${START_BLOCK} |
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/bash | |
DEVICE_TO_TEST=/dev/sda1 | |
echo -e "You are about to unmount and test $(tput bold)${DEVICE_TO_TEST}$(tput sgr0). This can take a long time." | |
tput setaf 1; echo -e 'WARNING! This is a destructive operation! Data will be overwritten!' ; tput sgr0 | |
read -p "Press enter to continue..." | |
umount ${DEVICE_TO_TEST} | |
sudo badblocks -wvs -o ~/badblocks${DEVICE_TO_TEST//\//_}.txt -b 4096 ${DEVICE_TO_TEST} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment