{"id":627,"date":"2015-10-18T14:39:00","date_gmt":"2015-10-18T06:39:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=627"},"modified":"2023-11-04T14:48:36","modified_gmt":"2023-11-04T06:48:36","slug":"filesystem-fat","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/627","title":{"rendered":"FileSystem FAT"},"content":{"rendered":"\n<p><strong><br>FAT<\/strong><br>FAT12: Developed 1977 (MS Disk BASIC)<br>FAT16: Developed 1987 (MS-DOS 3.31)<br>FAT32: Developed 1996 (Win95 OSR2)<br>exFAT<\/p>\n\n\n\n<p>refer<br>http:\/\/www.c-jump.com\/CIS24\/Slides\/FAT\/lecture.html &nbsp;<\/p>\n\n\n\n<p>ps:<br>FAT12&nbsp;is most suitable for very small volumes, and is used on floppy disks and hard disk partitions smaller than about 16 MB\u3000<br>refer<br>http:\/\/www.pcguide.com\/ref\/hdd\/file\/partSizes-c.html<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<\/p>\n\n\n\n<p><strong>FAT32<\/strong><\/p>\n\n\n\n<p><strong>limit of FAT32<\/strong><br>limit of volume size is 2TB<br>limit of a file size is 4GB<\/p>\n\n\n\n<p><strong>cluster<\/strong><br>windows \u7684\u78c1\u789f\u55ae\u4f4d<br>FAT32\u9810\u8a2d\u662f1\u500bcluster\u4f54\u75284\u500bsector(2KB)<br>ex:<br>\u82e5\u6a94\u6848\u70ba125KB,\u90a3\u6703\u9700\u898162.5\u500bcluster.\u56e0\u6b64\u8981\u4f54\u752863\u500bcluster<br>\u800c63\u500bcluster\u4f54\u7528\u5c31=256\u500bsector\u88ab\u4f54\u7528<br>ps:<br>\u82e5\u6a94\u6848\u5c0f\u65bc1\u500bcluster,\u5176\u9918\u7684\u7a7a\u9593\u4e5f\u7121\u6cd5\u4f7f\u7528,\u9019\u4e9b\u7a7a\u9593\u7a31\u70baslack space<\/p>\n\n\n\n<p>&#8230;<\/p>\n\n\n\n<p><br><strong>FAT Partition boot sector<\/strong><br>first sector in the partition<br>structure as below<br>\u30003byte, jump instruction<br>\u30008byte, OEM name in text<br>\u300025byte, BIOS parameter block<br>\u300026byte, Extended BIOS parameter block<br>\u3000448byte, Bootstrap Code<br>\u30002 byte, end of sector marker<\/p>\n\n\n\n<p>&#8230;<\/p>\n\n\n\n<p><strong>FAT layout<\/strong><br>Root directory(directory entries)<br>File allocation table(FAT1)<br>File allocation table for backup(FAT2)<\/p>\n\n\n\n<p><strong>FAT ID of FAT1<\/strong><br>0x0000:unused\/unallocated cluster<br>0xFFF7: bad cluster<br>0x:FFFB-0xFFFF: Last cluster in a file<br>ps:<br>ID is 1word(2byte)<br>ps:<br>\u8a08\u7b97\u6709\u591a\u5c11last cluster\u53ef\u77e5\u9053\u6709\u5e7e\u500b\u6a94\u6848<\/p>\n\n\n\n<p><strong>structure of root directory\u3000<\/strong><br>[0] 1byte, status(0xe5=delete,0x00=unallocated)<br>[0-10] file name in ASCII<br>[11] file attribute<br>[12] reserved<br>[13] create time(tenths of second)<br>[14-15] create time(hours,minutes,seconds)<br>[16-17] created day<br>[18-19] accessed day<br>[20-21] high 2 bytes of first cluster address&nbsp;<br>[22-23] written time(hours,minutes,seconds)<br>[24-25] written day<br>[26-27] low 2 bytes of first cluster address , \u8a18\u9304\u8cc7\u6599\u90a3\u5f9e\u88e1\u958b\u59cb\u8a18\u9304<br>[28-31] 4byte, size of file, 0=directory<br>ps:<br>FAT\u6c92\u6709accessed time<br>filename\u683c\u5f0f\u70ba&#8221;6char&#8221;+&#8221;~1.\u526f\u6a94\u540d&#8221;, \u82e5\u6709\u91cd\u8986\u5247\u589e\u52a0\u5e8f\u865f\u70ba&#8221;6char&#8221;+&#8221;~2.\u526f\u6a94\u540d&#8221;<br>ps:<br>make file disappear, set first character to 0xE5 or 0x00<\/p>\n\n\n\n<p><br><strong>file attribute<\/strong><br>Flag = Value, Description, Essential<br>0000 0001 = 0x01, Read only, No<br>0000 0010 = 0x02, Hidden file, No<br>0000 0100 = 0x04, System file, No<br>0000 1000 = 0x08, Volume label, Yes<br>0000 1111 = 0x0f, Long file name, Yes<br>0001 0000 = 0x10, Directory, Yes<br>0010 0000 = 0x20, Archive, No<\/p>\n\n\n\n<p>&#8230;<\/p>\n\n\n\n<p><strong>Lost clusters<\/strong><br>\u4ee5\u4e0b\u5169\u60c5\u6cc1\u540c\u6642\u767c\u751f\u6642\u8868\u793acluster\u907a\u5931<br>OS does not allocate cluster to any file,&nbsp;ex:a file is deleted from the directory listing<br>OS marks cluster as used,&nbsp;ex:FAT still shows the clusters allocated to the file<\/p>\n\n\n\n<p>&#8230;&nbsp;<\/p>\n\n\n\n<p><strong>chkdisk<\/strong><br>\u6aa2\u67e5\u76ee\u9304\u7d50\u69cb\u548c FAT \u4e0d\u4e00\u81f4\u6027\u7684\u5de5\u5177<br>\u53ef\u6aa2\u67e5\u4ee5\u4e0b:<br>\u3000\u7121\u6548\u7684\u6307\u6a19\u5230\u8cc7\u6599\u5340\u57df<br>\u3000\u76ee\u9304\u9805\u76ee\u4e2d\u7684\u4e0d\u6b63\u78ba\u7684\u6a94\u6848\u5c6c\u6027<br>\u3000\u640d\u58de\uff0c\u56e0\u6b64\u7121\u6cd5\u6aa2\u67e5\u4e00\u6216\u591a\u500b\u8def\u5f91\u7684\u76ee\u9304\u7684\u4e00\u90e8\u4efd<br>\u3000\u6574\u500b\u76ee\u9304\uff0c\u8b93\u8a72\u76ee\u9304\u4e2d\u6240\u5305\u542b\u7684\u6a94\u6848\u7121\u6cd5\u5b58\u53d6\u7684\u640d\u58de<br>\u3000\u5728 FAT \u640d\u58de\u7684\u78c1\u789f\u78c1\u6247\u5340<br>\u3000Invalid cluster numbers in the FAT(\u7121\u6548\u7684\u53e2\u96c6\u5728FAT)<br>\u3000Lost Cluster(\u907a\u5931\u53e2\u96c6):\u53e2\u96c6\u8b58\u5225\u672a\u88ab\u6307\u6d3e\u81f3\u6a94\u6848<br>\u3000\u4ea4\u4e92\u9023\u7d50\u7684\u6a94\u6848\u76f8\u540c\u7684\u53e2\u96c6 (\u8d85\u904e\u4e00\u500b\u6a94\u6848\u5df2\u88ab\u6307\u6d3e\u76f8\u540c\u7684\u53e2\u96c6)<br>refer<br>(https:\/\/support.microsoft.com\/zh-tw\/kb\/71609)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FATFAT12: Developed 1977 (MS D &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[18],"tags":[],"class_list":["post-627","post","type-post","status-publish","format-standard","hentry","category-windows"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=627"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/627\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}