Show Table of Contents
14.3. Comparing Images
Compare the contents of two specified image files (imgname1 and imgname2) with the
qemu-img compare
command. Optionally, specify the files' format types (fmt). The images can have different formats and settings.
By default, images with different sizes are considered identical if the larger image contains only unallocated or zeroed sectors in the area after the end of the other image. In addition, if any sector is not allocated in one image and contains only zero bytes in the other one, it is evaluated as equal. If you specify the
-s
option, the images are not considered identical if the image sizes differ or a sector is allocated in one image and is not allocated in the second one.
# qemu-img compare [-f fmt] [-F fmt] [-p] [-s] [-q] imgname1 imgname2
The
qemu-img compare
command exits with one of the following exit codes:
0
- The images are identical1
- The images are different2
- There was an error opening one of the images3
- There was an error checking a sector allocation4
- There was an error reading the data
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.