°Ô½Ã¹° 1,369°Ç
   
virt-resize --shrink µð½ºÅ© ÆÄƼ¼Ç »çÀÌÁî ÁÙÀ̱â
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2019-03-15 (±Ý) 15:43 Á¶È¸ : 6666
±ÛÁÖ¼Ò :
                                


º»¹®¿¡¼­´Â 25G ±âº»À̹ÌÁö¸¦ 20G·Î ÁÙÀÌ´Â ÀÛ¾÷
ÀÛ¾÷½Ã¿¡´Â VMÀ» ²ô°í ÀÛ¾÷




:: ÇöÀç µð½ºÅ© Å©±â È®ÀÎ
# qemu-img info disk
image: disk
file format: qcow2
virtual size: 25G (26843545600 bytes)
disk size: 394M
cluster_size: 65536
backing file: /var/lib/nova/instances/_base/9e2657ababfb190119ce1132e48f4e4ba17db05d
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false


:: ÆÐÅ°Áö ¼³Ä¡
# apt install libguestfs-tools

¡Ø If you're running this on a dedicated Glance server without libvirt, change the setting to bypass libvirt back-end:

$ export LIBGUESTFS_BACKEND=direct


:: À̹ÌÁö³» ÆÄƼ¼Ç »çÀÌÁî È®ÀΠ
# virt-filesystems --long --parts --blkdevs -h -a disk
Name       Type       MBR  Size  Parent
/dev/sda1  partition  83   25G   /dev/sda
/dev/sda   device     -    25G   -


¿©±â¼­´Â ÁÖÆÄƼ¼Ç(/dev/sda1)ÀÌ 1.2G »ç¿ëÁß
# virt-df  disk
Filesystem                           1K-blocks       Used  Available  Use%
disk:/dev/sda1                    19248060    1245636   17986040    7%


:: gueshfish¸¦ ÀÌ¿ëÇؼ­ ¸ÞŸµ¥ÀÌŸ °ª º¯°æ
# guestfish -a disk.img
><fs> run
><fs> list-filesystems
...
><fs> e2fsck-f /dev/sda1
><fs> resize2fs-size /dev/sda1 19G
><fs> exit

¡Ø  ½ÇÁ¦·Î ÁÙÀÌ·Á´Â µð½ºÅ© Å©±âº¸´Ù´Â Àû°ÔÇؼ­ üũ 


:: ÁÙÀÌ·Á´Â µð½ºÅ© À̹ÌÁö »ý¼º
# qemu-img create -f qcow2 -o preallocation=metadata newdisk.qcow2 20G


:: ÆÄƼ¼Ç Á¤º¸(µ¥ÀÌŸ) º¹»ç
# virt-resize --shrink / dev / sda1 ./disk ./newdisk.qcow2


:: È®ÀÎ
# qemu-img info newdisk.qcow2
image: disk
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 1.5G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false


#  virt-filesystems --long --parts --blkdevs -h -a disk
Name       Type       MBR  Size  Parent
/dev/sda1  partition  83   20G   /dev/sda
/dev/sda   device     -    20G   -

# virt-df disk
Filesystem                           1K-blocks       Used  Available  Use%
disk:/dev/sda1                        20263528    1245896   19001248    7%


Âü°í URL




À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



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