°Ô½Ã¹° 1,369°Ç
   
¿î¿µÁßÀÎ ÆÄÀÏÀÌ »èÁ¦µÇ¾úÀ» °æ¿ì º¹±¸¹æ¹ý
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2013-12-10 (È­) 15:27 Á¶È¸ : 6486
±ÛÁÖ¼Ò :
                                
Áõ»ó :
 - °¡»óÈ­¸¦ ¿î¿µÁßÀΠȯ°æ¿¡¼­ À̹ÌÁöÆÄÀÏ(raw, qcow2)ÀÌ »èÁ¦µÇ¾úÀ¸³ª ÇØ´çµ¥¸óÀº ½ÇÇàÁßÀÎ »óÅÂ
 - VM »óÅ´ Àбâ/¾²±â ¸ðµÎ Á¤»óÀÌ¸ç ³»ºÎ ÇÁ·Î¼¼¼­¿¡µµ ¹®Á¦°¡ ¹ß»ýµÇÁö ¾ÊÀ½
    ´Ü, ¹é±×¶ó¿îµå µ¥¸óÀÌ ½ÇÇàÀÌ ÁßÁöµÇ¹ö¸± °æ¿ì inode °ªÀÌ »èÁ¦µÇ¾î µ¥ÀÌŸ°¡ À¯½ÇµÉ ¿©Áö°¡...
    µû¶ó¼­ ÇöÀç /proc ÆÄÀϽýºÅÛ¿¡¼­ ¾ÆÁ÷ ¿î¿µ»óÅÂÁßÀÎ ÆÄÀÏÀ» copy ÇÔÀ¸·Î½á µ¥ÀÌŸ¸¦ º¹±¸½Ãµµ


[root@localhost ]# lsof /VM_IMG/
COMMAND   PID USER   FD   TYPE DEVICE     SIZE/OFF      NODE NAME
qemu      845  kvm    4uW  REG   8,17            4 115081359 /VM_IMG/192.168.0.238/vnc/vm00001.pid (deleted)
qemu      845  kvm   12u   REG   8,17  71740882944 115081388 /VM_IMG/192.168.0.238/192.168.0.238.qcow2 (deleted)
qemu      845  kvm   16w   REG   8,17            2 115081384 /VM_IMG/192.168.0.238/vnc/vm00001.serial (deleted)
qemu     3571  kvm    4uW  REG   8,17            5 115081290 /VM_IMG/192.168.0.151/vnc/vm00002.pid (deleted)
qemu     3571  kvm   12u   REG   8,17  42124574720 115081287 /VM_IMG/192.168.0.151/192.168.0.151.qcow2 (deleted)
qemu     3571  kvm   15w   REG   8,17            1 115081291 /VM_IMG/192.168.0.151/vnc/vm00001.serial (deleted)


[root@localhost fd]# pwd
/proc/845/fd       ==> /proc/${PID}/fd 


[root@localhost fd]# ls -al
total 0
dr-x------ 2 kvm kvm  0 Dec  9 15:02 .
dr-xr-xr-x 8 kvm kvm  0 Nov 25 04:34 ..
lrwx------ 1 kvm kvm 64 Dec  9 15:02 0 -> /dev/null
lrwx------ 1 kvm kvm 64 Dec  9 15:02 1 -> /dev/null
lrwx------ 1 kvm kvm 64 Dec  9 15:02 10 -> anon_inode:[eventfd]
lrwx------ 1 kvm kvm 64 Dec  9 15:02 11 -> /dev/net/tun
lrwx------ 1 kvm kvm 64 Dec  9 15:02 12 -> /VM_IMG/192.168.0.238/192.168.0.238.qcow2 (deleted)
lr-x------ 1 kvm kvm 64 Dec  9 15:02 13 -> pipe:[20343205]
l-wx------ 1 kvm kvm 64 Dec  9 15:02 14 -> pipe:[20343205]
l-wx------ 1 kvm kvm 64 Dec  9 15:02 16 -> /VM_IMG/192.168.0.238/vnc/vm00001.serial (deleted)
lrwx------ 1 kvm kvm 64 Dec  9 15:02 17 -> anon_inode:kvm-vcpu
lrwx------ 1 kvm kvm 64 Dec  9 15:02 18 -> anon_inode:kvm-vcpu
lrwx------ 1 kvm kvm 64 Dec  9 15:02 19 -> socket:[20390697]
lrwx------ 1 kvm kvm 64 Dec  9 15:02 2 -> /dev/null
lrwx------ 1 kvm kvm 64 Dec  9 15:02 20 -> socket:[20390696]
lrwx------ 1 kvm kvm 64 Dec  9 15:02 21 -> anon_inode:[eventfd]
lrwx------ 1 kvm kvm 64 Dec  9 15:02 3 -> socket:[20452512]
lrwx------ 1 kvm kvm 64 Dec  9 15:02 4 -> /VM_IMG/192.168.0.238/vnc/vm00001.pid (deleted)
l-wx------ 1 kvm kvm 64 Dec  9 15:02 5 -> pipe:[20452513]
lrwx------ 1 kvm kvm 64 Dec  9 15:02 6 -> /dev/kvm
lrwx------ 1 kvm kvm 64 Dec  9 15:02 7 -> anon_inode:kvm-vm
lrwx------ 1 kvm kvm 64 Dec  9 15:02 8 -> anon_inode:[signalfd]
lrwx------ 1 kvm kvm 64 Dec  9 15:02 9 -> anon_inode:[eventfd]

¡Ø inode °ª È®ÀÎ
-i, --inode
       print the index number of each file


# À̹ÌÁö Á¤º¸ È®ÀÎ
[root@localhost fd]# qemu-img info 12
image: 12
file format: qcow2 
virtual size: 100G (107374182400 bytes)
disk size: 67G
cluster_size: 65536

# À̹ÌÁö º¹»ç
[root@115-68-30-45 fd]# cp /proc/845/fd/12 /VM_IMG/192.168.0.238.qcow2
'/proc/845/fd/12' -> '/VM_IMG/192.168.0.238.qcow2'

or 
[root@115-68-30-45 fd]# qemu-img convert -r /proc/845/fd/12 -O qcow2 /VM_IMG/192.168.0.238.qcow2

Á¤»óº¹±¸ È®ÀεǾúÀ¸¸ç...µ¥¸ó ½ÇÇà½Ã ÆÄÀϽýºÅÛ¿¡ ƯÀÌ»çÇ× ¾øÀÌ º¹±¸¿Ï·á!!!



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

 



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