Notepad:KVM: Difference between revisions
From Amar
Jump to navigationJump to search
(One intermediate revision by the same user not shown) | |||
Line 15: | Line 15: | ||
== Expand the size of QCOW2 disk == | == Expand the size of QCOW2 disk == | ||
[http://www.naturalborncoder.com/virtualization/2014/12/05/increasing-the-size-of-a-qcow2-image-under-kvm/ Expand the size of a QCOW2 disk image ] | [http://www.naturalborncoder.com/virtualization/2014/12/05/increasing-the-size-of-a-qcow2-image-under-kvm/ Expand the size of a QCOW2 disk image ] | ||
== Shrink a QCOW2 disk == | |||
Clear the empty space | |||
sudo dd if=/dev/zero of=/zerofile bs=1M | |||
sudo rm -f /zerofile | |||
or | |||
sdelete.exe -z C: | |||
Then change the size | |||
qemu-img convert -O qcow2 -c input.qcow2 output.qcow2 | |||
=== Copy a Sparse File === | |||
From [https://serverfault.com/questions/665335/what-is-fastest-way-to-copy-a-sparse-file-what-method-results-in-the-smallest-f Fastest way to copy a sprse file] the end result was : | |||
* cp --sparse=always srcFile dstFile | |||
* dd if=srcFile of=dstFile iflag=direct oflag=direct bs=4M conv=sparse | |||
* rsync --ignore-existing -aS srcFile dstFile | |||
* virt-sparsify srcFile dstFile | |||
{{notepad}} | {{notepad}} |
Latest revision as of 22:59, 14 May 2024
From: HowTos | KVM
KVM
Networking - brctl
Start/Start libvirtd
Virtual Shell virsh
Transfer Running Machines
- Windows Transfer a running Windows
- Linux Transfer a running Linux
Expand the size of QCOW2 disk
Expand the size of a QCOW2 disk image
Shrink a QCOW2 disk
Clear the empty space
sudo dd if=/dev/zero of=/zerofile bs=1M sudo rm -f /zerofile
or
sdelete.exe -z C:
Then change the size
qemu-img convert -O qcow2 -c input.qcow2 output.qcow2
Copy a Sparse File
From Fastest way to copy a sprse file the end result was :
- cp --sparse=always srcFile dstFile
- dd if=srcFile of=dstFile iflag=direct oflag=direct bs=4M conv=sparse
- rsync --ignore-existing -aS srcFile dstFile
- virt-sparsify srcFile dstFile
← Back to Notepad
<insert>googlesearchwiki</insert> | <insert>paypal</insert> | <insert>analytics</insert> |