Skip to content

Instantly share code, notes, and snippets.

@ChrisCarini
Created December 5, 2018 03:09
Show Gist options
  • Save ChrisCarini/59700046d51915c2f7c58393fb2f9a95 to your computer and use it in GitHub Desktop.
Save ChrisCarini/59700046d51915c2f7c58393fb2f9a95 to your computer and use it in GitHub Desktop.
Hard drive testing / break-in process commands
sudo badblocks -nvs -o ~/badblocks${DEVICE_TO_TEST//\//_}.txt -b 4096 ${DEVICE_TO_TEST}
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}
#!/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