Last active
July 13, 2021 19:41
-
-
Save hapylestat/03a87a434c84a8ea9b547d9d502c84cb to your computer and use it in GitHub Desktop.
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
# Remove sparce space from qcow image | |
# https://serverfault.com/questions/432119/is-there-any-way-to-shrink-qcow2-image-without-converting-it-raw | |
qemu-img convert -O qcow2 source.qcow2 shrunk.qcow2 | |
# show progress bar for tar | |
# https://superuser.com/questions/168749/is-there-a-way-to-see-any-tar-progress-per-file | |
# note: it requires "pv" package to be installed | |
_folder=./folder | |
_target=target.tar.gz | |
tar cf - ${_folder} -P | pv -s $(du -sb ${_folder} | awk '{print $1}') | gzip > ${_target} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment