What is qemu-img consistency check?

5,615

It is like a check disk on a physical file that constitute your virtual disk.

See the part: Only the formats "qcow2", "qed" and "vdi"

This mean that your virtual disk can be corrupted, wrong byte or missing data somewhere etc. Those formats seem to support some kind of checking and error correction, and that's the purpose of the option qemu-img check

Wiki for qccow2 shows consistency features for example

Share:
5,615

Related videos on Youtube

Vitaly Isaev
Author by

Vitaly Isaev

Updated on September 18, 2022

Comments

  • Vitaly Isaev
    Vitaly Isaev almost 2 years

    I would be glad if someone could explain the meaning of qemu-img check <filename> command. Man pages provide very poor information about it:

       check [-f fmt] [-r [leaks | all]] filename
           Perform a consistency check on the disk image filename.
           If "-r" is specified, qemu-img tries to repair any inconsistencies
           found during the check. "-r leaks" repairs only cluster leaks,
           whereas "-r all" fixes all kinds of errors, with a higher risk of
           choosing the wrong fix or hiding corruption that has already
           occurred.
           Only the formats "qcow2", "qed" and "vdi" support consistency
           checks.
    

    For instance, can I use this command in case of need to check the hash sum of the disk image (rather hash sums of the files stored on them)?