Last active
April 5, 2023 03:28
-
-
Save mechinn/926a1def89510046cc58bf1aef5359ed to your computer and use it in GitHub Desktop.
bash script that will use qemu-img read the "virtual-size" of an image, create a zvol of the full size, and convert the file to the zvol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
file=$1 | |
destination=$2 | |
size=$(qemu-img info $file --output json | jq '."virtual-size"') | |
zfs create -V $size $destination | |
qemu-img convert -O raw $file /dev/zvol/$destination |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment