summaryrefslogtreecommitdiff
path: root/bin/makeqcow2
diff options
context:
space:
mode:
Diffstat (limited to 'bin/makeqcow2')
-rwxr-xr-xbin/makeqcow28
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/makeqcow2 b/bin/makeqcow2
new file mode 100755
index 0000000..2be0468
--- /dev/null
+++ b/bin/makeqcow2
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+name="$1"
+size="$2"
+
+truncate -s "$size" "$name".raw
+mkfs.ext4 -b 4096 -d "$name" -F -L `basename "$name"` -O ^huge_file -q -U random "$name".raw
+exec qemu-img convert -f raw -O qcow2 -c -o compression_type=zstd "$name".raw "$name".qcow2