-
-
Save itxx00/ac6e5eb0c61332669a30 to your computer and use it in GitHub Desktop.
discard-support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@localhost ~]$ rpm -q qemu-kvm | |
qemu-kvm-1.6.2-1.fc20.x86_64 | |
[root@localhost ~]$ rpm -q libvirt-daemon | |
libvirt-daemon-1.1.3.4-4.fc20.x86_64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@localhost ~]$ mount -o discard /dev/sda1 /sda | |
[root@localhost ~]$ mount /dev/sdb1 /sdb | |
[root@localhost ~]$ for _ in {1..3}; do | |
/bin/dd if=/dev/urandom of=/sda/file.$RANDOM bs=1M count=100 && sync | |
/bin/dd if=/dev/urandom of=/sdb/file.$RANDOM bs=1M count=100 && sync | |
/bin/rm -f /sda/file.* /sdb/file.* && sync | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<disk type='file' device='disk'> | |
<driver name='qemu' type='qcow2' cache='none' discard='unmap'/> | |
<source file='/disk/fedora20.data1.img'/> | |
<target dev='sda' bus='scsi'/> | |
</disk> | |
<controller type='scsi' index='0' model='virtio-scsi'> | |
</controller> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@localhost ~]$ du -h sd{a,b}.img | |
34M sda.img | |
138M sdb.img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<disk type='file' device='disk'> | |
<driver name='qemu' type='qcow2' cache='none' discard='unmap'/> | |
<source file='/mnt/sda.img'/> | |
<target dev='sda' bus='scsi'/> | |
</disk> | |
<disk type='file' device='disk'> | |
<driver name='qemu' type='qcow2' cache='none'/> | |
<source file='/mnt/sdb.img'/> | |
<target dev='sdb' bus='scsi'/> | |
</disk> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment