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: Create your disks manually: Shrinking existing images: # mv disk.qcow2 disk.qcow2.orig # qemu-img convert -O […]

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 […]