# FreeRTOS+FAT minimal disk size.

**URL:** <https://forums.freertos.org/t/freertos-fat-minimal-disk-size/6989>\
**Category:** Kernel\
**Created:** [February 1, 2018, 8:58am UTC](https://forums.freertos.org/t/freertos-fat-minimal-disk-size/6989 "2018-02-01T08:58:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [February 1, 2018, 8:58am UTC](https://forums.freertos.org/t/freertos-fat-minimal-disk-size/6989/1 "2018-02-01T08:58:07Z")

</div>

**[swichu91](https://sourceforge.net/u/swichu91/)** wrote on [Thursday, February 01, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/631fd941/#2861):

Hello,

Is there any info about minimal size of disk to actually mount fully working FAT file system ? I am planning to use FreeRTOS+FAT on external SDRAM(16MBytes) and wondering if FAT12 or FAT16 will fit.

Thanks in advance.  
Mateusz

---

<div class="post-metadata">

**Author:** ![htibosch](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/htibosch/32/62_2.png) [@htibosch](https://forums.freertos.org/u/htibosch)\
**Post date:** [February 1, 2018, 2:16pm UTC](https://forums.freertos.org/t/freertos-fat-minimal-disk-size/6989/2 "2018-02-01T14:16:23Z")

</div>

**[heinbali01](https://sourceforge.net/u/heinbali01/)** wrote on [Thursday, February 01, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/631fd941/#3f9e):

Mateusz,

You are not the only one asking for a small partition, please read:

[https://sourceforge.net/p/freertos/discussion/382005/thread/2fa0a26d](https://sourceforge.net/p/freertos/discussion/382005/thread/2fa0a26d)  
[https://sourceforge.net/p/freertos/discussion/382005/thread/59ac4be5](https://sourceforge.net/p/freertos/discussion/382005/thread/59ac4be5)

Microsoft invented FAT and they defined the limits (minimal cluster count) per FAT type (12, 16, or 32).  
By default, FreeRTOS+FAT is following these rules. But you can override them.

I prefer to use FAT16 above FAT12, because it is more efficient. So when I need a small RAM-disk, I would define for instance the following in `FreeRTOSFATConfig.h` :

```auto
    /* No support for FAT12: */
    #define ffconfigFAT12_SUPPORT 0

    #define ffconfigMIN_CLUSTERS_FAT16 32
    #define ffconfigFAT16_ROOT_SECTORS 8

```

Call `FF_Format()` as follows :

```auto
    FF_Format( pxDisk, 0 /* xPart *, pdTRUE /* xPreferFAT16 */, pdTRUE /* xSmallClusters */ );

```

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [February 2, 2018, 7:06am UTC](https://forums.freertos.org/t/freertos-fat-minimal-disk-size/6989/3 "2018-02-02T07:06:21Z")

</div>

**[swichu91](https://sourceforge.net/u/swichu91/)** wrote on [Friday, February 02, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/631fd941/#1083):

Hein,

I used search bar but looks like I was typing wrongs search phrases. Anyway these are great info. I was using +FAT in past but couldn’t launch it on nothing more than SD card.

I will give it a try and report problems if any(I hope there won’t be any).

Update:  
I have succesfully managed to mount 4MBytes partition on RAMDisk without any problems. One thing to notice is fact that all FAT API functions need to be invoked after kernel started i.e in task.

Mateusz
