Qemu

什麼是 qemu-img 一致性檢查?

  • January 27, 2014

如果有人能解釋qemu-img check <filename>命令的含義,我會很高興。手冊頁提供了非常糟糕的資訊:

   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.

例如,如果需要檢查磁碟映像的雜湊總和(而不是儲存在它們上的文件的雜湊總和),我可以使用此命令嗎?

它就像構成您的虛擬磁碟的物理文件上的檢查磁碟。

請參閱部分: 僅格式“qcow2”、“qed”和“vdi”

這意味著您的虛擬磁碟可能已損壞、錯誤字節或在某處失去數據等。這些格式似乎支持某種檢查和糾錯,這就是該選項的目的qemu-img check

用於顯示一致性功能的Wikiqccow2,例如

引用自:https://unix.stackexchange.com/questions/111109