LVM ( Logical Volume Manager )ÀÇ ¾à¾î·Î ³í¸®ÀûÀÎ µð½ºÅ© °ü¸®ÀÚ¶ó°í ÇÒ ¼ö ÀÖ´Ù.
¡Ü Ư¡
-> ÀÛÀº ¿ë·®ÀÇ ÇÏµå µð½ºÅ© ¿©·¯ °³¸¦ Å« ¿ë·®ÀÇ ÇÏµå µð½ºÅ© ÇÑ °³Ã³·³ »ç¿ë.
-> ¼¹ö ¿î¿µ ½Ã¿¡ ´ë¿ë·®ÀÇ º°µµ ÀúÀå °ø°£ÀÌ ÇÊ¿äÇÒ ¶§ È°¿ë.
¡Ü ¿ë¾î
-> Physical
Volume ( ¹°¸® º¼·ý )
=> /dev/sdb2 , /dev/sdb3, /dev/sdb4
-> Volume Group ( º¼·ý ±×·ì ) =>
Physical VolumeÀ» ÇÕÃļ ¹°¸®Àû ±×·ì ÇÑ °³·Î ¸¸µå´Â °Í.
-> Logical Volume ( ³í¸® º¼·ý ) =>
Volume GroupÀ» ³ª´²¼ ³í¸®Àû ±×·ìÀ¸·Î ³ª´® ( 1°³ ÀÌ»ó )
-> Physical Extent
=> PV°¡ °®´Â ÀÏÁ¤ÇÑ ºí·°
-> Logical Extent
=> LV°¡ °®´Â ÀÏÁ¤ÇÑ ºí·°
¡Ü ½Ç½À~~
root@localhost ~ ]# fdisk /dev/sdb => ¾Õ¼¼µµ À̾߱â ÇßÁö¸¸ fdisk·Î ÆÄƼ¼ÇÀ» ÀâÀÚ~~ ( ÀÚ½ÅÀÇ ÀåÄ¡ À̸§À» »ç¿ë )
Command ( m for help ) :
n => LVMÀ» »ç¿ëÇϱâ À§ÇØ ÆÄƼ¼ÇÀ» »õ·Î ¸¸µé°Ú´Ù.
Command action
e expended
p
primary partition ( 1 - 4 )
e
¡ºEnter¡»
=> ÆÄƼ¼ÇÀ» »ç¿ëÇÒ °÷ÀÌ ¸¹Àº °ü°è·Î È®ÀåÇü ÆÄƼ¼ÇÀ» ¼±ÅÃ.
Partition number ( 1 - 4 ) : 2 => 1¹ø ÆÄƼ¼ÇÀº Àü¿¡ »ý¼ºÇ߱⠶§¹®¿¡ 2¹øÀ» ¼±ÅÃ..
First cylinder ( 20 - 130, default 20 ) : ¡ºEnter¡» => »ç¿ëÇÒ ¼ö Àִ ù¹ø° ½Ç¸°´õ 20Àº ±âº»°ªÀ̹ǷΠ¾Æ¹«°Íµµ
ÀÔ·ÂÇÏÁö ¾Ê°í,
"enter"¸¦ ÀÔ·ÂÇؼ.. ±âº»°ªÀ» »ç¿ë
Using default value 20
Last cylinder or +size or +sizeM or +sizeK ( 20 -130, default 130 ) : ¡ºEnter¡»
=>
¾îÂ÷ÇÇ ¸¹Àº ºÎºÐÀ» È®ÀåÇü ÆÄƼ¼ÇÀ¸·Î »ç¿ëÇÒ °èȹÀ̹ǷÎ, ±×³É ¿£Å͸¦ ÀÔ·ÂÇؼ ³ª¸ÓÁö ÀüºÎ¸¦ È®ÀåÇü ÆÄƼ¼ÇÀ¸·Î »ç¿ë
Last default value 130
Command ( m for help ) :
n =>
ÀÌÁ¦, È®ÀåÇü ÆÄƼ¼ÇÀ» ¸¸µé °ø°£À» ÁöÁ¤ÇßÀ¸´Ï ³í¸® ÆÄƼ¼ÇÀ» »ý¼ºÇÏÀÚ~!!
Command action
l logical ( 5 or over )
p primary
partition ( 1 - 4 )
l¡ºEnter¡»=> ¿ì¸®°¡ ¸¸µé°íÀÚ ÇÏ´Â °ÍÀº ³í¸® ÆÄƼ¼ÇÀ̹ǷÎ..
"l"À» ¼±ÅÃ.. (³í¸® ÆÄƼ¼ÇÀº ÆÄƼ¼Ç ¹øÈ£°¡ 5¹ø ÀÌ»óºÎÅÍ ¸¸µé¾îÁø´Ù.)
First cylinder ( 20 -130, default 20 ) : ¡ºEnter¡» => »ç¿ë°¡´ÉÇÑ Ã¹¹ø° ½Ç¸°´õºÎÅÍ ¾µ °ÍÀ̹ǷΠ±âº»°ª ( óÀ½ °ª )À» »ç¿ë
Using default value 20
Last cylinder or +size or +sizeM or +sizeK ( 20 -130, default 130 ) : +50M
=> ù¹ø°·Î »ç¿ëÇÒ ÆÄƼ¼ÇÀÇ °ø°£ ÁöÁ¤
Command ( m for help )
: l =>
¿ì¸®°¡ ÇÒ °ÍÀº LVMÀ̹ǷΠÆÄÀÏ ½Ã½ºÅÛ Å¸ÀÔÀ» "Linux LVM"À¸·Î »ç¿ëÇØ¾ß ÇÑ´Ù.
º¯°æÇϱâ Àü¿¡
"Linux LVM"ÀÇ ÄÚµå ¹øÈ£¸¦ ¾Ë ÇÊ¿ä°¡ ÀÖÀ¸¹Ç·Î "l"´·¯¼ È®ÀÎÇÏÀÚ
=> ¿ì¸®´Â ¿©±â¼
"Linux LVM"ÀÇ Äڵ尡 "8e"¶ó´Â °ÍÀ» È®ÀÎÇÒ ¼ö ÀÖ´Ù.
Command
( m for help ) :
t =>
Äڵ嵵 È®ÀÎ ÇßÀ¸´Ï ½ÇÁúÀûÀ¸·Î º¯°æÀ» Çغ¸µµ·Ï ÇÏÀÚ~~!
Partition Number ( 1 - 5 ) : 5 => ¹æ±ÝÀü¿¡ ¸¸µç ³í¸® ÆÄƼ¼ÇÀº 5¹ø ÀÌ»óÀ̹ǷÎ, ¹æ±Ý »ý¼ºµÈ ³í¸® ÆÄƼ¼ÇÀÇ ¹øÈ£´Â 5¹øÀÌ´Ù.
Hex
code ( type L to list codes ) : 8e => ¿ì¸®°¡ ¹æ±ÝÀü¿¡ ÄÚµå °ªÀ» È®ÀÎ ÇßÀ¸´Ï ±× °ªÀ» ÀÔ·ÂÇÏÀÚ~!
Changed system type of partition 5 to 8e ( Linux LVM ) => "Linux LVM"À¸·Î ÆÄÀÏ ½Ã½ºÅÛÀ» º¯°æÇß´Ù´Â ¸Þ½ÃÁö´Ù.
Command ( m for help ) : p => Àß »ý¼ºµÇ¾ú´ÂÁö Å×À̺í·Î È®ÀÎÇغ¸ÀÚ~!!
±×·¯¸é "Linux LVM"ÇüÅ·ΠÀß ¸¸µé¾î Á³´Ù´Â °ÍÀ» È®ÀÎ ÇÒ ¼ö ÀÖ´Ù.
Command ( m for help ) : w => Á¦´ë·Î ¸¸µé¾îÁ³´ÂÁö È®ÀÎÇßÀ¸¸é ÀúÀåÇÏÀÚ~~! (ºüÁ®³ª¿ÍÁø´Ù. )
¡Ø ÀÌ·±½ÄÀ¸·Î ÆÄƼ¼ÇÀº ÃÑ 3°³¸¦ ¸¸µé¾î 50M , 100M, 150M ÀÌ·¸°Ô 3°³ÀÇ Linux LVMÇüÅ·Πº¯Çü½ÃÅ°ÀÚ~~!
(
À§ÀÇ ³»¿ë¿¡¼ Á¶±Ý¾¿¸¸ ¼öÁ¤Çϸé ÃæºÐÈ÷ È¥ÀÚ¼µµ °¡´ÉÇÑ ÀÏÀ̹ǷÎ... ´Ù½Ã ¾ð±Þ ÇÏÁö ¾Êµµ·Ï ÇÏ°Ú´Ù. )
root@localhost ~ ]# pvcreate /dev/sdb5 => "sdb5"ÆÄƼ¼ÇÀ» ¹°¸®ÀûÀÎ º¼·ýÀ¸·Î º¯°æ½Ãų¶§
"pvcreate"¶ó´Â ¸í·É¾î »ç¿ë
root@localhost ~ ]# pvcreate /dev/sdb6 => "sdb6"ÆÄƼ¼ÇÀ» ¹°¸®ÀûÀÎ º¼·ýÀ¸·Î º¯°æ. ( ¼º°ø ¸Þ½ÃÁö È®ÀÎ )
root@localhost ~ ]# pvcreate /dev/sdb7 => "sdb7"ÆÄƼ¼ÇÀ» ¹°¸®ÀûÀÎ º¼·ýÀ¸·Î º¯°æ.
root@localhost~ ]# vgcreate myVG /dev/sdb5 /dev/sdb6 /dev/sdb7
=>
¹°¸®ÀûÀÎ º¼·ýÀ» º¼·ý±×·ìÀ¸·Î ¹¾îÁÖ´Â ÀÛ¾÷ÀÌ´Ù. ÀÌ ¸í·ÉÀ» ¼öÇà½ÃÅ°¸é
"myVG"¶ó´Â º¼·ý±×·ìÀÌ »ý¼ºµÇ¾ú´Ù´Â ¸Þ½ÃÁö°¡ ¶á´Ù.
root@localhost ~ ]# vgdisplay => º¼·ý±×·ìÀÇ À̸§°ú Å©±âµîÀ» º¸¿©ÁØ´Ù.
=> À§ÀÇ ±×¸²°ú °°ÀÌ º¸¿©Áö°Ô µÈ´Ù.
root@localhost ~ ]# lvcreate -L 340M -n myLG myVG => "-L"´ÙÀ½¿¡´Â Å©±â¸¦ ÁöÁ¤ÇÏ´Â ¿©±â¼ Å©±â´Â "VG size"º¸´Ù
1~2
MÁ¤µµ ÀÛ°Ô ¸¸µå´Â °ÍÀÌ ÁÁ´Ù. ±×¸®°í "-n"´ÙÀ½¿¡´Â º¼·ý ÆÄƼ¼Ç À̸§°ú º¼·ý ±×·ì À̸§ÀÌ ³ª¿Í¾ß ÇÑ´Ù.
( º¼·ý ±×·ì À̸§Àº ¹æ±Ý »ý¼ºÇÑ VG name°ú µ¿ÀÏÇØ¾ß ÇÑ´Ù. )
=> ±×·³ ³í¸® º¼·ýÀÎ "myLG"°¡ »ý¼ºµÇ¾ú´Ù´Â ¸Þ½ÃÁö°¡ ³ª¿Â´Ù.
root@localhost ~ ]# lvdisplay => ³í¸® º¼·ýÀÇ Á¤º¸¸¦ º¸¿©ÁØ´Ù. ( À̸§À̳ª Å©±âµî... )
root@localhost ~ ]# mkfs.ext3 /dev/myVG/myLG => "mkfs"¸¦ ÀÌ¿ëÇؼ Æ÷¸ËÀ» Çϴµ¥, °æ·Î´Â "LV
Name"ÀÇ °æ·Î¸¦
Àû¾îÁÖ¸é µÈ´Ù.
root@localhost ~ ]# mkdir
/lvmdata
=> LVMÀ¸·Î ¸¸µç ÆÄƼ¼ÇÀ» ¸¶¿îÆ®ÇÒ µð·ºÅ丮¸¦ »ý¼ºÇÑ´Ù.
root@localhost ~ ]# mount -t ext3 /dev/myVG/myLG /lvmdata => ÀÌÁ¦ ¸¶¿îÆ®¸¦ ½ÃÄѺ¸ÀÚ~~~
root@localhost ~ ]# df -h => ¿ë·®À» È®ÀÎÇÏÀÚ.... ( "dev/mapper/myVG-myLG"¶ó´Â ÀåÄ¡¸íÀ¸·Î ³ª¿À°í, Å©±âµµ ³ª¿Â´Ù.)
¡Ü LVM Áö¿ï¶§~~
root@localhost ~ ]# umount /lvmdata => ÀÏ´Ü ¸¶¿îÆ®µÈ LVMÀ» ÇØÁ¦½ÃÅ°ÀÚ
root@localhost ~ ]# lvremove /dev/myVG/myLG => LVMÀÇ ³í¸® º¼·ýÀ» Áö¿ì´Â ¸í·É¾î·Î "lvremove"À» »ç¿ëÇÑ´Ù.
root@localhost ~ ]# vgremove myVG => º¼·ý±×·ìÀ» Áö¿ì´Â ¸í·É¾î·Î "vgremove"¸¦ »ç¿ëÇÑ´Ù.
[Ãâó] LVM ( Logical Volume Manager )|ÀÛ¼ºÀÚ Á¤ÇöÀÌ