O'Reilly logo

KVM Virtualization Cookbook by Konstantin Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

Perform the following steps to create a blank raw image of a specified size and to verify that the file was created on the host:

  1. Create a raw image named debian.img with size of 10 GB:
root@kvm:~# qemu-img create -f raw debian.img 10G    Formatting 'debian.img', fmt=raw size=10737418240    root@kvm:~#
  1. Check that the file was created:
root@kvm:~# ls -lah debian.img    -rw-r--r-- 1 root root 10G Feb 10 16:58 debian.img     root@kvm:~#





 

 

  1. Examine the file type:
root@kvm:~# file -s debian.img    debian.img: data    root@kvm:~#
  1. Obtain more information about the image:
root@kvm:~# qemu-img info debian.imgimage: debian.imgfile format: rawvirtual size: 10G (10737418240 bytes)disk size: 0root@kvm:~#

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required