* Added HFS+ to udevil's allowed types. * Added mediainfo to meet photorec-sort requirements * Removed git * Switched out Chromium for Midori * Size reduction test * hw-diags now tests USB drives (except ARCH drives) * mount-all-volumes no longer opens the file browser Bugfix: mount-backup-shares should now work.
25 lines
440 B
Bash
25 lines
440 B
Bash
#!/bin/bash
|
|
#
|
|
## WK HW diagnostics - badblocks
|
|
|
|
function usage {
|
|
echo "Usage: $0 log-dir device"
|
|
echo " e.g. $0 /var/tmp/hw-diags/9001 /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"
|