Changes between Initial Version and Version 1 of waue/2011/0309


Ignore:
Timestamp:
Mar 9, 2011, 11:23:27 AM (13 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • waue/2011/0309

    v1 v1  
     1{{{
     2#!html
     3<div style="text-align: center; color:#151B8D"><big style="font-weight: bold;"><big><big>
     4Linux Exfat 格式支援
     5</big></big></big></div> <div style="text-align: center; color:#7E2217"><big style="font-weight: bold;"><big>
     6解決 mac 10.5.4 格式化後, windows & linux 都無法掛載的問題
     7</big></big></div>
     8}}}
     9[[PageOutline]]
     10
     11exFAT(Extended File Allocation Table,又名FAT64)是一種特別適合於閃存驅動器的檔案系統
     12
     13{{{
     14#!html
     15<tbody><tr style="text-align: center; font-size: larger; margin-left: inherit;" bgcolor="lightgreen">
     16<th></th>
     17<th colspan="3">FAT</th>
     18</tr>
     19<tr style="vertical-align: top;">
     20<th bgcolor="lightgrey"><a href="/wiki/%E8%BB%9F%E4%BB%B6%E8%A8%AD%E8%A8%88%E5%B8%AB" title="軟件設計師" class="mw-redirect">開發商</a></th>
     21<td colspan="3"><a href="/wiki/%E5%BE%AE%E8%BB%9F" class="mw-redirect" title="微軟">微軟</a></td>
     22</tr>
     23<tr style="vertical-align: top;">
     24<th rowspan="2" bgcolor="lightgrey">全名</th>
     25<td colspan="3">檔案配置表</td>
     26
     27</tr>
     28<tr>
     29<td>(12位元版本)</td>
     30<td>(16位元版本)</td>
     31<td>(32位元版本)</td>
     32</tr>
     33<tr style="vertical-align: top;">
     34<th bgcolor="lightgrey">發布</th>
     35<td>1980年前<br>
     36(<a href="/wiki/Microsoft_BASIC" title="Microsoft BASIC">微軟Disk BASIC</a>)</td>
     37
     38<td>1987年11月<br>
     39(<a href="/wiki/Compaq" class="mw-redirect" title="Compaq">Compaq</a> <a href="/wiki/MS-DOS" title="MS-DOS">DOS 3.31</a>)</td>
     40<td>1996年8月<br>
     41(<a href="/wiki/Windows_95">Windows 95</a> OSR2)</td>
     42</tr>
     43<tr style="vertical-align: top;">
     44
     45<th bgcolor="lightgrey"><a href="/wiki/%E7%A1%AC%E7%A3%81%E7%A2%9F%E5%88%86%E5%89%B2" title="硬磁碟分割" class="mw-redirect">分區標識</a></th>
     46<td>0x01(<a href="/wiki/MBR" class="mw-redirect" title="MBR">MBR</a>)</td>
     47<td>0x04, 0x06, 0x0E(<a href="/wiki/MBR" class="mw-redirect" title="MBR">MBR</a>)</td>
     48<td>0x0B, 0x0C(<a href="/wiki/MBR" class="mw-redirect" title="MBR">MBR</a>)<br>
     49<small>EBD0A0A2-B9E5-4433<br>
     50-87C0-68B6B72699C7(<a href="/wiki/%E5%85%A8%E5%B1%80%E5%94%AF%E4%B8%80%E6%A8%99%E8%AD%98%E5%88%86%E5%8D%80%E8%A1%A8" title="全局唯一標識分區表" class="mw-redirect">GPT</a>)</small></td>
     51
     52</tr>
     53<tr style="text-align: center; margin-left: inherit;" bgcolor="lightgreen">
     54<th>結構</th>
     55<th><b>FAT12</b></th>
     56<th><b>FAT16</b></th>
     57<th><b>FAT32</b></th>
     58</tr>
     59<tr style="vertical-align: top;">
     60<th bgcolor="lightgrey">目錄內容</th>
     61<td colspan="3" align="center"><a href="/wiki/%E8%A1%A8%E6%A0%BC">表格</a></td>
     62</tr>
     63
     64<tr style="vertical-align: top;">
     65<th bgcolor="lightgrey">檔案配置</th>
     66<td colspan="3" align="center"><a href="/wiki/%E9%93%BE%E8%A1%A8" title="鏈表">連結串列</a></td>
     67</tr>
     68<tr style="vertical-align: top;">
     69<th bgcolor="lightgrey">壞塊</th>
     70<td colspan="3" align="center">對含損壞磁區的叢集加以標誌</td>
     71</tr>
     72<tr style="text-align: center; margin-left: inherit;" bgcolor="lightgreen">
     73<th>限制</th>
     74<th><b>FAT12</b></th>
     75
     76<th><b>FAT16</b></th>
     77<th><b>FAT32</b></th>
     78</tr>
     79<tr style="vertical-align: top;">
     80<th bgcolor="lightgrey">最大檔案大小</th>
     81<td>32 <a href="/wiki/Mebibyte" title="Mebibyte">MB</a></td>
     82<td>2 <a href="/wiki/Gibibyte" title="Gibibyte">GB</a></td>
     83<td>4 <a href="/wiki/Gibibyte" title="Gibibyte">GB</a> - 1 byte<br>
     84
     85(2<sup>32</sup>-1)</td>
     86</tr>
     87<tr style="vertical-align: top;">
     88<th bgcolor="lightgrey">最大檔案數量</th>
     89<td>4,077<br>
     90(2<sup>12</sup>-19)</td>
     91<td>65,517<br>
     92(2<sup>16</sup>-19)</td>
     93
     94<td>268,435,437<br>
     95(2<sup>28</sup>-19)</td>
     96</tr>
     97<tr style="vertical-align: top;">
     98<th bgcolor="lightgrey">最長檔名限制</th>
     99<td colspan="3"><a href="/wiki/8.3">8.3</a> 或者 長文件名255個字符</td>
     100</tr>
     101<tr style="vertical-align: top;">
     102<th bgcolor="lightgrey">最大卷大小</th>
     103
     104<td>32 <a href="/wiki/Mebibyte" title="Mebibyte">MB</a></td>
     105<td>2 <a href="/wiki/Gibibyte" title="Gibibyte">GB</a>,<br>
     106<small>使用 64KB 叢集時可達 4 <a href="/wiki/Gibibyte" title="Gibibyte">GB</a>,但非所有系統均支援</small></td>
     107<td>2 <a href="/wiki/Tebibyte" title="Tebibyte">TB</a> <small><br>
     108使用 32KB 叢集時可達 8 <a href="/wiki/Tebibyte" title="Tebibyte">TB</a></small></td>
     109
     110</tr>
     111<tr style="text-align: center; margin-left: inherit;" bgcolor="lightgreen">
     112<th>Features</th>
     113<th><b>FAT12</b></th>
     114<th><b>FAT16</b></th>
     115<th><b>FAT32</b></th>
     116</tr>
     117<tr style="vertical-align: top;">
     118<th bgcolor="lightgrey">記錄日期</th>
     119<td colspan="3">創建、修改、訪問</td>
     120
     121</tr>
     122<tr style="vertical-align: top;">
     123<th bgcolor="lightgrey">日期範圍</th>
     124<td colspan="3"><a href="/wiki/1980%E5%B9%B4">1980年</a><a href="/wiki/1%E6%9C%881%E6%97%A5">1月1日</a>至<a href="/w/index.php?title=2107%E5%B9%B4&amp;action=edit&amp;redlink=1" class="new" title="2107年 (頁面未存在)">2107年</a><a href="/wiki/12%E6%9C%8831%E6%97%A5">12月31日</a></td>
     125</tr>
     126<tr>
     127<th bgcolor="lightgrey">日期解析度</th>
     128<td colspan="3" style="text-align: center;">2 <a href="/wiki/%E7%A7%92" title="秒">s</a></td>
     129
     130</tr>
     131<tr style="vertical-align: top;">
     132<th bgcolor="lightgrey"><a href="/w/index.php?title=Fork_%28filesystem%29&amp;action=edit&amp;redlink=1" class="new" title="Fork (filesystem) (頁面未存在)">岔流</a></th>
     133<td colspan="3"><a href="#FAT_and_Alternate_Data_Streams">非原生</a></td>
     134</tr>
     135<tr style="vertical-align: top;">
     136<th bgcolor="lightgrey">屬性</th>
     137<td colspan="3">唯讀,隱藏,系統,卷標,子目錄,歸檔<sup id="cite_ref-0" class="reference"><a href="#cite_note-0">[1]</a></sup></td>
     138</tr>
     139<tr style="vertical-align: top;">
     140<th bgcolor="lightgrey"><a href="http://en.wikipedia.org/wiki/File_system_permissions" class="extiw" title="en:File system permissions">訪問許可權</a></th>
     141
     142<td colspan="3" align="center">無</td>
     143</tr>
     144<tr style="vertical-align: top;">
     145<th bgcolor="lightgrey">透明壓縮</th>
     146<td colspan="2">Per-volume, <a href="/w/index.php?title=Stac_Electronics&amp;action=edit&amp;redlink=1" class="new" title="Stac Electronics (頁面未存在)">Stacker</a>,<a href="/w/index.php?title=DoubleSpace&amp;action=edit&amp;redlink=1" class="new" title="DoubleSpace (頁面未存在)">DoubleSpace</a>,<a href="/w/index.php?title=DriveSpace&amp;action=edit&amp;redlink=1" class="new" title="DriveSpace (頁面未存在)">DriveSpace</a></td>
     147<td>無</td>
     148</tr>
     149<tr style="vertical-align: top;">
     150
     151<th bgcolor="lightgrey">透明加密</th>
     152<td colspan="2">Per-volume only with <a href="/wiki/DR-DOS">DR-DOS</a></td>
     153<td>無</td>
     154</tr>
     155</tbody>
     156}}}
     157
     158
     159其實會使用的原因在於,用家中的mac mini server 可以對外接硬碟格式化的選擇,除了 mac 自家的檔案格式,就剩下 fat32 , exfat兩種可以選。
     160
     161而fat32 有單一檔案4G以下的限制,因此只剩下exfat 可以選。
     162
     163下面是讓linux 支援 exfat 的方式
     164
     165{{{
     166apt-get install scons  libfuse-dev subversion
     167svn co http://exfat.googlecode.com/svn/trunk/ exfat-read-only
     168cd exfat-read-only
     169scons
     170scons install
     171}}}
     172
     173
     174不過陷阱在於,用mac mini server 選擇exfat 作格式化,似乎只有自己看得懂,安裝了patch的 windows 與 fuse-exfat 的linux 都無法讀取,一整個感覺良好。
     175
     176{{{
     177$ sudo mount -t exfat-fuse -o allow_other /dev/sdc1 /mnt/
     178FUSE exfat 0.9.4
     179ERROR: invalid VBR checksum 0xd93a39db (expected 0xd93a39fb).
     180}}}
     181
     182以下經過用ubuntu 小小測試成功破解以上限制。
     183到exfat的專案下,將 libexfat/mount.c 的 188~194 行註解,如下
     184{{{
     185#!c
     186        /* use zero_sector as a temporary buffer for VBR checksum verification *
     187        if (verify_vbr_checksum(ef->zero_sector, SECTOR_SIZE(*ef->sb), ef->fd) != 0)
     188        {
     189                free(ef->zero_sector);
     190                close(ef->fd);
     191                free(ef->sb);
     192                return -EIO;
     193        }*/
     194}}}
     195
     196並重新執行 scons ; sudo scons install 即可