From 77c6312ead9c3d77f3e6f0f77b3cf7561a8feb3a Mon Sep 17 00:00:00 2001 From: David Thurstenson Date: Wed, 1 Dec 2021 18:59:05 -0600 Subject: [PATCH] Adding f3fulltest --- bin/f3fulltest | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 bin/f3fulltest diff --git a/bin/f3fulltest b/bin/f3fulltest new file mode 100755 index 0000000..057cccf --- /dev/null +++ b/bin/f3fulltest @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +# This script assumes that the specified block device can be completely wiped + + +# exit when any command fails +set -e + +disk=$1 +mp=$(mktemp -d) + +# f3probe the block device for counterfeit flash memory +f3probe --destructive --time-ops $disk + +# f3write and f3read need a mounted fs +mkfs.ext4 -D -F -F $disk + +mount $disk $mp + +f3write $mp + +sync + +f3read $mp + +umount $mp