On 12/12/22 17:20, Samuel Sieb wrote:
On 12/12/22 13:54, ToddAndMargo via users wrote:
> On 12/12/22 12:08, ToddAndMargo via users wrote:
>> On 12/12/22 06:43, Tom Horsley wrote:
>>> On Mon, 12 Dec 2022 06:33:15 -0800
>>> ToddAndMargo via users wrote:
>>>
>>>> This it?
>>>>
>>>> dd if=/dev/zero of=/sometempfile
>>>
>>> Seems like that would work. Might need to do it as root in case the
>>> kernel doesn't allow an ordinary user to use up all the free space on
>>> a disk. And don't forget "rm /sometempfile" once the dd
finishes
>>> with out of space errors.
>>>
>>> Of course you could take a completely different tack and use
>>> qemu-img convert to change the qcow2 format file to a raw
>>> disk image and modify the virtual machine to use that new file.
>>
>>
>> I qemu-img to a raw and then back to a qcows2.
>> Dump/resore still did not restore right.
>>
>> Now I converted to a raw and am about to see
>> if dump/restore will restore back correct.
>>
>> If that does not work, I am going to dd /dev/zero
>
> dump/restore restored a "raw" file perfectly.
>
> Interesting. sha256sum came back different for
> before and after (.000 is before)
>
> # sha256sum KVM-W11.raw KVM-W11.raw.000
>
> cbc480f889a9e337ab8b41b1e761da5f7f27ad255ceb29d891f60eba8f9903de
> KVM-W11.raw
>
> 6dbf2d0d893f3fc0b5e529a94aad71770bc971ff567881073c8b8a05d9254fca
> KVM-W11.raw.000
Dump and restore only interact with used blocks. So if there is old
data in unused blocks in the original disk, the dump won't save those
and the restore won't put them back.
That explains why the check sums are different,
but the restored files work. Thank you!