减少qcow文件大小

int32位 posted @ Mar 22, 2016 04:00:02 PM in openstack , 1944 阅读
转载请注明:http://krystism.is-programmer.com/若有错误,请多多指正,谢谢!

 

当做虚拟机备份快照时,镜像的大小一般会大于实际数据大小,you'll need to zero out all free space of the partitions contained within the guest first.

参考维基百科:https://pve.proxmox.com/wiki/Shrin_Qcow2_Disk_Files

针对linux镜像:

1. 删除无用文件

尽量删除一些无用文件

2. Zero out磁盘

dd if=/dev/zero of=/mytempfile
# that could take a some time
rm -f /mytempfile

3.减少磁盘大小

备份

mv image.qcow2 image.qcow2_backup

#1: Shrink your disk without compression (better performance, larger disk size):

qemu-img convert -O qcow2 image.qcow2_backup image.qcow2

#2: Shrink your disk with compression (smaller disk size, takes longer to shrink, performance impact on slower systems):

qemu-img convert -O qcow2 -c image.qcow2_backup image.qcow2

 

转载请注明:http://krystism.is-programmer.com/若有错误,请多多指正,谢谢!
  • 无匹配
  • 无匹配
Digital Ali 说:
2021年9月14日 21:35

Please share more like that. 123 free movies

SEO 说:
2021年10月01日 00:31

What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much. Complete Business Funding List

SEO 说:
2021年10月02日 19:35

Thank you very much for this great post. find more information

SEO 说:
2021年10月10日 01:30

I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. รับทำ SEO

SEO 说:
2021年10月18日 03:16

I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. umrah package from abu dhabi

SEO 说:
2021年11月04日 21:18

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post. 오피아트

SEO 说:
2021年11月23日 23:15 KitaabNow is an online book store in pakistan with a huge variety of Academic Books and Stationery items.
Umzugsfirma Zürich 说:
2021年12月24日 18:39

Die 1a umzüge GmbH ist Ihr zuverlässiger Partner für Umzug, Reinigung, Entsorgung, Lagerung und alle Dienstleistungen rund um den Umzug. Kontakt 1a Umzüge GmbH, Umzugsfirma Zürich.

Website 说:
2022年6月22日 00:56

Buy YouTube PVA Accounts
The website is looking a bit flashy and it catches the visitor's eyes. The design is pretty simple and a good user-friendly interface.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter