°Ô½Ã¹° 1,369°Ç
   
qcow2 ½ÇÁ¦ µð½ºÅ© »ç¿ë·®À¸·Î º¯È¯ (zero-fill)
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2015-01-27 (È­) 16:29 Á¶È¸ : 10712
±ÛÁÖ¼Ò :
                                
qcow2 À̹ÌÁö´Â µ¿ÀûÀ̹ÌÁö·Î ÇÒ´çµÈ À̹ÌÁö»çÀÌÁî¿¡¼­ ½ÇÁ¦ µð½ºÅ© »ç¿ë·®¸¸Å­ Áõ°¡ÇÏ°Ô µÇ´Âµ¥....ÀÏÁ¤¼öÄ¡¸¸Å­ Áõ°¡ÈÄ¿¡ ½Çµ¥ÀÌŸ¸¦ »èÁ¦ÇÏ°Ô µÇ¾úÀ»°æ¿ì ºñ¾îÀÖ´Â(Áö¿ö¹ö¸°) µ¥ÀÌŸ¸¦ °¨ÁöÇÏÁö ¸øÇÕ´Ï´Ù.
ÀÌ·²°æ¿ì ºñ¾îÀÖ´Â(zero area or zero-fill) µ¥ÀÌÅ͸¦ »èÁ¦ÇÏ¿© À̹ÌÁö Å©±â¸¦ ½Ç½ÎÀÌÁî·Î º¯È¯ÇØÁÖ´Â ¹æ¹ýÀÔ´Ï´Ù.


VM ½ÇÁ¦ »ç¿ë¿ë·®
[root@CHONNOM ~]# df -Th
Filesystem     Type   Size  Used Avail Use% Mounted on
/dev/vda1      ext3    99G   23G   71G  25% /
tmpfs          tmpfs  499M     0  499M   0% /dev/shm


HOST ³»¿¡¼­ È®ÀÎÇغ¸´Â µð½ºÅ©»ç¿ë·®
# qemu-img info 192.168.30.193.qcow2 
image: 192.168.30.193.qcow2
file format: qcow2
virtual size: 100G (107374182400 bytes)
disk size: 41G
cluster_size: 65536
==>> VM³»¿¡¼­ »ç¿ëµÇ°í ÀÖ´Â µð½ºÅ©·®(23G)°ú HOST¿¡¼­ È®ÀÎÇÏ´Â µð½ºÅ© ½ÎÀÌÁî Â÷À̳²!


ZERO AREA »èÁ¦¹æ¹ý
¹æ¹ý1) VM¿¡¼­ ³²Àº°ø°£À» zero ÆÄÀÏ·Î ¸¸µé°í »èÁ¦ÈÄ ÄÁ¹öÆÃ
VM
# dd if=/dev/zero of=file.zeros
dd: writing to `file.zeros': ÀåÄ¡¿¡ ³²Àº °ø°£ÀÌ ¾øÀ½
158729705+0 records in
158729704+0 records out
81269608448 bytes (81 GB) copied, 735.199 s, 111 MB/s
# rm -rf file.zeros
# shutdown -h now

HOST
# qemu-img convert 192.168.30.193.qcow2 -O qcow2 convert_192.168.30.193.qcow2
# qemu-img info convert_192.168.30.193.qcow2 
image: convert_192.168.30.193.qcow2
file format: qcow2
virtual size: 100G (107374182400 bytes)
disk size: 23G
cluster_size: 65536
# rm -rf 192.168.30.193.qcow2
# mv convert_192.168.30.193.qcow2 192.168.30.193.qcow2
qemu ½ÃÀÛ


¹æ¹ý2) ¾ÐÃà¿É¼ÇÀ¸·Î ÄÁ¹öÆÃ
HOST
# qemu-img convert -c 192.168.30.193_7250_vm04020.qcow2 -O qcow2 chk.qcow2
´ÜÁ¡) -c ¿É¼Ç¾øÀÌ convert ÇÒ¶§¿¡ ºñÇØ ½Ã°£ÀÌ 4~5¹è ¿À·¡°É¸²
ÀåÁ¡) Á»´õ È®ÀÎÇغÁ¾ßµÇ³ª....ÀÛ¾÷½Ã ½Ã½ºÅÛ ·Îµå´Â ¹ÝÀ¸·Î ÁÙ¾îµë

# qemu-img info chk.qcow2 
image: chk.qcow2
file format: qcow2
virtual size: 100G (107374182400 bytes)
disk size: 13G   -->> ¿ø·¡½ÎÀÌÁ´Ùµµ ÁÙ¾îµë
cluster_size: 65536


¡Ø qemu-img convert
'-c' indicates that target image must be compressed (qcow format only
'-S' indicates the consecutive number of bytes that must contain only zeros
       for qemu-img to create a sparse image during conversion


ÃÖ°í°ü¸®ÀÚ 2015-01-29 (¸ñ) 09:30
https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/
À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.