#!/bin/bash # Set location to create test disk images IMAGE_PATH=/mnt/sdb # Do not edit # $1 = disk path, $2 = allocation, $3 = size in GB, $4 = cluster size diskTest(){ echo "Creating disk... prealloc: $2, cluster: $4, size: $3G" echo "qemu-img create -f qcow2 -o preallocation=$2 -o cluster_size=$4 -o size=$3G $N" N=$1/prealloc_$2_cluster_$4_size_$3g.qcow2 qemu-img create -f qcow2 -o preallocation=$2 -o cluster_size=$4 -o size=$3G $N } # metadata test first echo "########################################################################################" time diskTest $IMAGE_PATH "off" "4" "65536" qemu-img info $N echo echo "########################################################################################" time diskTest $IMAGE_PATH "metadata" "4" "65536" qemu-img info $N echo echo "########################################################################################" time diskTest $IMAGE_PATH "falloc" "4" "65536" qemu-img info $N echo echo "########################################################################################" time diskTest $IMAGE_PATH "full" "4" "65536" qemu-img info $N