Adding f3fulltest

This commit is contained in:
David Thurstenson 2021-12-01 18:59:05 -06:00
parent 28288670a5
commit 77c6312ead
1 changed files with 26 additions and 0 deletions

26
bin/f3fulltest Executable file
View File

@ -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