· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Linuxdoc Sgml/Ext2fs-Undeletion

Ext2fs º¹±¸ ¹Ì´Ï-ÇÏ¿ìÅõ

Ext2fs º¹±¸ ¹Ì´Ï-ÇÏ¿ìÅõ

By Aaron Crane < aaronc@pobox.com>

1997³â 1¿ù 18ÀÏ Åä¿äÀÏ, v1.0 ¹ø¿ªÀÚ : ¹ÚÀº¿µ < pey1@nownuri.net > ¹ø¿ªÀÏ : 1997³â 5¿ù 8ÀÏ ¸ñ¿äÀÏ
¹ø¿ªÁÖ : ¿ì¼± ¸®´ª½º¸¦ Á¦´ë·Î ¾²Áöµµ ¸øÇÏ´Â Ãʺ¸°¡ ±×°Íµµ ªÀº ¿µ¾î ½Ç·ÂÀ¸·Î ÇÏ¿ìÅõ ¹ø¿ª¿¡ Âü°¡ÇÏ´Â Á¡À» ºÎ²ô·´°Ô »ý°¢Çϸç, ext2 ¿¡¼­ »èÁ¦µÈ È­ÀÏÀÇ º¹±¸ ¹æ¹ýÀ» ¼³¸íÇÑ ÀÌ ¹Ì´Ï ÇÏ¿ìÅõ¸¦ µÎ ºÎºÐÀ¸·Î ³ª´©¾î ¿Ã¸³´Ï´Ù.(1Æí: óÀ½ 8Àå / 2Æí: 9Àå ³¡ ÀÌ·¸°Ô µÑ·Î ³ª´®) ¸¸¾à ¿À¿ªÀÌ µÇ¾î ¼öÁ¤ÇÒ ºÎºÐÀÌ ÀÖ´Ù¸é ¼­½¿Ä¡ ¸¶½Ã°í À§¿¡ ÀûÈù Á¦ ÁÖ¼Ò·Î ¸ÞÀÏ Áֽøé Áï½Ã °íÄ¡°Ú½À´Ï´Ù.

1. µé¾î°¡¸é¼­

ÀÌ ¹Ì´Ï ÇÏ¿ìÅõ ¹®¼­´Â ext2 È­ÀÏ ½Ã½ºÅÛ¿¡¼­ Áö¿öÁø È­ÀÏÀ» º¹±¸ÇÏ´Â ¹æ¹ýÀ» ¾Ë·Á ´ëºñÇÏ°Ô Çϱâ À§ÇØ ÀÛ¼º µÇ¾ú´Ù. ÀÌ ¹®¼­´Â ¶ÇÇÑ ¿ì¼±ÀûÀ¸·Î ¾î¶»°Ô Çϸé È­ÀÏ »èÁ¦¸¦ ÇÇÇÏ´ÂÁö¿¡ ´ëÇÑ ³íÀǵ鿡 ÇÑÁ¤µÇ¾î ÀÖ´Ù.

³ª´Â ÀÌ ±ÛÀ» 'rm' À¸·Î ÀÎÇØ ¹®Á¦°¡ ÀÖ´Â »ç¶÷µé¿¡°Ô È®½ÇÇÑ µµ¿òÀ» ÁÖ·Á´Â Àǵµ·Î ÀÛ¼ºÇßÁö¸¸ - ¾ðÁ¨°¡ ¿©±â ÀÖ´Â ¾à°£ÀÇ Á¤º¸·Î À§ÇèÀ» ¸éÇÒ ¼ö ÀÖÀ»Áöµµ ¸ð¸£´Â ÀÏÀÌ´Ï - ¾Æ¹«Æ° ¿©·¯ »ç¶÷µéÀÌ ÀÐ¾î º¸±â¸¦ ¹Ù¶õ´Ù.

ÀÌ ¹®¼­´Â ÀϹÝÀûÀÎ À¯´Ð½º È­ÀÏ ½Ã½ºÅÛ¿¡ ´ëÇÑ ¾à°£ÀÇ ¹è°æÁö½ÄÀ» °¡Á¤ÇØ ÀÛ¼ºµÇ¾úÁö¸¸ ´ëºÎºÐÀÇ ¸®´ª½º »ç¿ëÀڵ鿡°Ô ½±°Ô ÀÌÇØµÇ±æ ¹Ù¶õ´Ù. ¸¸¾à ¾ÆÁÖ Ãʺ¸ÀÚ¶ó¸é ¸®´ª½º üÁ¦ ÇÏ¿¡¼­ È­ÀÏÀ» º¹±¸ÇÏ´Â °ÍÀº ´çºÐ°£ ±â¼úÀû Áö½Ä°ú ²ö±â µîµîÀÌ ²À ÇÊ¿äÇÏ´Ù.

Àû¾îµµ È­ÀÏÀÌ ÀúÀåµÈ raw device¿¡ read access ¾øÀÌ ext2 È­ÀÏ ½Ã½ºÅÛ¿¡¼­ Áö¿öÁø È­ÀÏÀ» º¹±¸ÇÏ´Â °ÍÀº ºÒ°¡´ÉÇÒ °ÍÀÌ´Ù. ÀϹÝÀûÀ¸·Î ÀÌ°ÍÀº ·çÆ®¿©¾ß¸¸ ÇÑ´Ù´Â °ÍÀ» ÀǹÌÇÑ´Ù. ¶ÇÇÑ 'e2fsprogs' ÆäÅ°ÁöÀÇ 'debugfs'°¡ ÇÊ¿äÇѵ¥ ÀÌ´Â ±¸ºÐÇؼ­ ¼³Ä¡ÇßÀ» °ÍÀÌ´Ù. ³»°¡ ÀÌ ±ÛÀ» ¾²´Â ÀÌÀ¯´Â ³» ÀÚ½ÅÀÌ ÁÖ·Î ·çÆ®¿¡¼­ ¾î¸®¼®°í ºñÂüÇÏ°Ô 'rm -r' ¸í·ÉÀ» »ç¿ëÇÑ °æÇè¿¡¼­ ³ª¿Â °ÍÀÌ´Ù. ³­ ³»°Ô ÇÊ¿äÇÑ 97°³¿¡ ´ÞÇÏ´Â JPEG È­ÀÏÀ» Áö¿ü¾ú´Âµ¥ ´Ù¸¥ ¼Ò½º·ÎºÎÅ͵µ °ÅÀÇ º¹±¸°¡ ºÒ°¡´É Çß¾ú´Ù. ¾à°£ÀÇ µµ¿òµÇ´Â Á¤º¸¿Í ±²ÀåÇÑ Àγ»·Î ¼Õ»óµÇÁö ¾ÊÀº 91°³ÀÇ È­ÀÏÀ» º¹±¸ Çß¾ú°í, ³ª¸ÓÁö ´Ù¼¸ ºÎºÐµµ ¾Æ¹«Æ° µÂã¾Ò´Ù. ´ÜÁö Çϳª°¡ º¸±â ºÒ°¡´É Çß¾ú´Âµ¥ À̸¶Àú 1024 ¹ÙÀÌÆ®¿¡ Áö³ªÁö ¾Ê´Â ºÎºÐ¸¸ ÀÒ¾î ¹ö·È´Ù.

ÀÌ¿¡ ³ª´Â ´õ ³ª°¡¼­ È­ÀÏÀ» »èÁ¦ÇßÀ»¶§ ±â´ëÇÒ ¸¸ÇÑ º¹±¸ ¹æ¹ýÀ» ¼³¸í ÇÏ°íÀÚ ÇÑ´Ù.

2. ¾î¶»°Ô Çϸé È­ÀÏÀ» Áö¿ìÁö ¾ÊÀ»±î

ÀÌ°ÍÀº MS-DOG º¸´Ù Linux ¿¡¼­ Ä¡¸íÀûÀÌ´Ù. Win95¸¦ Æ÷ÇÔÇÑ MS-DOG´Â ÀϹÝÀûÀ¸·Î »èÁ¦µÈ È­ÀÏÀÌ »ó´çÈ÷ ¿Ïº®ÇÏ°Ô º¹±¸µÈ´Ù -- ½ÉÁö¾î ÀÌ ¿î¿µ üÁ¦´Â º¹±¸°úÁ¤ ´ëºÎºÐÀÌ ÀÚµ¿È­µÈ À¯Æ¿¸®°¡ ÀÖ´Ù. Linux ¿¡¼­ ÀÌ·± °æ¿ì´Â ÀÖÀ» ¼ö ¾ø´Ù. ±×·¯¹Ç·Î ´ç½ÅÀÌ ±â¾ïÇØ¾ß ÇÒ ÃÖ°íÀÇ ¹ýÄ¢À̸ç Á¦ÀÏÀÇ ¹ýÄ¢Àº : ¾î¶² ÀÏÀÌ À־

*** ¹é¾÷À» ÇÏ´Â °ÍÀÌ´Ù *** ÀÌ°Ô ¸»Çϱâ´Â ÁÁÀº °ÍÀÎ ÁÙ ¾È´Ù. ´ÜÁö ³ª´Â ¸ðµç ¸®´ª½º »ç¿ëÀÚµéÀÌ ³ª°¡¼­ À¯¿ëÇÑ ¹é¾÷ ÀåÄ¡¸¦ ±¸ÀÔÇÏ°í ÀûÀýÇÑ ¹é¾÷ °èȹÀ» ¼¼¿ö ¹é¾÷¿¡ Ãæ½ÇÇ϶ó´Â °ÍÀ» ±ÇÇÑ´Ù. ÀÌ¿¡ ´ëÇÑ ÀÚ¼¼ÇÑ »çÇ×Àº Frisch(1995)¸¦ Âü°íÇضó. ¹é¾÷ÀÌ ¾ÊµÇ¸é ¾î¶»°Ô ÇÒ °ÍÀΰ¡?

Áß¿ä È­ÀÏÀÇ permissionsÀ» 440À̳ª ±×º¸´Ù Àû°Ô µÖ¶ó: ¸¸¾à ÀÚ½ÅÀÌ accessÇϱ⠰źÎÇÑ´Ù¸é 'rm'Àº Áö¿ì±â Àü¿¡ È®½ÇÇÑ È®ÀÎÀÌ ÇÊ¿äÇÏ´Ù. (±×·¯³ª ³ª´Â 'rm -r'·Î µð·ºÅ丮 »èÁ¦½Ã ¿ì¼± ÇÁ·Î±×·¥À» Áß´ÜÇÏ°í È®ÀÎÇÑ ´ÙÀ½ 'rm -rf' ¸í·ÉÀ» Àç½ÇÇà ÇÒ °ÍÀ» ¹ß°ßÇß´Ù)

¼±ÅÃµÈ È­ÀÏÀ» À§ÇÑ ÁÁÀº ¹æ¹ýÀº ¼ûÀº µð·ºÅ丮 ¾È¿¡ ÇÏµå ¸µÅ©¸¦ ¸¸µå´Â °ÍÀÌ´Ù. ¾ðÁ¨°¡ ³ª´Â /etc/passwd ¸¦ »ç°í·Î ÀÎÇØ ¹Ýº¹ÀûÀ¸·Î Áö¿ì°í ±×°Í ¶§¹®¿¡ ½Ã½ºÅÛÀÇ ¹ÝÀ» ³¯¸° sysadmin ¿¡ ´ëÇÑ À̾߱⸦ µéÀº ÀûÀÌ ÀÖ´Ù. À̸¦ °íÄ¡´Â °ÍÀº ·çÆ®¿¡¼­ ´ÙÀ½°ú °°ÀÌ ÇÏ¸é µÈ´Ù.

    # mkdir /.backup
    # ln /etc/passwd /.backup     

¿Ïº®È÷ Á¢±ÙÇؼ­ È­ÀÏÀ» Áö¿ì´Â °ÍÀº »ç½Ç»ó ¸¹Àº ³ë·ÂÀÌ ÇÊ¿äÇÏ´Ù. ¸¸¾à ´ÙÀ½°ú °°ÀÌ ÇÏ°í

    # rm /etc/passwd
 
±×¸®°í ³ª¼­
    # ln /.backup/passwd /etc
ÀÌ·¸°Ô Çϸé À§¿¡¼­ Áö¿ü´ø °ÍÀÌ º¹±¸µÉ °ÍÀÌ´Ù. ¹°·Ð ÀÌ°ÍÀº È­ÀÏ¿¡ µ¤¾î¾²±â¸¦ ÇßÀ»¶§´Â ¼Ò¿ëÀÌ ¾ø´Ù.±×·¯¹Ç·Î ¾Æ¹«Æ° ¹é¾÷À» ÇØ¾ß ÇÑ´Ù. ¸î¸î »ç¶÷µéÀº ÀÏ¸í ½©À̳ª ÇÔ¼ö¿¡¼­ 'rm'À» 'rm -i'·Î ¸¸µé°ÍÀ» ÁÖÀåÇÑ´Ù.('rm -i'´Â ¸ðµç »èÁ¦ÇÒ È­ÀÏ È®ÀÎÇØ ¹¯´Â °ÍÀÌ´Ù) °³ÀÎÀûÀ¸·Î ³ª´Â ¼ÒÇÁÆ®¿þ¾î´Â ºÎÁÖÀÇ ÇÏ°Ô ¿î¿µÇÏÁö ¾ÊÀ» °ÍÀÌ´Ù ¶ó´Â ÀÔÀå¿¡ ÀÖÁö ¾Ê¾Æ¼­ ±×·¸°Ô ÇÏÁö ¾Ê´Â´Ù.

¶ÇÇÑ ¸ÓÁö ¾Ê¾Æ¼­³ª ³ªÁßÀ̳ª, ´ç½ÅÀÌ ÇÑ»ç¶÷¸¸ÀÇ ¸ðµå¸¦ ¿î¿µÇÏ°Ç, ´Ù¸¥ ½©À» »ç¿ëÇÏ°Ç È¤Àº ´Ù¸¥ ±â°è¸¦ »ç¿ëÇÏ°Ç ¾îµð¼­³ª ´ç½ÅÀÇ 'rm' ÇÔ¼ö´Â Á¸ÀçÇÏÁö ¾Ê´Â´Ù´Â °ÍÀÌ ¹®Á¦Á¡ÀÌ´Ù. ¸¸¾à È­ÀÏ »èÁ¦½Ã ÀÏÀÏÈ÷ È®ÀÎÇØ ¹°¾îÁֱ⸦ ¹Ù¶õ´Ù¸éÀº »èÁ¦ È­ÀÏÀÌ ³Ê¹« ¸¹¾Æ¼­ ÁöÁ¤ÇÒ ¼ö ¾ø°í ¾îµð¿¡ ÀÖ´ÂÁö Àر⠽±´Ù.

'rm' ¸í·ÉÀÇ ¾î¶°ÇÑ º¯Çü ¾øÀÌ »ç¿ëÇÏ´Â °ÍÀ» Á¦¿ÜÇÑ Á»´õ ³ªÀº ÇØ°áÃ¥Àº Àç»ý °¡´ÉÇÑ »èÁ¦ ÆäÅ°Áö¸¦ »ç¿ëÇϱ⠽ÃÀÛÇÏ´Â °ÍÀÌ´Ù. ÀÌ¿¡ ´ëÇØ ÀÚ¼¼ÇÑ °ÍÀº Peek, et al(1993)À» Âü°íÇ϶ó.

3. ¾ó¸¶ ¸¸Å­ÀÇ º¹±¸¸¦ ±â´ëÇÒ ¼ö ÀÖÀ»±î?

±×°Ç ³ª¸§´ë·ÎÀÌ´Ù. Linux¿Í °°Àº High-quality, Multi-tasking, Mult-user ¿¡¼­ È­ÀÏ º¹±¸½Ã ¹®Á¦´Â ¾ðÁ¦ ´©°¡ µð½ºÅ©¿¡ ±â·ÏÇϱ⸦ ¿øÇÏ´ÂÁö ¸ð¸£´Â °ÍÀ̶ó´Âµ¥ ÀÖ´Ù. ±×·¡¼­ ¿î¿µÃ¼Á¦¿¡¼­ È­ÀÏ »èÁ¦¸¦ ¸í·É½Ã, ÀÌ´Â È­ÀÏÀÌ »õÈ­ÀÏÀÇ Àå¼Ò ÇÒ´çÀ» ¿øÇÒ¶§ °øÆòÇÏ°Ô²û ºí·°ÀÌ »ç¿ë µÈ´Ù°í °¡Á¤ÇÑ´Ù. ÀϹÝÀûÀ¸·Î ÄÄÇ»ÅÍ »ç¿ëÀÚ°¡ ¸¹¾ÆÁú¼ö·Ï ¼º°øÀûÀ¸·Î È­ÀÏÀ» º¹±¸ÇÒ ¼ö ÀÖ´Â °¡´É¼ºÀº Àû¾îÁø´Ù.

¶ÇÇÑ µð½ºÅ© ÆļÕÀº È­ÀÏ º¹±¸¸¦ ¿ëÀÌÇÏ°Ô ÇÏ´Â È¿°ú¸¦ °¡Á®¿Ã ¼ö ÀÖ´Ù. ¸¸¾à ÆÄƼ¼ÇÀ» Æ÷ÇÔÇØ È­ÀÏÀÌ Áö¿öÁø °Å¶ó¸é ³Ê¹« ÆÄ¼ÕµÈ °ÍÀÌ¿©¼­ ¸ðµç È­ÀÏÀ» Àд °ÍÀº °ÅÀÇ ºÒ°¡´ÉÇÏ´Ù.

¸¸ÀÏ ÄÄÇ»ÅÍ°¡ ÀÚ½ÅÀÇ °Í°ú °°ÀÌ ½ÇÁ¦·Î sing-user workstation À̶ó¸é Ä¡¸íÀûÀÎ »èÁ¦°¡ ¾Æ´Ò½Ã »ó´çÈ÷ ³ôÀº ºñÀ²ÀÇ º¹±¸¸¦ ±â´ëÇÑ´Ù. ³ª´Â ¼Õ»óµÇÁö ¾ÊÀº ¹ÙÀ̳ʸ® È­ÀÏÀÇ °ÅÀÇ 94%¸¦ ȸº¹ ½ÃŲ´Ù. ´ç½ÅÀÌ 80%³ª ±× ÀÌ»óÀ» °¡Áö°í ÀÖ´Ù¸é Àڽſ¡°Ô ²Ï ±â»ÝÀ» ´À³¥ °ÍÀÌ´Ù.

4. ±×·³ È­ÀÏÀ» ¾î¶»°Ô º¹±¸ ½ÃÅ°³ª?

´ëüÀûÀ¸·Î È­ÀÏ º¹±¸ ÀýÂ÷´Â raw partition device ¿¡¼­ µ¥ÀÌŸ¸¦ ¹ß°ßÇØ ±×°ÍÀ» ´Ù½Ã º¼¼ö ÀÖ°Ô Çؼ­ ¿î¿µÃ¼Á¦·Î °¡Á®°¡´Â °ÍÀ» ÀǹÌÇÑ´Ù. ÀÌ°ÍÀ» Çϴµ¥¿¡´Â ±âº»ÀûÀ¸·Î µÎ°¡Áö ¹æ¹ýÀÌ ÀÖ´Ù :

Çϳª´Â »èÁ¦µÈ inodes°¡ °¡Áö°í ÀÖ´Â 'deleted' flag ¸¦ Á¸ÀçÇÏ´Â È­ÀÏ ½Ã½ºÅÛÀ¸·Î º¯°æÇØ ±× ÀÚ·áµéÀÌ ±âÀûÀûÀ¸·Î ±×°÷¿¡ ¿À±æ ¹Ù¶ó´Â °ÍÀÌ´Ù. ¼Óµµ´Â ´ÊÁö¸¸ ¾ÈÀüÇÑ ´Ù¸¥ ¹æ¹ýÀº ÆÄƼ¼Ç¿¡ ÀÖ´Â ÀÚ·áµéÀ» °èȹÀ» ¼¼¿ö »õ·Î¿î È­ÀÏ¿¡ ¿Å°Ü ¾²´Â °ÍÀÌ´Ù.

4Àå 6Àå¿¡ °ÉÃÄ ÀÚ·á º¹±¸¸¦ ½ÃÀÛÇϱâ Àü¿¡ ÀÌÇØÇØ¾ß ÇÒ ´Ü°èµéÀ» »ó¼¼È÷ ¼³¸íÇßÀ¸¸ç 7Àå 10Àå¿¡ °ÉÃļ­´Â È­ÀÏ º¹±¸¹ýÀ» ¼³¸íÇÏ¿´´Ù.

5. Unmounting the Filesystem

¾î¶°ÇÑ ¹æ¹ýÀ» ¼±ÅÃÇÏ´ÂÁö¿¡ °ü°è ¾øÀÌ º¹±¸ÀÇ Ã¹Â° ´Ü°è´Â »èÁ¦µÈ È­ÀÏÀ» Æ÷ÇÔÇÑ È­ÀÏ ½Ã½ºÅÛÀ» unmount ÇÏ´Â °ÍÀÌ´Ù.

mountµÈ È­ÀÏ ½Ã½ºÅÛ¿¡¼­ ¾Æ¸¶µµ ½Ç¼öÇÒ °ÍÀÌ Æ²¸² ¾ø´Ù´Â ¾î¶² ÁÖÀåµµ °­ÇÏ°Ô ºÎÀÎÇÑ´Ù. ÀÌ ´Ü°è´Â È­ÀÏÀÌ »èÁ¦µÈ°É ¾È ÈÄ¿¡ °¡´ÉÇÑÇÑ »¡¸® ¼öÇàµÇ¾î¾ß ÇÑ´Ù.

°¡Àå °£´ÜÇÑ ¹æ¹ýÀº ´ÙÀ½°ú °°ÀÌ ÇÏ´Â °ÍÀÌ´Ù: Áö¿öÁø È­ÀÏÀÌ /usr partition ¿¡ ÀÖ´Ù °¡Á¤ÇÏ°í

     # umount /usr
±×·¯³ª /usr ¿¡ ÀÌ¿ëÇÒ ¼ö ÀÖ´Â °ÍÀ» µÎ±æ ¿øÇÒ¼öµµ ÀÖÀ¸¹Ç·Î ÀÌ°ÍÀ» read-only·Î remount ÇÑ´Ù:
     # mount -o ro,remount /usr
¸¸¾à root ¿¡¼­ È­ÀÏÀ» Áö¿ü´Ù¸é /etc/mtab ¿¡ ¾²¿©Áö´Â °ÍÀ¸·ÎºÎÅÍ mount¸¦ ¸·±âÀ§ÇØ '-n' option À» Ãß°¡ÇØ¾ß ÇÑ´Ù.
    # mount -n -o ro,remount /
ÀÌ ¸ðµç °ÍÀ» °³ÀÇÄ¡ ¾ÊÀº filesystemÀ» »ç¿ëÇÑ ´Ù¸¥ °úÁ¤ÀÌ °¡´ÉÇÏ´Ù. (ÀÌ´Â 'Resource busy' °°Àº ¿¡·¯ ¸Þ¼¼Áö·Î unmount ½ÇÆи¦ ÃÊ·¡ÇÑ´Ù) ÀÌ°ÍÀº ÁÖ¿öÁø È­ÀÏÀ̳ª mount point¸¦ »ç¿ëÇÑ ¾î¶² °úÁ¤¿¡°Ô¶óµµ ½ÅÈ£¸¦ º¸³»´Â ÇÁ·Î±×·¥ÀÌ´Ù: 'fuser'.

/usr partition ¿¡ ´ÙÀ½°ú °°ÀÌ Çغ¸ÀÚ.

    # fuser -v -m /usr
ÀÌ°ÍÀº ±× °úÁ¤¿¡ °ü·ÃµÈ °ÍÀ» ±â·ÏÇÑ´Ù. ±×°Íµé ¸ðµÎ Áß¿äÇÏÁö ¾Ê´Ù°í °¡Á¤ÇÏ°í ´ÙÀ½°ú °°ÀÌ ¸í·ÉÇØ SIGKILL °¢°¢ÀÇ °úÁ¤À» º¸³½´Ù.
    # fuser -k -v -m /usr
 ȤÀº ¿¹¸¦ µé¾î 
    # fuser -k -TERM -v -m /usr 
 °¢°¢ SIGTERM À» ÁØ´Ù.

6. Á÷Á¢ÀûÀ¸·Î inodes ¸¦ ¹Ù²Ü Áغñ¸¦ ÇÑ´Ù.

³ªÀÇ Ãæ°í´Â ÀÌ ¹æ¹ýÀ» ¾²Áö ¸»´Â °ÍÀÌ´Ù.. ³ª´Â Á¤¸» ÀÌ ÀÏÀ» Çϱ⿡ ¼öÁØÀÌ ³·Àº È­ÀÏ ½Ã½ºÅÛ¿¡¼­ ÀÛµ¿ÇÏ´Â °ÍÀ» Çö¸íÇÏ´Ù°í »ý°¢ÇÏÁö ¾Ê´Â´Ù. ¶ÇÇÑ ÀÌ´Â ¹Ì´þ°Ôµµ ´ÜÁö °¢ È­ÀÏÀÇ Ã¹¹ø° 12 blocks¸¸ º¹±¸ÇÒ ¼ö ÀÖ´Â ¹®Á¦Á¡ÀÌ ÀÖ´Ù. ±×·¯¹Ç·Î ±ä È­ÀÏÀ» º¹±¸ ÇÒ·Á¸é ¾Æ¹«Æ° ´Ù¸¥ ¹æ¹ýÀ» ã¾Æ¾ß ÇÒ °ÍÀÌ´Ù. (11ÀåÀ» ºÁµµ ºÎ°¡ÀûÀÎ Á¤º¸ÀÌ´Ù.)

¿©·¯ºÐÀÌ ÀÌ ¹æ¹ýÀ¸·Î ²À Çؾ߸¸ ÇÑ´Ù°í ´À³¤´Ù¸é raw ÆÄƼ¼Ç ÀڷḦ ´Ù¸¥ ÆÄƼ¼Ç¿¡ º¹»çÇÑ ´ÙÀ½ ÀÌ°ÍÀ» loopback ¸¦ »ç¿ëÇØ mount Çضó.

    # cp /dev/hda5 /root/working
    # mount -t ext2 -o loop /root/working /mnt
 
±×·¯³ª ÀÌ°ÍÀº 'mount'ÀÇ ÃֽŠ¹öÁ¯ÀÌ ÇÊ¿äÇÏ´Ù. È­ÀÏ ½Ã½ºÅÛÀ» ¿ÏÀüÈ÷ Æı«ÇßÀ»¶§ loopback À» »ç¿ëÇÑ´Ù´Â Àǹ̴ ¸ðµÎ raw ÆÄƼ¼ÇÀ» º¹»çÇؼ­ ´Ù½Ã ½ÃÀÛÇؾ߸¸ ÇÑ´Ù´Â °ÍÀÌ´Ù.

7. ´Ù¸¥°÷¿¡ ÀڷḦ ¾µ(write) Áغñ¸¦ ÇÑ´Ù.

¿©·¯ºÐÀº ¾îµò°¡¿¡ ÀÖ´Â ±¸ÃâµÈ ÆÄƼ¼ÇÀ» È®½ÇÇÏ°Ô ¸¸µé ÇÊ¿ä°¡ ÀÖ´Ù. À߸¸µÇ¸é ´ç½Å ½Ã½ºÅÛÀº ¾Æ¸¶ root, /usr, /home ¿¡ ¸î°³ÀÇ ÆÄƼ¼ÇÀ» °¡Áö°í ÀÖ´Ù. À̵éÁß °í¸£¸é ¾Æ¹« ¹®Á¦µµ ¾øÀ» °ÍÀÌ´Ù: ´ÜÁö ÀÌÁß Çϳª¿¡ »õ·Î¿î µð·ºÅ丮¸¦ »ý¼ºÇÑ´Ù.

¿ÀÁ÷ root ¸¸ °¡Áö°í ÀÖ°í root¿¡´Ù°¡ ¸ðµç°ÍÀ» ÀúÀå Çß´Ù¸é Á»´õ ´Ù·ç±â Èûµé °ÍÀÌ´Ù. ´ç½ÅÀº MS-DOG ³ª Windows ÆÄƼ¼ÇÀ» °¡Áö°í ÀÖ°í ±×°ÍÀ» »ç¿ëÇϴ°¡? ȤÀº Ä¿³Î¿¡ ¸ðµâó·³ ramdisk µå¶óÀ̹ö¸¦ °¡Áö°í Àִ°¡? Ä¿³ÎÀÌ 1.3.48 ÀÌ»óÀ̸é ramdisk ¸¦ »ç¿ëÇؼ­ ´ÙÀ½°ú °°ÀÌ Çضó.

    # dd if=/dev/zero of=/dev/ram0 bs=1k count=2048
    # mke2fs -v -m 0 /dev/ram0 2048
    # mount -t ext2 /dev/ram0 /mnt
ÀÌ°ÍÀº 2MB ÀÇ ramdisk volume À» ¸¸µé°í À̸¦ /mnt¿¡ mount ÇÏ´Â °ÍÀÌ´Ù. °æ°í: ¸¸¾à 'kerneld'¸¦ automatically load and unload kernel modules·Î »ç¿ëÇÑ´Ù¸é ÀÌ°ÍÀ¸·ÎºÎÅÍ ¾î¶² È­Àϵµ º¹»çÇϱâ Àü±îÁö´Â ºñÈֹ߼º ±â¾ïÀåÄ¡ À§¿¡ ramdisk ¸¦ unmount ÇÏÁö ¸»¾Æ¶ó. Çѹø ÀÌ°ÍÀ» unmount Çϸé 'knrneld'´Â ÀÌ°ÍÀº ¸ðµâÀ» unload ÇÒ¼ö ÀÖ´Ù°í °¡Á¤Çϸç, ÀÌÀÏÀÌ ÀϾ¸é ¸Þ¸ð¸®´Â Ä¿³ÎÀÇ ´Ù¸¥ ºÎºÐ¿¡¼­ ´Ù½Ã »ç¿ëµÇ°í, ÀڷḦ º¹±¸ ÇÏ´À¶ó °É¸° ¸ðµç Èû°Ü¿î ½Ã°£µéÀ» ÀÒ¾î¹ö¸®°Ô µÇ´Â °ÍÀÌ´Ù.

¸¸¾à ¾î¶² »õ·Î¿î superfioopy removable device ¸¦ °¡Áö°í ÀÖ´Ù¸é ±× ¹æ¹ýµéÀº ÆÄƼ¼ÇÀ» º¹±¸Çϴµ¥ ÁÁÀº ¼±ÅÃÀÌ´Ù. ±×·¸Áö ¾ÊÀ¸¸é ´ç½ÅÀº Ç÷ÎÇÇ¿¡ ³¡±îÁö Ãæ½ÇÇØ¾ß ÇÑ´Ù.

¿©·¯ºÐÀÌ ÇÊ¿äÇÑ ´Ù¸¥ ÇÑ°¡Áö´Â ÆÄƼ¼Ç deviceÀÇ Áß¾ÓÀ¸·Î ºÎÅÍ ÇÊ¿äÇÑ ÀڷḦ ÀÐÀ» ¼ö ÀÖ´Â ÇÁ·Î±×·¥ÀÌ´Ù. °ï°æ¿¡ óÇßÀ»¶§ 'dd'´Â ±× ÀÏÀ» ÇÒ °ÍÀÌÁö¸¸, 600MB ÆÄƼ¼ÇÀ» 800MB ÆÄƼ¼ÇÀ¸·Î Àоîµé¿© ¸í·É ÇÏ°í, 'dd'´Â Àб⸦ °íÁýÇÏÁö¸¸ óÀ½ 600MB´Â ¹«½ÃÇÑ´Ù.ÀÌ´Â ½Ã°£ÀÌ ¸¹ÀÌ °É¸°´Ù. ¹æ¹ýÀº ÆÄƼ¼Ç Áß¾ÓÀ» ãÀ» ÇÁ·Î±×·¥À» ±â·ÏÇÏ´Â °ÍÀÌ´Ù. À̸¦ 'fsgrab'¶ó ºÎ¸£´Âµ¥ uuencoded, gizpped tar file ¿¡¼­ »ç¿ë¹ý, ¼³Ä¡¹ý, ÀúÀÛ±Ç ¸Þ¼¼Áö¿Í ÇÔ²² ±¸ÇÒ ¼ö ÀÖ´Ù. ´ÙÀ½ ¸í·ÉÀ¸·Î À̸¦ °Ë»öÇØ º¸ÀÚ :

    $ uuencoded < Ext2fs-Undeldtion-mini-HOWTO
    $ gzip -dc fsgrab.tar.gz | tar xf -
begin 644 fsgrab.tar.gz
,
end
ÀÌ ÇÁ·Î±×·¥ÀÌ ¿Ïº®ÇÏ°Ô ÀÛµ¿µÇ´õ¶óµµ ¾î¶»°Ô À̸¦ ¼öÇàÇÏ´ÂÁö´Â Ã¥ÀÓÁú ¼ö ¾ø´Ù´Â Á¡À» °æ°íÇÑ´Ù. warranty ¿¡¼­ ºÎÁ·ÇÑ ºÎºÐÀÇ »ó¼¼ÇÑ °ÍÀº GNU General Public Licence¸¦ Æ÷ÇÔÇÑ 'COPYING' È­ÀÏÀÇ 'No warranty' ¼½¼ÇÀ» ºÁ¶ó.

8. »èÁ¦µÈ inodes ¸¦ ã´Â´Ù.

´ÙÀ½ ´Ü°è´Â ÃÖ±Ù inodes°¡ ÀÚÀ¯·Ó°Ô µÈ È­ÀÏ ½Ã½ºÅÛÀ» ¹¯´Â °ÍÀÌ´Ù. ÀÌ ÀÏÀº 'debugfs'¿Í °°ÀÌ ÇØ¾ß ÇÏ´Â ÀÏÀÌ´Ù. È­ÀÏ ½Ã½ºÅÛÀÌ ÀúÀåµÈ device¿¡ À̸§À» ÁÖ°í 'debugfs'¸¦ ½ÃÀÛÇÏÀÚ:

    # debugfs /dev/hda5
inodes¸¦ Á÷Á¢ÀûÀ¸·Î º¯°æÇÏ·Á¸é ±â·Ï °¡´ÉÇÑ È­ÀÏ ½Ã½ºÅÛ¿¡ '-w' ¿É¼ÇÀ» Ãß°¡ÇÑ´Ù:
    # debugfs -w /dev/hda5
»èÁ¦µÈ inodes ¸¦ ã´Â 'debugfs' ¸í·ÉÀº 'lsdel' ÀÌ´Ù. ÀÚ, ´ÙÀ½ ¸í·ÉÀ» ÇÁ·ÒÇÁÆ®¿¡ ½áº¸ÀÚ.
     debugfs:  lsdel
µð½ºÅ©°¡ µ¹¾Æ°¡´Â ¼Ò¸®°¡ ³­ ÈÄ ±æ´Ù¶õ ¸ñ·ÏÀÌ ¿øÇÏ´Â °÷À¸·Î ¿î¹ÝµÈ´Ù. ±×·¯¸é ÀÌ°ÍÀ» ¾îµò°¡¿¡ º¹»çÇØ ÀúÀåÇϱ⸦ ¿øÇÒ °ÍÀÌ´Ù. 'less' ¿É¼ÇÀ» °¡Áö°í ÀÖ´Ù¸é '-o' ¿É¼ÇÀ» Ãâ·Â È­ÀÏ À̸§¿¡ ºÙÈú ¼ö ÀÖ´Ù. ±×·¸Áö ¾ÊÀ¸¸é ±× Ãâ·ÂÀ» º¸³¾ °÷À» Á¤ÇØ¾ß ÇÑ´Ù.
    debugfs:  quit 
    # echo lsdel | debugfs /dev/hda5 > lsdel.out
ÀÚ, »èÁ¦µÈ ½Ã°£, Å©±â, ÇüÅÂ, ÆÛ¹Ì¼Ç ¼ýÀÚ, ¼ÒÀ¯ÀÚ µîµî¿¡ ±Ù°Å¸¦ µÎ°í ¿øÇÏ´Â Áö¿öÁø inodes ¸¦ »ý°¢ÇØ ³»¾ß¸¸ ÇÑ´Ù. ¿îÁÁÀ¸¸é »èÁ¦µÈ inode °¡ Ä¿´Ù¶õ ¹«¸®ÀÌ°í 5ºÐÀü¿¡ »èÁ¦µÈ °ÍÀ̹ǷΠ¹ß°ßÇÒ ¼ö ÀÖÀ» °ÍÀÌ´Ù. ±×·¸Áö ¾ÊÀ¸¸é ¼¼¼¼ÇÑ ¸ñ·ÏÀ» ÅëÇØ trawl ÇÑ´Ù. °¡´ÉÇÏ´Ù¸é ³ª´Â º¹±¸Çϱ⸦ ¿øÇÏ´Â inodes ¸¦ ÇÁ¸°Æ® Çϱæ Á¦¾ÈÇÑ´Ù. ÀÌ´Â À§ÀÇ °ÍÀ» ´õ¿í ½±°Ô ¸¸µé °ÍÀÌ´Ù.

9. inodes ÀÇ ¼¼ºÎ °úÁ¤À» ¾ò´Â´Ù.

Debugfs ¿¡´Â inodeÀÇ ¼¼ºÎ»çÇ×À» Ãâ·ÂÇÏ´Â 'stat'¸í·ÉÀÌ ÀÖ´Ù. ÀÌ´Â º¹±¸ ¸ñ·Ï¿¡ ÀÖ´Â °¢ inode ¸¦ ¹ßÇàÇÑ´Ù. ¿¹¸¦µé¾î ÀÚÁÖ »ç¿ëÇÏ´Â inode ¹øÈ£°¡ 148003 À̶ó¸é ´ÙÀ½°ú °°ÀÌ Çغ¸ÀÚ.


 
  debugfs:  stat <148003>
    Inode: 148003   Type: regular  Mode:  0644  Flags: 0x0  Version: 1
    User:   503   Group:   100   Size: 6065
    File ACL: 0    Directory ACL: 0
    Links: 0   Blockcount: 12
    Fragment:  Address: 0    Number: 0    Size: 0
    ctime: 0x31a9a574 -- Mon May 27 13:52:04 1996
    atime: 0x31a21dd1 -- Tue May 21 20:47:29 1996
    mtime: 0x313bf4d7 -- Tue Mar  5 08:01:27 1996
    dtime: 0x31a9a574 -- Mon May 27 13:52:04 1996
    BLOCKS:
    594810 594811 594814 594815 594816 594817 
    TOTAL: 6

º¹±¸ÇÒ È­ÀÏÀÌ ¸¹´Ù¸é À§ÀÇ °ÍÀÌ ÀÚµ¿ÀûÀ¸·Î µÇ±æ ¹Ù¶ö °ÍÀÌ´Ù. º¹±¸ÇÒ inodes 'lsdel' ¸ñ·ÏÀÌ 'list'¿¡ ÀÖ´Ù °¡Á¤ÇÏ°í ´ÙÀ½°ú °°ÀÌ Çغ¸ÀÚ.

# cut -c1-6 list | grep "[0-9]" | tr -d " " > inodes ÀÌ È­ÀÏÀÇ 'inodes'¸¦ ³ªÁß¿¡ Æí¸®ÇÏ°Ô ÇϱâÀ§ÇØ º¹±¸ÇÒ inodesÀÇ ¹øÈ£¸¦ ÁÙ¸¶´Ù Çϳª¾¿ Æ÷ÇÔÇØ ÀúÀåÇß¾ú´Ù. ±×¸®°í ³ª¼­ ´ÙÀ½°ú °°ÀÌ Çغ¸ÀÚ.

# sed 's/^.*$/stat <\0>/' inodes | debugfs /dev/hda5 > stats ¿©±â¼­ 'stats'´Â ¸ðµç 'stat' ¸í·ÉÀÇ Ãâ·ÂÀ» Æ÷ÇÔÇÑ´Ù.

10. µ¥ÀÌÅÍ ºí·°À» º¹±¸ÇÑ´Ù.

º¹±¸ÇÒ È­ÀÏÀÌ 12 ºí·°º¸´Ù ±æÁö ¾Ê´Ù¸é ÀÌ ¸ðµç ÀÚ·áÀÇ ºí·° ¹øÈ£´Â inode ¿¡ ÀúÀåµÇ¾î ÀÖ´Ù. ÀÌ´Â 'stat' ¸í·ÉÀ¸·Î Áï½Ã inode ¸¦ Ãâ·ÂÇØ ÀÐÀ» ¼ö ÀÖÁö¸¸, 'fsgrab'¸¦ »ç¿ëÇÏ¸é ´õ ½±°Ô ÇÒ¼ö ÀÖ´Ù. 8Àå¿¡¼­ ºÃ´ø ¿¹¸¦ ´Ù½Ã º¸ÀÚ.


  debugfs:  stat <148003>
    Inode: 148003   Type: regular  Mode:  0644  Flags: 0x0  Version: 1
    User:   503   Group:   100   Size: 6065
    File ACL: 0    Directory ACL: 0
    Links: 0   Blockcount: 12
    Fragment:  Address: 0    Number: 0    Size: 0
    ctime: 0x31a9a574 -- Mon May 27 13:52:04 1996
    atime: 0x31a21dd1 -- Tue May 21 20:47:29 1996
    mtime: 0x313bf4d7 -- Tue Mar  5 08:01:27 1996
    dtime: 0x31a9a574 -- Mon May 27 13:52:04 1996
    BLOCKS:
    594810 594811 594814 594815 594816 594817 
    TOTAL: 6

ÀÌ È­ÀÏÀº 6°³ ºí·°À» °¡Áö°í ÀÖ´Ù. 'recoverde.001' À̶ó´Â »õÈ­ÀÏ¿¡ Á¤È®È÷ ±â·ÏÇϱâ À§ÇØ ´ÙÀ½°ú °°ÀÌ Çغ¸ÀÚ.

# fsgrab -c 2 -s 594810 /dev/hda5 > recovered.001 # fsgrab -c 4 -s 594817 /dev/hda5 >> recovered.001

³¡ºÎºÐÀÇ 'recovered.001'´Â ÇÊ¿ä ¾øÀ» ¼öµµ ÀÖÁö¸¸ º°·Î Áß¿äÄ¡ ¾Ê´Ù. ¹°·Ð Çϳª ¶Ç´Â ±× ÀÌ»óÀÇ °ü·ÃµÈ ºí·°µéÀÌ µ¤¿© ¾²¿´À» °¡´É¼ºµµ ÀÖ´Ù. ¸¸¾à ±×·¸´Ù¸é ¿îÀÌ ¾ø´Â °ÍÀÌ´Ï ±× ºí·°¿¡ ´ëÇؼ± ÀØ¾î ¹ö·Á¶ó.

¹®Á¦´Â È­ÀÏÀÌ 12 ºí·°º¸´Ù ±æ¶§ ³ªÅ¸³­´Ù. À̶§´Â À¯´Ð½º È­ÀϽýºÅÛ¿¡ ´ëÇØ ¾à°£Àº ¾Ë°í ÀÖ¾î¾ß ÇÑ´Ù. È­ÀÏÀÇ ÀÚ·á´Â 'block' À̶ó ºÒ¸®´Â ÁýÇÕü¿¡ ÀúÀåµÈ´Ù. ±×¸®°í ÀÌ ºí·°µéÀº ¼øÂ÷ÀûÀ¸·Î ¹øÈ£°¡ ¸Å°ÜÁ® ÀÖ´Ù. ¶ÇÇÑ È­ÀÏ¿¡´Â ¼ÒÀ¯ÀÚ, Æ۹̼Ç, Á¾·ùµîÀÇ Á¤º¸°¡ º¸°üµÇ¾î ÀÖ´Â 'inode' ¶ó´Â °ÍÀÌ ÀÖ´Ù. ÀÌ·¯ÇÑ ºí·°°ú inode´Â ¼øÂ÷ÀûÀ¸·Î ¹øÈ£°¡ ¸Å°ÜÁ® ÀÖ°í ´Ù¸¥ ¼ø¼­¸¦ °®´Â´Ù. ±×¸®°í µð·ºÅ丮´Â È­ÀÏ À̸§°ú inode ¹øÈ£·Î ±¸¼º µÈ´Ù.

ÆÛ¹Ì¼Ç Á¤º¸ µîµî°ú ¸¶Âù°¡Áö·Î inode ¶ÇÇÑ È­ÀÏ µ¥ÀÌÅÍÀÇ À§Ä¡¸¦ º¸À¯ÇÑ´Ù. óÀ½ 12 µ¥ÀÌÅÍ ºí·°Àº inode ±× ÀÚü¿¡ ÀúÀåµÇ´Âµ¥ À̸¦ direct blocks¶ó ÇÑ´Ù. ±×·¯°í ³ª¸é inode ´Â 'indirect blocks'À» Æ÷ÇÔ Çϴµ¥ ¿©±â¼­ ºí·°Àº ºÎ°¡ÀûÀÎ direct blocks ¹øÈ£¸¦ Æ÷ÇÔÇÑ´Ù. ¶ÇÇÑ inode´Â indirect blocks ¹øÈ£ ¸ñ·ÏÀ» Æ÷ÇÔÇÑ µÎ¹èÀÇ indirect blocks ¹øÈ£¸¦ °¡Áö°í, ¶Ç À̸¦ Æ÷ÇÔÇÑ ¸ñ·ÏÀ» °¡Áø ¼¼¹èÀÇ indirect blocksÀ» °¡Áø´Ù.

´Ù½Ã ÀоÀÚ : ÀÌ´Â º¹ÀâÇÏÁö¸¸ Áß¿äÇÏ´Ù. ÀÚ, ºÒÇàÇÏ°Ôµµ ÃÖ±ÙÀÇ Ä¿³Î ¼öÇàÀº È­ÀÏ deletionÀÇ ¸ðµç indirect blocks ÀÌ 0ÀÌ´Ù.±×·¡¼­ 12ºí·° º¸´Ù ±ä È­ÀÏÀ̶ó¸é ÇÊ¿äÇÑ ¸ðµç ºí·°ÀÇ ¹øÈ£¸¦ ¹ß°ßÇÒ ¼ö ÀÖ´Ù´Â°Í Á¶Â÷ º¸ÁõÇÒ ¼ö ¾ø´Ù. ±×·¯ÇÑ °ÍÀ» ¾Ë¾Æ³¾ À¯ÀÏÇÑ ¹æ¹ýÀº ±× È­ÀϵéÀÌ Á¶°¢³ªÁö ¾Ê¾Ò´Ù°í °¡Á¤ ÇÏ´Â °ÍÀÌ´Ù. ¸¸¾à »ê»ê Á¶°¢ÀÌ ³µ´Ù¸é ¹®Á¦°¡ ÀÖ´Ù. È­ÀÏ¿¡ indirect block ÀÌ ÇÊ¿äÇÏ´Ù¸é Á¶°¢³ªÁö ¾ÊÀº °ÍµéÀº ´ÙÀ½°ú °°ÀÌ ³ªÅ¸³­´Ù.


    #Blocks   Contents
    12        Data (direct blocks)
    1         Indirect block
    256       Data (blocks in the indirect block)
    1         Doubly indirect block
   [1         Indirect block of the doubly indirect block
    256       Data
   ] (256 times -- one for each indirect block in the doubly indirect)
    1         Triply indirect block
  [[1         Doubly indirect block
    256       Data
   ] (256 times -- one for each indirect block in the doubly indirect
      block of the triply indirect block)
  ] (256 times -- one for each doubly indirect block in the triply
     indirect block)

À§ÀÇ °ÍÀÌ ¸íÈ®Çϱ⸦ ¹Ù¶õ´Ù. È­ÀÏÀÌ ´ÜÁö 268 ºí·° »ÓÀ̶ó¸é ÀÌ´Â ÀüÀûÀ¸·Î °¡´ÉÇÏ´Ù. À̵éÀº 12ºí·° µ¥ÀÌÅÍÀÌ°í (ÀÌ ¹øÈ£´Â inode ÀÚü¿¡ ³ªÅ¸³­´Ù) indirect block À» µû¸£¸ç ´Ù¸¥ 256 Á¦ÀÌÅÍ ºí·°À» µû¸¥´Ù. ¸¸¾à È­ÀÏÀÌ À§ÀÇ °Íº¸´Ù ±æ´Ù¸é µÎ¹èÀÇ indirect block À» Ãß°¡ÇÑ´Ù. ±× ÀÌÈÄ °¢°¢ÀÇ ºÎ°¡ÀûÀÎ 256 µ¥ÀÌÅÍ ºí·°¿¡´Ù ÇϳªÀÇ indirect block °ú 256 µ¥ÀÌÅÍ ºí·°À» Ãß°¡Çϴµ¥ ÃÖ´ë°¡ 256 ÀÌ´Ù. À̺¸´Ù È­ÀÏÀÌ ´õ ±æ´Ù¸é Á¶°¢³ª ÀÖÁö ¾ÊÀ» °¡´É¼ºÀº °ÅÀÇ ¾øÁö¸¸ ´õ ±ä È­ÀÏ¿¡ ±× Á¶Á÷ÀÌ À̾îÁ® ³ªÅ¸³¯ ¼öµµ ÀÖ´Ù.

¿©·¯ºÐÀÇ ºí·° Å©±â´Â ¸ðµÎ 1024 bytes ÀÌ°í À̴ ǥÁØ°ªÀÌ´Ù. ºí·°ÀÌ À̺¸´Ù Å©´Ù¸é ¾à°£ÀÇ ¹øÈ£µéÀÌ ¹Ù²î¾î ³ªÅ¸³­´Ù. Ưº°È÷: °¢ ºí·° ¹øÈ£°¡ 4 bytes µô´Ù¸é blocksize/4 ´Â °¢°¢ÀÇ indirect block ¿¡ ÀúÀåµÇ´Â ºí·° ¹øÈ£ÀÌ´Ù. ±×·¡¼­ ¸Å¹ø ¸ñÂ÷¿¡ ³ªÅ¸³ª´Â 256 À̶ó´Â ¹øÈ£¸¦ blocksize/4 ·Î ¹Ù²Ù´Â °ÍÀÌ´Ù.

11. inodes ¸¦ Á÷Á¢ º¯°æÇÑ´Ù.

ÀÌ ¹æ¹ýÀº °Ñº¸±â¿¡ ´õ ½¬¿ö º¸ÀÌÁö¸¸ 12 ºí·° º¸´Ù ±æ¶§¿Í ¸Â¸ÔÀ» ¼ö ¾ø´Ù. º¹±¸¸¦ ¿øÇÏ´Â °¢°¢ÀÇ inode ¿¡ ¹Ýµå½Ã »ç¿ë¹ýÀ» Çϳª·Î ÇؾßÇÏ°í deletion ½Ã°£À» 0À¸·Î ÇؾßÇÑ´Ù. ÀÌ ÀÛ¾÷Àº ' degugfs' ¸í·ÉÁß 'mi' ¿¡ ÀÇÇØ ÀÌ·ç¾îÁø´Ù. inode 14800 3À¸·ÎºÎÅÍ ¾à°£ÀÇ ¿¹¸¦ Ãâ·ÂÇØ º¸ÀÚ.


    debugfs:  mi <148003>
                              Mode    [0100644] 
                           User ID    [503] 
                          Group ID    [100] 
                              Size    [6065] 
                     Creation time    [833201524] 
                 Modification time    [832708049] 
                       Access time    [826012887] 
                     Deletion time    [833201524] 0
                        Link count    [0] 1
                       Block count    [12] 
                        File flags    [0x0] 
                         Reserved1    [0] 
                          File acl    [0] 
                     Directory acl    [0] 
                  Fragment address    [0] 
                   Fragment number    [0] 
                     Fragment size    [0] 
                   Direct Block #0    [594810] 
                   Direct Block #1    [594811] 
                   Direct Block #2    [594814] 
                   Direct Block #3    [594815] 
                   Direct Block #4    [594816] 
                   Direct Block #5    [594817] 
                   Direct Block #6    [0] 
                   Direct Block #7    [0] 
                   Direct Block #8    [0] 
                   Direct Block #9    [0] 
                  Direct Block #10    [0] 
                  Direct Block #11    [0] 
                    Indirect Block    [0] 
             Double Indirect Block    [0] 
             Triple Indirect Block    [0]

À§ÀÇ°ÍÀº deletion ½Ã°£À» 0À¸·Î ÇÏ°í ¸µÅ©¸¦ 1·Î ¸ÂÃç °¢°¢ ´Ù¸¥ °÷¿¡¼­ ¾ÐÃàÇØ µÇµ¹¸° °ÍÀÌ´Ù. ¼³·É ÀÌ°ÍÀÌ ¾î¸®¼®°Ô º¸ÀÏ Áö¶óµµ ¸¹Àº È­ÀÏÀ» º¹±¸ÇØ¾ß ÇÑ´Ù¸é ÀÌ ¹æ¹ýÀ¸·Î ´ëóÇÒ ¼ö ÀÖ´Ù.

[ ±×·±µ¥ : 'mi' Ãâ·ÂÀÌ inode¿¡ ÀÖ´Â 'Creation time'¿¡ °ü·ÃµÇ¾î ÀÖ´Ù´Â °Ç °ÅÁþ¸»ÀÌ´Ù. »ç½Ç È­ÀÏÀÌ ¸¸µé¾îÁú ¶§´Â À¯´Ð½º È­ÀÏ ½Ã½ºÅÛ¿¡ ¿µÇâÀ» ¹ÌÄ¥ ¼ö ¾ø´Ù. 'st_ctime' 'struct stat'±¸¼ºÀº 'inode change time'¿¡ °ü·ÃµÇ¾î ÀÖ´Ù. ÀÌ´Â inode ¼¼ºÎ»çÇ×ÀÌ ¹Ù²î´Â ¸¶Áö¸· ½ÃÁ¡¿¡¼­ÀÌ´Ù. ] º¯°æµÈ inodes°¡ ÀÖ´Ù¸é 'debugfs' ¿¡¼­ ¹þ¾î³ª ¸í·ÉÇÒ ¼ö ÀÖ´Ù.

# e2fsck -f /dev/hda5 ¿©·¯ºÐÀº µµ¿òµÇ´Â Ãâ·Â°ú ¾à°£ÀÇ Áú¹®À» ¹ÞÀ» °ÍÀÌ´Ù. 'summary information' °ú º¯°æÇÑ inodes¿¡ °üÇÑ ¸ðµç Àß¹®¿¡ 'Yes'¶ó°í Çضó. ¸ðµç Áú¹®¿¡ 'Yes'¶ó ´äÇÏ´Â °ÍÀº ÁÁÀº ¹æ¹ýÀÌ´Ù. 'e2fsck'°¡ ³¡³ª¸é È­ÀÏ ½Ã½ºÅÛÀ» remount ÇÒ ¼ö ÀÖ´Ù.

»èÁ¦µÈ È­ÀÏÀº È­ÀÏ ½Ã½ºÅÛÀÇ /lost+found µð·ºÅ丮¿¡ ÀÚ¸®ÇÏ°í ÀÖ´Ù. (ÆÄƼ¼ÇÀÌ /usr ¿¡ mount µÆ´Ù¸é /usr/lost+found ¸¦ ºÁ¶ó) ±×°ÍµéÀº inode ¹øÈ£¿¡ µû¶ó À̸§ÀÌ ºÒ·ÁÁø´Ù. ¿©·¯ºÐÀÌ °è¼Ó ÇØ¾ß ÇÒ °ÍÀº ±× È­ÀϵéÀÇ ³»¿ë¿¡ ¾Ë¸Â°Ô À̸§À» »ý°¢ÇØ ³»´Â °ÍÀ̸ç, ±×°ÍµéÀ» È­ÀÏ ½Ã½ºÅÛ ±¸Á¶¿¡ ¾Ë¸Â´Â °÷À¸·Î µÇµ¹¸®´Â ÀÏÀÌ´Ù.

»ç½Ç Àú°ÍµéÀº 'e2fsck'·Î È­ÀÏÀ» /lost+found ·Î º¸³»´Â °ÍÁß ÇϳªÀÌ´Ù. ¿©·¯ºÐÀº inode ¿¡´Ù È­ÀÏ ½Ã½ºÅÛ¿¡¼­ ¸µÅ©¸¦ ¸¸µå´Âµ¥ 'debugfs'¸¦ »ç¿ë ÇÒ ¼ö ÀÖ´Ù. 'debugfs' 'link' ¸í·ÉÀº inode ¸¦ º¯°æÇÑ ÈÄ »ç¿ëÇضó.

debugfs: link <148003> foo.txt

À§ÀÇ ¿¹´Â 'debugfs' °¡ ÃÖ±ÙÀÇ µð·ºÅ丮¶ó »ý°¢ÇÏ´Â °÷¿¡´Ù°¡ 'foo.txt' ¶ó´Â È­ÀÏÀ» ¸¸µå´Â °ÍÀ̸ç 'foo.txt' ´Â ´ç½ÅÀÇ È­ÀÏÀÌ µÉ °ÍÀÌ´Ù. 'e2fsck' ¸í·ÉÀº 'summary information' µîµîÀ» °íÄ¥¶§±îÁö °è¼Ó »ç¿ëÇÒ Çʿ伺ÀÌ ÀÖ´Ù.

12. ÀÌ·±°ÍÀº ³ªÁß¿¡´Â ´õ ½±°Ô ¾òÀ» ¼ö ÀÖÀ»±î?

±×·¸´Ù. »ç½Ç ³­ ÀÌ°ÍÀÌ ¹ú½á ÀÖ´Ù°í ¹Ï´Â´Ù. 2.1.X ½Ã¸®Áî¿¡ ÀÖ´Â ÃÖ±Ù Ä¿³ÎÀº indirect blocks À» 0À¸·Î ÇÏÁö ¾Ê´Â´Ù°í µé¾ú´Ù. indirect blocks ÀÌ »èÁ¦½Ã ÇÇÇظ¦ ÀÔÁö ¾Ê°í ³²¾Æ ÀÖ´Â ¶Ç ´Ù¸¥ 2.0.X Ä¿³Î Á¦Ç°À» Á¦ÀÛ ÇÑ´Ù´Â ¾ê±â°¡ ³ª¿À±â ½ÃÀÛÇÑ °ÍÀÌ 1996³â 12¿ùÀÌ´Ù. ¸®´©½º¿Í ´Ù¸¥ Ä¿³Î ÇØÄ¿µéÀº ÀÌ ÇѰ踦 ±Øº¹Çß°í, ¼ÕÀ¸·Î inode ¸¦ º¯°æÇÏ´Â ³ªÀÇ ¹æ¹ý¿¡´Â ¸¹Àº °áÇÔÀÌ ³ªÅ¸³¯ °ÍÀÌ´Ù.

13. ÀÌ °úÁ¤ÀÌ ÀÚµ¿ÀûÀ¸·Î µÇ´Â µµ±¸°¡ ÀÖ´Â °÷Àº?

ÀÌ ÀÏÀÌ ÀϾ´Ù¸é ¹Ù·Î ±×°÷¿¡ ÀÖ´Ù. ºÒÇàÈ÷ ±×°÷¿¡µµ inode º¯°æ ±â¼ú ¸Þ´º¾ó°ú °°Àº ¹®Á¦Á¡ÀÌ ÀÖÀ¸¸®¶ó »ý°¢ÇÑ´Ù : indirect blocks Àº º¹±¸°¡ ºÒ°¡´ÉÇÏ´Ù. ±×·¯³ª ÀÌ´Â ¸ÓÁö¾Ê¾Æ ´õÀÌ»ó ¹®Á¦°¡ µÇÁö ¾ÊÀ» °ÍÀ̸ç, Áö±Ý ÀÌ·¯ÇÑ ÇÁ·Î±×·¥ÀÌ ³ª¿Ã °¡´É¼ºÀÌ ÀÖ´Ù°í º»´Ù.

´©±º°¡°¡ net ¿¡¼­ Scott D. Heavner ÀÇ 'lde' ¸¦ ¾ð±ÞÇß¾ú´Ù. ¼ÖÁ÷È÷ ³ª´Â ÀÌ°ÍÀ» ÀÚµ¿ÀûÀ¸·Î È­ÀÏÀÌ º¹±¸µÇ´Â µµ±¸·Î º¸Áö ¾Ê´Â´Ù. ÀÌ´Â 'debugfs' ·Î È­¸éÀ» °¡µæ ä¿ì±â´Â ÇÏÁö¸¸, È®½ÇÇÑ È­ÀÏÀÇ Á¾·ù¸¦ Á¤¹Ð °Ë»çÇÏ´Â ´É·Â°ú °°Àº Ư¡À» °¡Áö°í ÀÖ´Ù. ¶ÇÇÑ ÀÌ°ÍÀº xia¿Í minix È­ÀÏ ½Ã½ºÅÛ°ú ÇÔ²² ÀÛ¾÷À» Çϴµ¥ ÀÌ·¯ÇÑ ÀÌÀ¯µé·Î ´ç½Ã¿¡ ÀÌ°ÍÀ» Àß Æȸ®°Ô ÇÑ°Í °°´Ù. URL : sunsite.unc.edu/pub/Linux/system/Filesystems/lde-2.2.tar.gz ½ÇÁ¦·Î ÀÛ¾÷Àº GNU Midnight Commander,`mc' ó·³ µé¸°´Ù. ÀÌ´Â full-screen È­ÀÏ Á¶Á¤ µµ±¸À̸ç, 'NC'¶ó ¾Ë·ÁÁ® ÀÖ´Â MS-DOG full-screen È­ÀÏ Á¶Á¤ µµ±¸ÀÎ AFAIK¿¡ ±Ù°Å¸¦ µÐ °ÍÀÌ´Ù. 'mc'´Â ¸®´ª½º Äְܼú xterm ¿¡¼­ ¸¶¿ì½º¸¦ Áö¿øÇϸç tarfile¿¡ 'cd'ing ÇÏ´Â °Í°ú ¸¶Âù°¡Áö·Î ½ÇÁúÀûÀÎ È­ÀÏ ½Ã½ºÅÛÀ» Á¦°øÇÑ´Ù. ÀÌµé ½ÇÁúÀû È­ÀÏ ½Ã½ºÅÛÀº ext2 undeletion ÀÌ´Ù. ÀÌ°ÍÀº ¸Å¿ì ¹ø°Å·Ó°Ô µé¸®°í ³» ÀÚ½ÅÀÌ ÇÁ·Î±×·¥À» »ç¿ëÇÒ ¼ö ¾ø´Ù ¿©°Ü ³­ ¿À·¡µÈ ½© ¸í·ÉÀ» ¿ÀÈ÷·Á ÁÁ¾ÆÇÑ´Ù. ºÐ¸íÈ÷ Çϳª´Â `--with-ext2undel' ¿É¼ÇÀ¸·Î ÇÁ·Î±×·¥À» ¹è¿­ÇÑ´Ù. ¶ÇÇÑ ¶óÀ̺귯¸®¿Í 'e2fsprogs' ÆÐÅ°Áö¿Í ¿À´Â È­ÀÏÀ» Æ÷ÇÔÇÑ ¹ßÀüÀÌ ÇÊ¿äÇÒ °ÍÀÌ´Ù. ³ª´Â ÀÏ´Ü `cd undel:/dev/hda5' ¶ó ºÎ¸¦¼ö ÀÖ´Â ¸¸µé¾îÁø ÇÁ·Î±×·¥À» ¼öÁýÇÏ°í, »èÁ¦µÈ È­ÀÏÀÇ `directory listing' À» ÃëÇß´Ù.

°¡Àå ¸¶Áö¸· ¹öÁ¯Àº ¾Æ¸¶ 3.2.11 ÀÌ´Ù. Ä¿³Î ÀÚü¿Í ¸¶Âù°¡Áö·Î °³¹ß¹öÁ¯Àº ÇØÄ¿°¡ ¾Æ´Ñ »ç¶÷¿¡°Ô ±ÇÇÏÁö ¾Ê´Â´Ù. ÀÌ°ÍÀº URLs·Î ºÎÅÍ ÀÌ¿ëÇÒ ¼ö ÀÖ´Ù. sunsite.unc.edu/pub/Linux/utils/file/managers/ (may be an older version) ftp.nuclecu.unam.mx/linux/local/ ftp.nuclecu.unam.mx/linux/local/devel/ (unsupported, developmental, alpha versions) ftp.cvut.cz/pub/mc/ (European mirror of public and alpha releases) À¥ »çÀÌÆ®´Â ´ÙÀ½°ú °°´Ù stekt.oulu.fi/~jtklehto/mc/

14. ³¡


 A.  Colophon
============
I intend to produce regular updates to this document as long as I have both
time and something interesting to say.  This means that I am eager to hear
comments from readers.  Could my writing be clearer?.  Can you think of
something that would make matters easier?  Is there some new tool that does
it all automatically?  Who *did* kill JFK?
Whatever.  If you have something to say, about this document or any other
subject, drop me a line on <<url url="mailto:aaronc@pobox.com" name="aaronc@pobox.com">>.

B.  Credits
===========
    "If I have seen farther than others, it is because I was standing
    on the shoulders of giants."
                    -- Isaac Newton
Much of this mini-Howto was derived from a posting in comp.os.linux.misc by
Robin Glover <<url url="swrglovr@met.rdg.ac.uk" name="swrglovr@met.rdg.ac.uk">>.  I would like to thank Robin for
graciously allowing me to rework his ideas into this mini-Howto.

C.  Bibliography
================
Frisch, ?een (1995), `Essential System Administration', second edition,
    O'Reilly and Associates, Inc., ISBN: 1-56592-127-5.
Glover, Robin (31 Jan 1996), `HOW-TO : undelete linux files
    (ext2fs/debugfs)', comp.os.linux.misc Usenet posting.
Peek, Jerry, Tim O'Reilly, Mike Loukides et al (1993), `Unix Power Tools',
    O'Reilly and Associates, Inc./Random House, Inc., ISBN: 0-679-79073-X.

D.  Legalities
==============
MS-DOG and Windoze are not trademarks.  Any resemblance these names may
bear to those of any commercial software products is entirely coincidental.
Unix is not a trademark, and has not been for quite some time now.  Wake up
and smell the flowers!
The trademark status of the name `Linux' is currently being contested by
lawyers, as a certain Walter R. Della Croce has made an apparently false
trademark registration for the term.  I however refuse to acknowledge the
name as anything other than public property of all net.citizens.  If Linus
had wanted a trademark on the name, he'd have taken one out himself.
This document is Copyright ?1997 Aaron Crane <<url url="aaronc@pobox.com" name="aaronc@pobox.com">>.  It may
be freely redistributed in its entirety, including the whole of this
copyright notice, but may not changed without permission from the author or
from the Linux Documentation Project Co-ordinator.  Dispensation is granted
for copying small verbatim portions for the purposes of reviews or for
quoting: in these circumstances, sections may be reproduced in the presence
of an appropriate citation but without this copyright notice.
The author requests but does not require that parties intending to sell
copies of this document, whether on computer-readable media or on paper,
inform him or the Linux HOWTO Co-ordinator of their intentions.
The Linux HOWTO Co-ordinator is Greg Hankins <<url url="gregh@sunsite.unc.edu" name="gregh@sunsite.unc.edu">>.
                           »þ·Ð¹Ú(pey1)




sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2003-08-10 11:52:30
Processing time 0.0027 sec