summaryrefslogtreecommitdiff
path: root/prep-benchmark-fs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'prep-benchmark-fs.sh')
-rwxr-xr-xprep-benchmark-fs.sh14
1 files changed, 6 insertions, 8 deletions
diff --git a/prep-benchmark-fs.sh b/prep-benchmark-fs.sh
index 3a46946..5339daf 100755
--- a/prep-benchmark-fs.sh
+++ b/prep-benchmark-fs.sh
@@ -23,17 +23,17 @@ while getopts "hd:m:f:" arg; do
esac
done
-if [[ -z $DEV ]]; then
+if [[ -z ${DEV-} ]]; then
echo "Required parameter -d missing: device to test"
exit 1
fi
-if [[ -z $MNT ]]; then
+if [[ -z ${MNT-} ]]; then
echo "Required parameter -m missing: mount point"
exit 1
fi
-if [[ -z $FS ]]; then
+if [[ -z ${FS-} ]]; then
echo "Required parameter -f missing: filesystem type"
exit 1
fi
@@ -45,13 +45,11 @@ blkdiscard -s $DEV >/dev/null 2>&1 ||
blkdiscard $DEV >/dev/null 2>&1 ||
true
+wipefs -af $DEV
+
case $FS in
bcache)
- wipefs -a $DEV
- bcache format \
- --error_action=panic \
- --data_csum_type=none \
- --cache $DEV
+ bcache format -f $DEV
;;
ext4)
mkfs.ext4 -F $DEV