kvm | qemu | qcow2 dynamic/sparse disk allocation problem | shrink sparse qcow2 disks howto

In some recent qemu versions there is a problem while creating sparse disks using the virt-manager. Normally the qcow2 format always allocates space dynamically (sparse), but some qemu versions fail at this, they create disks with full expected size. Solution: The easy way: Backup your old qcow2 image. Then do apt-get install libguestfs-tools virt-sparsify kvm_backup/debian_mssql.qcow2 […]

OpenBSD 5.1 and earlier | Cloning a disk the easy way

#!/bin/sh DISKLABEL=$(which disklabel) FDISK=$(which fdisk) DUMP=$(which dump) RESTORE=$(which restore) NEWFS=$(which newfs) MOUNT=$(which mount) UMOUNT=$(which umount) DUMP=$(which dump) RESTORE=$(which restore) MNT=”/mnt” LABEL=”/tmp/label” if [ $# -lt 2 ]; then echo “usage: do_clone.sh FROM TO” echo “example: do_clone.sh wd0 wd1” exit fi SRC=$1 $DISKLABEL $SRC > /dev/null || exit TAR=$2 $DISKLABEL $TAR > /dev/null || exit #echo […]