(0) Launch QEMU as following: #---------------------------------------------------------------------- $ ~/build/build-qemu-block-stream-crash-test/x86_64-softmmu/qemu-system-x86_64 -M q35 \ -display none -nodefconfig -nodefaults -m 512 \ -blockdev node-name=node-A,driver=qcow2,file.driver=file,file.filename=./a.qcow2 \ -device virtio-blk,drive=node-A,id=virtio0 \ -netdev user,id=net0,hostfwd=tcp::5555-:22 -device e1000,netdev=net0 \ -monitor stdio -qmp unix:./qmp-sock,server,nowait #---------------------------------------------------------------------- (1) Create an overlay: (QEMU) blockdev-snapshot-sync node-name=node-A snapshot-file=b.qcow2 snapshot-node-name=node-B format=qcow2 { "execute": "blockdev-snapshot-sync", "arguments": { "node-name": "node-A", "snapshot-file": "b.qcow2", "format": "qcow2", "snapshot-node-name": "node-B" } } { "return": {} } #---------------------------------------------------------------------- (2) Create a target image, and add it via `blockdev-add`: #---------------------------------------------------------------------- $ qemu-img create -f qcow2 backup1.qcow2 1G Formatting 'backup1.qcow2', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16 (QEMU) blockdev-add driver=qcow2 node-name=node-backup1 file={"driver":"file","filename":"/export/backup1.qcow2"} { "execute": "blockdev-add", "arguments": { "node-name": "node-backup1", "driver": "qcow2", "file": { "driver": "file", "filename": "/export/backup1.qcow2" } } } { "return": {} } (QEMU) #---------------------------------------------------------------------- (3) Perform `blockdev-backup`, to the target by copying the entire chain [A] <-- [B] #---------------------------------------------------------------------- (QEMU) blockdev-backup device=node-B target=node-backup1 sync=full job-id=job0 { "execute": "blockdev-backup", "arguments": { "device": "node-B", "job-id": "job0", "target": "node-backup1", "sync": "full" } } { "return": {} } (QEMU) #---------------------------------------------------------------------- (4) Try to examine the disk image, and there's no operating system detected: #---------------------------------------------------------------------- $ du -sh examine-backup1.qcow2 22M examine-backup1.qcow2 $ export LIBGUESTFS_BACKEND=direct $ guestfish --ro -i -a examine-backup1.qcow2 guestfish: no operating system was found on this disk If using guestfish '-i' option, remove this option and instead use the commands 'run' followed by 'list-filesystems'. You can then mount filesystems you want by hand using the 'mount' or 'mount-ro' command. If using guestmount '-i', remove this option and choose the filesystem(s) you want to see by manually adding '-m' option(s). Use 'virt-filesystems' to see what filesystems are available. If using other virt tools, this disk image won't work with these tools. Use the guestfish equivalent commands (see the virt tool manual page). #---------------------------------------------------------------------- (5) However, when you examine the overlay file, b.qcow2, the OS *is* still there. #---------------------------------------------------------------------- $ guestfish --ro -i -a b.qcow2 Welcome to guestfish, the guest filesystem shell for editing virtual machine filesystems and disk images. Type: 'help' for help on commands 'man' to read the manual 'quit' to quit the shell Operating system: 0.3.5 /dev/sda1 mounted on / > #----------------------------------------------------------------------