Difference between revisions of "Qemu-img"

From wikieduonline
Jump to navigation Jump to search
Line 9: Line 9:
 
** <code>qemu-img create -f qcow2 -o preallocation=metadata,compat=1.1,lazy_refcounts=on MY_IMAGE_NAME.img</code>
 
** <code>qemu-img create -f qcow2 -o preallocation=metadata,compat=1.1,lazy_refcounts=on MY_IMAGE_NAME.img</code>
 
:::<code>lazy_refcounts=on</code> Reference count updates are postponed with the goal of avoiding metadata I/O and improving performance. Particularly interesting with cache=writethrough.
 
:::<code>lazy_refcounts=on</code> Reference count updates are postponed with the goal of avoiding metadata I/O and improving performance. Particularly interesting with cache=writethrough.
 +
 
* Create a snapshot: <code> qemu-img create -f qcow2 -o backing_file=original snapshot.qcow</code><ref>http://libguestfs.org/virt-sysprep.1.html#copying-and-cloning</ref>
 
* Create a snapshot: <code> qemu-img create -f qcow2 -o backing_file=original snapshot.qcow</code><ref>http://libguestfs.org/virt-sysprep.1.html#copying-and-cloning</ref>
 
+
* <code>[[qemu-img snapshot]]</code> (See also: <code>[[lvcreate]] --snapshot</code> for LVM snapshots)
  
 
* <code>qemu-img convert</code>
 
* <code>qemu-img convert</code>
Line 18: Line 19:
 
* <code>[[qemu-img resize]] YOUR_IMAGE.qcow2 +SIZE</code><ref>https://maunium.net/blog/resizing-qcow2-images/</ref> ([[Extend LVM on qcow2 images]])<ref>https://serverfault.com/questions/324281/how-do-you-increase-a-kvm-guests-disk-space</ref>
 
* <code>[[qemu-img resize]] YOUR_IMAGE.qcow2 +SIZE</code><ref>https://maunium.net/blog/resizing-qcow2-images/</ref> ([[Extend LVM on qcow2 images]])<ref>https://serverfault.com/questions/324281/how-do-you-increase-a-kvm-guests-disk-space</ref>
  
* <code>[[qemu-img snapshot]]</code> (See also: <code>[[lvcreate]] --snapshot</code> for LVM snapshots)
+
 
  
 
== Activities ==
 
== Activities ==

Revision as of 16:31, 6 January 2020

qemu-img[1] allows you to create, convert and modify images offline, It can handle all image formats supported by QEMU.


  • qemu-img create
    • qemu-img create -f qcow2 MY_IMAGE_NAME.img 3G
    • qemu-img create -f qcow2 -o preallocation=metadata,compat=1.1,lazy_refcounts=on MY_IMAGE_NAME.img
lazy_refcounts=on Reference count updates are postponed with the goal of avoiding metadata I/O and improving performance. Particularly interesting with cache=writethrough.
  • Create a snapshot: qemu-img create -f qcow2 -o backing_file=original snapshot.qcow[3]
  • qemu-img snapshot (See also: lvcreate --snapshot for LVM snapshots)


Activities

See also

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

Source: wikiversity

Advertising: