Virtual disk images and formats and basic KVM storage operations
Disk images are standard files stored on the host's filesystem. They are large and act as virtualized hard drives for guests. You can create such files using the dd
command, as shown:
# dd if=/dev/zero of=/vms/dbvm_disk2.img bs=1G count=10
Here is the translation of this command for you:
Duplicate data (dd
) from the input file (if
) of /dev/zero
(virtually limitless supply of zeros) into the output file (of
) of /vms/dbvm_disk2.img
(disk image) using blocks of 1 G size (bs
= block size) and repeat this (count
) just once (10
).
Important note:
dd
is known to be a resource-hungry command. It may cause I/O problems on the host system, so it's good to first check the available free memory and I/O state of the host system, and only then run it. If the system is already loaded, lower the block size to MB and increase the count to match the size of the file you wanted (use bs=1M
, count=10000
instead of...