# ROOTFS\_SIZE calculation

**URL:** <https://hub.mender.io/t/rootfs-size-calculation/1160>\
**Category:** General Discussions\
**Tags:** yocto\
**Created:** [October 18, 2019, 7:58am UTC](https://hub.mender.io/t/rootfs-size-calculation/1160 "2019-10-18T07:58:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![opopops1](https://avatars.discourse-cdn.com/v4/letter/o/b77776/32.png) [@opopops1](https://hub.mender.io/u/opopops1)\
**Post date:** [October 18, 2019, 7:58am UTC](https://hub.mender.io/t/rootfs-size-calculation/1160/1 "2019-10-18T07:58:15Z")

</div>

Hi,

I’m facing to a problem during do\_image\_ext4 task with my yocto project an especially during ROOTFS size calculation.

I’ve integrated Mender with these parameters:

```shell
MENDER_STORAGE_TOTAL_SIZE_MB_DEFAULT = "15028"
MENDER_STORAGE_TOTAL_SIZE_MB = "15028"
MENDER_DATA_PART_SIZE_MB = "7514"

```

So Mender calculate these partitions

**boot** =\> 16MB  
**rootA** =\> 3749 MB  
**rootB** =\> 37549MB

The size of my ROOTFS (without data directory) is 1GB.  
During the build, a custom recipe move about 4GB into the data directory of the ROOTFS.

The problem is that during **do\_image\_ext4** task, there is a check that verify if ROOTFS size do not exceed **rootA/B** partition size, and it fails because the check integrate data directory.

Is there a way to avoid that?

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [October 18, 2019, 8:04am UTC](https://hub.mender.io/t/rootfs-size-calculation/1160/2 "2019-10-18T08:04:18Z")

</div>

Depends a bit on which Yocto version you are running, but this has been fixed already,

> <https://github.com/mendersoftware/meta-mender/pull/814>

This has been backported to `thud`

---

<div class="post-metadata">

**Author:** ![opopops1](https://avatars.discourse-cdn.com/v4/letter/o/b77776/32.png) [@opopops1](https://hub.mender.io/u/opopops1)\
**Post date:** [October 21, 2019, 4:02pm UTC](https://hub.mender.io/t/rootfs-size-calculation/1160/3 "2019-10-21T16:02:57Z")

</div>

Thank you very much for the reply, I’m using sumo version so I’ve found another solution, I have overriden the the function “ **get\_rootfs\_size** ” of the poky image class and updated this line:

```shell
output = subprocess.check_output(['du', '-ks', '--exclude=data',
                                      d.getVar('IMAGE_ROOTFS')])

```
