raw 格式的镜像,不带matadata,就像一块空白的磁盘,读写效率比qcow2快近10~30%。
本文探讨下,在将这个镜像进行网络传输备份时,如何减少数据拷贝。如果一个近50G大小的文件在网络中进行传输的话,即占用带宽,拷贝花的时间也是比较漫长的。
1. 看看创建raw镜像的一些参数
root@test:~# qemu-img create -f raw a.img -o ?
Supported options:
size Virtual disk size
nocow Turn off copy-on-write (valid only on btrfs)
preallocation Preallocation mode (allowed values: off, falloc, full)
An image with preallocated metadata is initially larger but can improve performance when the image needs to grow. Full preallocation additionally writes zeros to the whole image in order to preallocate lower layers。
为了提高读写效率,通常会打开这个preallocation开关。
2. 创建raw镜像
1). 创建raw格式的镜像
qemu-img cr