Skip to content

Instantly share code, notes, and snippets.

@adam12
Created January 8, 2018 17:53
Show Gist options
  • Save adam12/ce2fd9b7ac95b0ef6e0b46275e3b5320 to your computer and use it in GitHub Desktop.
Save adam12/ce2fd9b7ac95b0ef6e0b46275e3b5320 to your computer and use it in GitHub Desktop.
List qcow2 images that have been orphaned
#/bin/sh
# vim:ts=4:sts=4:sw=4:et
for d in $(ls /var/lib/libvirt/images/*.qcow2); do
grep $d /etc/libvirt/qemu/*.xml >/dev/null || echo $d
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment