WizardKit/archlive/airootfs/usr/local/bin/hw-diags-badblocks
Alan Mason 546a654c0f 2016-05: Retroactive Updates
* Added build-wk script
  * This will (hopefully) keep the arch-hh folder clean allowing for a better git workflow
* Rebuilt the default settings for wktech for most programs
* Made the theme/icons more consistant between programs
* Changed whiskermenu to more closely match a Windows Start Menu
* Lots of hw-diags updates:
  * Connects to the network automatically
  * Copies all results files to $HOME/Tickets
  * Creates valid tgz archives of the results
  * Uses `mktemp` for setting TMP_DIR
* mount-all-drives now opens the FileManager if lauched w/ Super+M
* Probably more...
2017-12-06 17:47:06 -08:00

25 lines
441 B
Bash

#!/bin/bash
#
## WK HW diagnostics - badblocks
function usage {
echo "Usage: $0 log-dir device"
echo " e.g. $0 /tmp/tmp.7Mh5f1RhSL9001 /dev/sda"
}
# Bail early
if [ ! -d "$1" ]; then
usage
exit 1
fi
if [ ! -b "$2" ]; then
usage
exit 1
fi
# Run Badblocks
sudo badblocks -sv -e 1 "$2"
tmux capture-pane
tmux save-buffer "$1/bb_tmp.out"
grep -Ev '^$' "$1/bb_tmp.out" > "$1/${2##*/}_badblocks.log"
rm "$1/bb_tmp.out"