While preparing to migrate a legacy virtual machine to a KVM host, you are given a 70-GB raw disk image called "db-appliance.img". You want to
keep the original file unchanged for safety,
create a new thin-provisioned, compressed qcow2 image named "db-appliance.qcow2" that KVM can attach to the VM. The VM is powered off and you are working on the host CLI. Which single command meets all of these requirements?
qemu-img convert -f qcow2 -O raw -c db-appliance.img db-appliance.qcow2
The qemu-img convert subcommand copies data from a source image to a new destination image of a different format. The option -f raw tells qemu-img the input format, -O qcow2 selects qcow2 as the output format, and -c requests compression of the destination file. The syntax
qemu-img convert -f raw -O qcow2 -c db-appliance.img db-appliance.qcow2
creates a compressed qcow2 file while leaving the raw source untouched.
Reversing the formats (qcow2 ➜ raw) would create a raw file, not what is required.
qemu-img create -b only makes a copy-on-write overlay that still depends on the original raw file and does not copy or compress any data.
qemu-img amend modifies an existing image in place and neither converts nor copies it. Therefore the first command is correct.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the difference between raw and qcow2 disk image formats?
Open an interactive chat with Bash
What does the qemu-img convert command do?
Open an interactive chat with Bash
What is the purpose of the -c option in qemu-img commands?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access