File system
- File systemÀ̶õ?
ÆÄÀϽýºÅÛ(filesystem)À̶õ ¿î¿µÃ¼Á¦°¡ ÆÄƼ¼ÇÀ̳ª µð½ºÅ©¿¡ ÆÄÀϵéÀÌ ¿¬¼ÓµÇ°Ô Çϱâ À§ÇØ »ç¿ëÇÏ´Â ¹æ¹ýÀÌ°í ÀڷᱸÁ¶ÀÌ´Ù. Áï, ÆÄÀϵéÀÌ µð½ºÅ©»ó¿¡¼ ±¸¼ºµÇ´Â ¹æ½ÄÀÌ´Ù. ÆÄÀϽýºÅÛÀ̶ó´Â ¸»Àº ÆÄÀÏÀ» ÀúÀåÇϴµ¥ »ç¿ëµÇ´Â ÆÄƼ¼ÇÀ̳ª µð½ºÅ©¸¦ °¡¸®Å³ ¶§³ª, ÆÄÀÏ ½Ã½ºÅÛÀÇ Çü½ÄÀ» °¡¸®Å³ ¶§ »ç¿ëµÇ±âµµ ÇÑ´Ù. file systemÀº mount¶õ ´Ü°è¸¦ °ÅÃļ ƯÁ¤ block device¸¦ »ç¿ëÇÒ ¼ö ÀÖ°Ô ÇØÁÖ´Â °ÍÀÔ´Ï´Ù.
- File systemÀÇ ±¸Á¶
partition |
partition |
partition |
Disk drive
Boot block |
Super block |
Inode list |
Data block |
File system
• boot block : file systemÀÇ Ã³À½¿¡ À§Ä¡. operation systemÀÌ Ãʱâȵǰųª ºÎÆÃµÉ ¶§, ÇÊ¿äÇÑ bootstrap Äڵ带 Æ÷ÇÔÇÏ°í ÀÖ´Ù. ½Ã½ºÅÛÀÌ ºÎÆõDZâ À§Çؼ´Â ´ÜÁö ÇϳªÀÇ ºÎÆ® ºí·ÏÀÌ ÇÊ¿äÇϸç, ¸ðµç ½Ã½ºÅÛ¿¡´Â ºÎÆ® ºí·ÏÀÌ ÀÖ¾î¾ß ÇÑ´Ù.
• super block : filesystem¿¡ ´ëÇÑ ¸ðµç Áß¿äÇÑ Á¤º¸¸¦ ÀúÀåÇÏ´Â °÷ÀÌ´Ù. file systemÀÌ ¾ó¸¶³ª Å«Áö, ¾ó¸¶³ª ¸¹Àº ÆÄÀÏÀ» ÀúÀåÇÒ ¼ö ÀÖ´ÂÁö, ÀÚÀ¯ ÀúÀå°ø°£À» ¾îµð¿¡¼ ã¾Æ¾ß ÇÏ´ÂÁö µîÀÇ ´Ù¾çÇÑ Á¤º¸¸¦ Æ÷ÇÔÇÏ°í ÀÖ´Ù. ¿©±â¿¡ µé¾î°¡´Â Á¤º¸´Â ÆÄÀϽýºÅÛ¿¡ ÀÇÁ¸ÇÑ´Ù.
• inode list : ÆÄÀÏ ½Ã½ºÅÛÀ̶ó´Â °ÍÀº inode(index node)¶ó´Â ÇüÅÂÀÇ Á¤º¸·Î ÀúÀåµÈ´Ù. inode´Â Ç׸ñ(ÆÄÀÏ, µð·ºÅ丮, ½Éº¼¸¯ ¸µÅ©) ÀÚüÀÇ À̸§À» Á¦¿ÜÇÏ°í´Â ´Ù¸¥ ¸ðµç ÆÄÀϽýºÅÛÀ» ÀúÀåÇÑ´Ù. ÆÄÀÏÀ̸§Àº µð·ºÅ丮¿¡ ÀúÀåµÇ¸ç ÀÌ´Â inodeÀÇ Æ÷ÀÎÅÍ·Î ÀÌ¿ëµÈ´Ù. Inode list ´Â inodeµéÀÇ ¸®½ºÆ®À̸ç, °ü¸®ÀÚ¿¡ ÀÇÇØ ±× Å©±â°¡ º¯°æµÉ ¼ö ÀÖ´Ù. ÆÄÀÏ ½Ã½ºÅÛÀÇ ¸ðµç ÆÄÀÏÀ̳ª µð·ºÅ丮´Â °¢±â ´Ü ÇϳªÀÇ inode¿¡ ÀÇÇÏ¿© Ç¥ÇöµÈ´Ù. ¸®½ºÆ®¿¡¼ ÇÑ inode´Â root inode·Î file systemÀ» mount ½ÃŲ ÀÌÈÄ¿¡ Á¢±Ù °¡´ÉÇÏ°Ô µÈ´Ù.
• data block : ÆÄÀÏ µ¥ÀÌÅÍ¿Í °ü¸® µ¥ÀÌÅ͸¦ ÀúÀåÇÏ°í ÀÖ´Â ºÎºÐÀÌ´Ù. °¢°¢ÀÇ µ¥ÀÌÅÍ ºí·ÏÀº Çѹø¿¡, ´ÜÁö ÇϳªÀÇ ÆÄÀÏ¿¡¸¸ ÇÒ´çµÉ ¼ö ÀÖ´Ù.
Raw Device
- Raw Device¶õ?
Raw device´Â file systemÀÌ set up µÇÁö ¾ÊÀº disk driveÀÌ´Ù. Raw Device´Â µ¥ÀÌÅͺ£À̽º¿Í °°ÀÌ ÁÖ·Î ÀڽŵéÀÇ Ä³½Ì ½Ã½ºÅÛÀ» °®°í ÀÖ´Â °æ¿ì¿¡ ¼ºñ½º ÇÁ·Î±×·¥¿¡¼ ¸¹ÀÌ »ç¿ëÇÑ´Ù. ¿î¿µÃ¼Á¦ÀÇ Ä³½Ì ½Ã½ºÅÛÀº ÀϹÝÀûÀÎ »óȲ¿¡¼´Â ¼º´É¿¡ Áö´ëÇÑ ¿µÇâÀ» ¹ÌÄ¡Áö¸¸ µ¥ÀÌÅͺ£À̽º µî¿¡¼´Â ÀÌ¹Ì ÀÚ½ÅÀÇ ¹æ½ÄÀ¸·Î ij½ÌÀ» Çϱ⠶§¹®¿¡ µÎ¹øÀÇ Ä³½ÌÀ¸·Î ÀÎÇØ ºÎÇÏ°¡ »ý±æ ¼ö ÀÖ´Ù. ±×·¯¹Ç·Î ¿î¿µÃ¼Á¦°¡ Áö¿øÇÏ´Â ºÎºÐÀ» »ç¿ëÇÏÁö ¾Ê°Ô Çϱâ À§Çؼ raw device¸¦ »ç¿ëÇÑ´Ù. ¶ÇÇÑ µÎ ´ë ÀÌ»óÀÇ machine°ú ÀÌ machineµéÀÌ °øÀ¯ÇÏ°í ÀÖ´Â disk·Î ±¸¼ºµÇ´Â OPSÀÇ °æ¿ì, shared disk¸¦ os file systemÀ¸·Î ±¸¼ºÇϸé ÇÑÂÊ¿¡¼¸¸ À̸¦ º¼ ¼ö ÀÖ°í µ¿½Ã¿¡ accessÇÏ´Â °ÍÀÌ ºÒ°¡´ÉÇÏ´Ù. ±×·¯¹Ç·Î raw device¸¦ »ç¿ëÇØ¾ß Çϸç, raw device¸¦ »ç¿ëÇϸé os¸¦ °ÅÄ¡Áö ¾ÊÀ¸¹Ç·Î º¸´Ù ºü¸¥ access¸¦ ±â´ëÇÒ ¼ö ÀÖ´Ù.
• ÀåÁ¡
1. Raw Device´Â os¿¡ mountµÇÁö ¾ÊÀº µð½ºÅ©À̹ǷΠos kernel¿¡ ÀÇÇØ bufferingÀÌ µÇÁö ¾Ê°í user buffer¿Í device°£¿¡ Á÷Á¢ data°¡ Àü¼ÛµÇ¹Ç·Î disk I/O ¼º´ÉÀÌ Çâ»óµÇ°í cpu overhead°¡ °¨¼ÒµÈ´Ù.
2. os file systemÀÇ overhead¸¦ ÇÇÇÒ ¼ö ÀÖ´Ù.
3. os buffer size¸¦ ÁÙÀÏ ¼ö ÀÖ´Ù.
• ´ÜÁ¡
1. setup Çϱ⠾î·Æ°í backup ÀýÂ÷°¡ file system º¸´Ù º¹ÀâÇÏ´Ù.
2. raw device¿Í os fileÀ» È¥ÇÕÇÏ¿© »ç¿ëÇÒ °æ¿ì os fileÀº ulimit parameterÀÇ size º¸´Ù ÀÛ¾Æ¾ß ÇÑ´Ù. µû¶ó¼ ulimit¸¦ ÃÊ°úÇÏ´Â tableµéÀº raw device¸¦ »ç¿ëÇÏ¿©¾ß ÇÑ´Ù.
3. os´Â cylinder 0À» º¸È£ÇÏÁö ¸øÇϱ⠶§¹®¿¡ cylinder 0¿¡¼ ½ÃÀÛÇÏ¸é ¾ÈµÈ´Ù.
- raw device ¿î¿µ½Ã ÁÖÀÇ»çÇ×
¿¹>
crw-rw---- 1 oraerp01 dba 64 0x090001 May 15 14:07 rlvabmd01.dbf
crw-rw---- 1 oraerp01 dba 64 0x090002 May 15 14:07 rlvabmx01.dbf
crw-rw---- 1 oraerp01 dba 64 0x090003 May 15 14:07 rlvahld01.dbf
logical volume È®ÀÎ
lvdisplay –v lvpath
¿¹> THVSD01:/dev/vgdbmst2> lvdisplay -v lvctrl1
partitoin °³¼ö ¹× size °áÁ¤
oracle data file : device = 1 : 1
device size = oracle file size + a (a : ´ë·« 1M Á¤µµ. header Á¤º¸ º¸°ü)
ÇâÈÄ DB°¡ ´Ã¾î³¯ °ÍÀ» °¨¾ÈÇÏ¿© size º° raw device¸¦ ¹Ì¸® »ý¼ºÇصдÙ.
file systemÀÇ fileÀ» raw device ·Î ¿Å±â´Â ¹æ¹ý : dd if = file¸í of = raw device¸í
¿¹>
dd bs=20480 if=/DBMS/orarac/oradata/RAC/rlvsystem01.dbf of=/dev/vgdbmsg1/rlvsystem01.dbf
dd bs=20480 if=/DBMS/orarac/oradata/RAC/rlvtemp01.tmf of=/dev/vgdbmsg1/rlvtemp01.tmf
dd bs=20480 if=/DBMS/orarac/oradata/RAC/rlvtools01.dbf of=/dev/vgdbmsg1/rlvtools01.dbf
raw device¸¦ file·Î copyÇÏ´Â ¹æ¹ý : dd if = raw device¸í of = file¸í
¿¹>
dd bs=20480 if=/dev/vgdbmsg1/rlvsystem01.dbf of=/DBMS/orarac/oradata/RAC/rlvsystem01.dbf
dd bs=20480 if=/dev/vgdbmsg1/rlvtemp01.tmf of=/DBMS/orarac/oradata/RAC/rlvtemp01.tmf
dd bs=20480 if=/dev/vgdbmsg1/rlvtools01.dbf of=/DBMS/orarac/oradata/RAC/rlvtools01.dbf