Re: How do you unsparsify a qcows2 file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You might want to think about setting a size on that file. dd can be pretty destructive as well as useful. I like to randomize file with it before truncating the contents. For example, if a file is 4096 bytes, I would use, 'dd if=/dev/zero of=/file bs=4096 count=1 conv=notrunc. Just so there is no truncation of the file. dd isn't to be played with haphazardly. Good luck.

B


On 12/12/2022 4:54 PM, 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

_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux