[5262908] | 1 | ÍoCgPÊ |
---|
| 2 | fBXNÍubNPÊ |
---|
| 3 | ðjIoÜÅ512bytePÊ |
---|
| 4 | t@CVXeͱÌubNÌg¢ûðßܵå¤AÆ¢¤[ |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | åÌÍAÇÌuubNvðg¤©ð¨IÈ Æ©ÉuAddressvð¢Äâèèµ½ |
---|
| 8 | No.0 blockÍA³ñA1ÍB³ñAÆ¢¤æ¤ÉB |
---|
| 9 | telR}h(?) |
---|
| 10 | |
---|
| 11 | EDZðgÁÄ¢é© |
---|
| 12 | ¡ÌubNÌêàAPêÌubNÅÏÞêà é |
---|
| 13 | UnixÅÌp³ê½AubNª©®Åg£³êéÆ¢¤@\ÍÇỳêȪçàLÜÁÄ¢Á½ |
---|
| 14 | ENªg¤© |
---|
| 15 | inode |
---|
| 16 | http://www.tamacom.com/tour/kernel/unix/S/61.html |
---|
| 17 | 32sÚ |
---|
| 18 | i_mode |
---|
| 19 | t@CÌ[h |
---|
| 20 | shortÈÌÅ16bit |
---|
| 21 | rwxÅ3bit * 3 = 9bit |
---|
| 22 | 63sÚ` |
---|
| 23 | Bê½[h (i_mode) |
---|
| 24 | `67sÚ |
---|
| 25 | D => directory |
---|
| 26 | R => regular file |
---|
| 27 | àeª[UÉJú³êÄ¢é̪regular file |
---|
| 28 | directoryÍOSªgp·éÌÅA[UÍÊÓ¯µÈ¢ |
---|
| 29 | |
---|
| 30 | ¡úÍinodeµ©µÈ¢æ |
---|
| 31 | |
---|
| 32 | `IÈ*nixÌt@CVXe |
---|
| 33 | |
---|
| 34 | fBXNàÌÔ |
---|
| 35 | æª superblock => ñÈ~ |
---|
| 36 | inodeGA |
---|
| 37 | êÊubN |
---|
| 38 | superblock |
---|
| 39 | SÌÌîñ |
---|
| 40 | ú»·éÌÍmkfsÌc[ |
---|
| 41 | inodeGA |
---|
| 42 | inodeªÅÜèŬÁµèüÁÄ¢é |
---|
| 43 | inodeÌzñ |
---|
| 44 | êÊubN |
---|
| 45 | directoryâregular fileÅÜÁÄ¢é |
---|
| 46 | |
---|
| 47 | mkfsµ½¾¯ÅÍt@CVXeƵÄF¯³êÈ¢ |
---|
| 48 | t@CVXeƵÄAmkfsµ½fBXNðOSÉF¯³¹éÌÍmountR}h |
---|
| 49 | |
---|
| 50 | mountR}hª½ð·é© |
---|
| 51 | superblockðÇñÅA³µ¢FS©Av½IÈs®ªÈ¢© |
---|
| 52 | mount /dev/blockdev mountpoint |
---|
| 53 | inodeÌ2ÔðÇñÅAmountpointÉÇL |
---|
| 54 | 2ÔÈÌÍÜÁÄ¢é |
---|
| 55 | inodeÌ2ÔÍñíÉdv |
---|
| 56 | umount |
---|
| 57 | t@CªSÄÂ¶Ä¢é© |
---|
| 58 | inodeªSÄlock³êĢȢ |
---|
| 59 | inodeÌ2Ô |
---|
| 60 | eFSÌ2ÔinodeÍfBNg\¢ÌrootÆÈÁÄ¢é |
---|
| 61 | mkfsR}hÌFSÌú»¼ãÍAmkfsR}hª2ÔðfBNgÉK¸Zbg·é |
---|
| 62 | |
---|
| 63 | inodeêªêÂÌt@C |
---|
| 64 | |
---|
| 65 | inodeÌzñ©çA¢gpÌinodeðTµÄ«ÄAãÉÇÝÝAregular <= +1µÄdiskÉ«ß· |
---|
| 66 | ¢gpðT·ASYÍÊÉ é |
---|
| 67 | êÊubNÌó«ÌæðT· |
---|
| 68 | T·ASYªÊÉ é |
---|
| 69 | 39sÚÌNADDRª¢gp |
---|
| 70 | |
---|
| 71 | *nixÅÍinode©Ìªt@C |
---|
| 72 | ut@C = inodev |
---|
| 73 | inodeͯÊqÅÍÈ¢ÌÅAԪ¢Ģé |
---|
| 74 | ui_nov |
---|
| 75 | uls -ivÅinodeÔªoé |
---|
[6149a45] | 76 | "ls -id /" |
---|
[5262908] | 77 | => 2 |
---|
| 78 | lnR}hÅhardlinkðìé |
---|
| 79 | t@CðinodeÌÔÅÄÔÌÍÊ|ÈÌÅA¼Oð¯é |
---|
| 80 | t@C¼Í¡Â¯çêé |
---|
| 81 | Á¦é^C~OÍrmR}hðÅÁ½uÔÆÍÀçÈ¢ |
---|
| 82 | |
---|
| 83 | uino <=> file namevÌgÝí¹ðzñƵÄÁÄ¢ézªé |
---|
| 84 | |ino | file name | |
---|
| 85 | | 41 | file A | |
---|
| 86 | | 41 | file B | |
---|
| 87 | Ìæ¤ÈÇëIȨ |
---|
| 88 | ÀͱêªfBNgt@C |
---|
| 89 | fBNgt@Cð³î©éÆ©¦é |
---|
| 90 | "cat ." |
---|
| 91 | LinuxÍ\¢ªá¤ÌÅ©êÈ¢ |
---|
| 92 | ¡ÌLinuxÆV7Ìt@CVXeÌ\¢Í¯¶ |
---|
| 93 | t@CVXeÌî{IÈfUC\¢Í¯¶ |
---|
| 94 | à¿ëñÀãÌHvEi»Í é |
---|
| 95 | AeB[NÈUnixð¡ñæèã°½Rͱê |
---|
| 96 | |
---|
| 97 | tempt@C |
---|
| 98 | t@CðìÁ½uÔÉunlink => vZXªÌµÄàèÉt@CªÁ¦é |
---|
| 99 | |
---|
| 100 | ÌÍfBXNª¿Åå«ÈPêfBXNðpÓ·é̪ﵩÁ½ÌÅA |
---|
| 101 | ¬³ÈfBXNðڬصÄAå«©¹éÆ¢¤ê÷Ìô |
---|
| 102 | => inode 2 |
---|