<p>
<i>This page is under construction, these are preliminary notes, corrections requested</i> 
</p>
<p>
As originally distributed, Minix 2.0.0 could use a maximum of 16 MB of
memory.  A fix for this was posted in June 1998, and was incorporated
into all later releases.
</p>

<h4>Disk and file sizes:</h4>
<p>

2.0.3, 2.0.4: The 4 gigabyte disk limit has been replaced by a 2
terabyte limit.  (IDE disks still limited to 128G though.  Individual
partitions also still limited to 4G.  See note below.) Maximum file
size is slightly more than 64 Mbytes.  Possible bug: Tar will poop out
when you try to create an archive larger than this, and an attempt to
transfer the file that is created over an ethernet will then crash the
system.

</p>
<p>
2.0.0: The maximum size of a file system is 1 Gb for a version 2 file
system, and 64 Mb for a version 1 file system.  Alas the 8086 fsck runs
out of memory on a V2 file system larger than 128 Mb, so for the 8086
version of MINIX you have to limit yourself to file systems of that
size.  a Minix file system can only contain 65535 inodes (files)
</p>

<h4>Accessing FAT file systems</h4>
<p>
<b>Mtools</b> was added to the standard Minix distribution with release
2.0.3.
</p>
<p>

<b>Dosdir</b>|<b>dosread</b>|<b>doswrite</b> can only access small FAT
file systems.  How small?  I've hunted through archives of the
newsgroup and mailing list to try to answer this.  There have been
various modifications to these tools over the years.  Originally they
were intended just for reading floppy disks (Minix itself did not
originally support hard disks).  Possibly the earliest version
supported only FAT12 file systems -- there are notes from users who
could not access 32 MB partitions.  However, at some point the design
was changed to support both FAT12 and FAT16 file systems, with block
(cluster) sizes up to 4006 bytes.  This would imply that a partition up
to 256 MB size can be accessed.  I found a note in the archives from
Claudio Tantignone that suggested changing a constant in the source
from 4096 to 8192, which would allow access to partitions up to 512 MB.

</p>
<p>
A volume formatted with the FAT file system is allocated in clusters.
The default cluster size is determined by the size of the volume.  For
the FAT file system, the cluster number must fit in 16 bits and must be
a power of two.
</p>

<table border="1" cellspacing="2" cellpadding="4" width="520" align="center">
<tr>
<td bgcolor="#808080"><b>System</b></td>	
<td bgcolor="#808080"><b>Bytes Per Cluster in FAT</b></td>
<td bgcolor="#808080"><b>Cluster limit</b></td>
</tr>
<tr>
<td bgcolor="#c0c0c0"><b>FAT12</b></td>
<td><center>1.5</center></td>
<td> &lt; 4087 clusters</td>
</tr>
<tr>
<td bgcolor="#c0c0c0"><b>FAT16</b></td>
<td><center>2</center></td>
<td>4087 to 65525 clusters</td>
</tr>
<tr>
<td bgcolor="#c0c0c0"><b>FAT32</b></td>
<td><center>4</center></td>
<td>65526 to 268,435,456 clusters</td>
</tr>
</table>

<p>
By design FAT supports a maximum of 64K allocation units.  When the
disk partition is 32 megabytes or less, then an allocation unit is a
512 byte sector.  However, as the disk gets larger, the units get
larger.  A 64 megabyte disk partition has 1K allocation units.  A 128
meg partition has 2K units.  A 256 meg partition has 4K allocation units. 
(source: http://www.yale.edu/pclt/BOOT/fat.htm)
</p>
<table border="1" cellspacing="2" cellpadding="4" width="529" align="center">
  <tr>
    <td width="131" bgcolor="#808080"><center><font size="2"><b>Attribute</b></font></center></td>
    <td width="128" bgcolor="#808080"><center><font size="2"><b>FAT12</b></font></center></td>
    <td width="129" bgcolor="#808080"><center><font size="2"><b>FAT16</b></font></center></td>
    <td width="129" bgcolor="#808080"><center><font size="2"><b>FAT32</b></font></center></td>
  </tr>

  <tr>
    <td width="131" bgcolor="#C0C0C0"><center><font size="2"><b>Used For</b></font></center></td>
    <td width="128"><center><font size="2">Floppies and small hard disk volumes</font></center></td>
    <td width="129"><center><font size="2">Small to large hard disk volumes</font></center></td>
    <td width="129"><center><font size="2">Medium to very large hard disk volumes</font></center></td>
  </tr>
  <tr>

    <td width="131" bgcolor="#C0C0C0"><center><font size="2"><b>Size of Each FAT
    Entry</b></font></center></td>
    <td width="128"><center><font size="2">12 bits</font></center></td>
    <td width="129"><center><font size="2">16 bits</font></center></td>
    <td width="129"><center><font size="2">28 bits</font></center></td>
  </tr>
  <tr>
    <td width="131" bgcolor="#C0C0C0"><center><font size="2"><b>Maximum Number of
    Clusters</b></font></center></td>

    <td width="128"><center><font size="2">4,086</font></center></td>
    <td width="129"><center><font size="2">65,526</font></center></td>
    <td width="129"><center><font size="2">~268,435,456</font></center></td>
  </tr>
  <tr>
    <td width="131" bgcolor="#C0C0C0"><center><font size="2"><b>Cluster Size Used</b></font></center></td>
    <td width="128"><center><font size="2">0.5 KB to 4 KB</font></center></td>

    <td width="129"><center><font size="2">2 KB to 32 KB</font></center></td>
    <td width="129"><center><font size="2">4 KB to 32 KB</font></center></td>
  </tr>
  <tr>
    <td width="131" bgcolor="#C0C0C0"><center><font size="2"><b>Maximum Volume Size</b></font></center></td>
    <td width="128"><center><font size="2">16,736,256</font></center></td>
    <td width="129"><center><font size="2">2,147,123,200</font></center></td>

    <td width="129"><center><font size="2">about 2^41</font></center></td>
  </tr>
</table>
<p>
(source: http://www.storagereview.com/guide2000/ref/hdd/file/partSizes.html)
</p>

<p>
More info on FAT file system partition (volume) size limits:
</p>

<table border="1" cellspacing="2" cellpadding="4" align="center">
<tr>
<td bgcolor="#808080"><b>Block size</b></td>
<td bgcolor="#808080"><b>FAT-12</b></td>
<td bgcolor="#808080"><b>FAT-16</b></td> 
<td bgcolor="#808080"><b>FAT-32</b></td> 
</tr>
<tr>
<td bgcolor="#c0c0c0"><b>0.5 KB</b></td> 
<td>2 MB</td> 
<td> &nbsp; </td> 
<td> &nbsp; </td>
</tr>
<tr>
<td bgcolor="#c0c0c0"><b>1 KB</b></td> 
<td>4 MB</td> 
<td> &nbsp; </td> 
<td> &nbsp; </td>
</tr>
<tr>
<td bgcolor="#c0c0c0"><b>2 KB</b></td> 
<td>8 MB</td> 
<td>128 KB</td> 
<td> &nbsp; </td>
</tr>
<tr>
<td bgcolor="#c0c0c0"><b>4 KB</b></td> 
<td>16 MB</td> 
<td>256 MB</td> 
<td>1 TB</td>
</tr>
<tr>
<td bgcolor="#c0c0c0"><b>8 KB</b></td> 
<td> &nbsp; </td> 
<td>512 MB</td> 
<td>2 TB</td>
</tr>
<tr>
<td bgcolor="#c0c0c0"><b>16 KB</b></td> 
<td> &nbsp; </td> 
<td>1024 MB</td> 
<td>2 TB</td>
</tr>
<tr>
<td bgcolor="#c0c0c0"><b>32 KB</b></td> 
<td> &nbsp; </td> 
<td>2048 MB</td> 
<td>2 TB</td>
</tr>
</table>

<p>
(source A.S. Tanenbaum, Modern Operating Systems, 2nd ed., p. 441) 
</p>
<h4>
Note on FS size (2006-06-20)
</h4>
<pre>
[From comp.os.minix. Question is about Minix 3, but answer is applicable to 
Minix 2, as well]

From: Ben Gras <b...@few.vu.nl>
Newsgroups: comp.os.minix
Subject: Re: Minix uses 4GB HD at most?
Date: 20 Jun 2006 07:44:43 GMT
Message-ID: <slrne9f9rb.p3q.beng@kits.cs.vu.nl>

> I think 4GB is the limit of a Minix v3 filesystem.  You could create 
> more partitions, but I don't know what you would do with that much 
> space in Minix; you might install Linux in some of that space.

4GB is a limit, but not directly of the Minix filesystem. It is a limit
of the FS <-> device driver protocol. The FS talks to the device
drivers using minor device numbers, offsets in bytes (32 bit), and
sizes (32 bit).

I expect the filesystem to be able to work with 2^32 blocks, where each
block size is determined at mkfs time (4kB is the current default).
That would give rise to filesystems larger than any current disk.

The AT driver can completely address disks using LBA48.

It's only a matter of
 (a) The device driver protocol being extended to 64-bit offsets
     (actually this is already done and will soon be in cvs).
 (b) The filesystem being able to handle 64-bit file offset
     pointers (so that >4GB filesystems can be fscked). With
     a 64-bit seek call. This is a bit more work. :)

	=Ben
</pre>
