# Mender-Convert specific RootFS size

**URL:** https://hub.mender.io/t/mender-convert-specific-rootfs-size/1732
**Category:** General Discussions
**Tags:** raspberry-pi-3, raspbian, mender-convert
**Created:** [April 1, 2020, 3:06pm UTC](https://hub.mender.io/t/mender-convert-specific-rootfs-size/1732 "2020-04-01T15:06:32Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![fnx\_qt](https://avatars.discourse-cdn.com/v4/letter/f/b4bc9f/32.png) [@fnx\_qt](https://hub.mender.io/u/fnx_qt)
#### Post date: [April 1, 2020, 3:06pm UTC](https://hub.mender.io/t/mender-convert-specific-rootfs-size/1732/1 "2020-04-01T15:06:32Z")

</div>

Hi,

I’m trying to create a mender image from raspbian for the raspberry 3.

As I understand, 4 files are concerned by the process:

- mender\_convert\_config
- raspberrypi\_config
- raspberrypi3\_config
- raspberrypi3\_raspbian\_config

In each of these files (where possible) I set the “IMAGE\_ROOTFS\_SIZE” to 8192MB.  
However, when I create my image, mender-convert will always fill all the sd card size and won’t respect my specific resizing. Thus, my RootFS size are bigger than expected.

Do you have any ideas ?

Thank you in advance

---

<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: [April 1, 2020, 3:17pm UTC](https://hub.mender.io/t/mender-convert-specific-rootfs-size/1732/2 "2020-04-01T15:17:59Z")

</div>

The RootFS should not change size once the device boots, but the last partition (which is mounted at /data) might get expanded to occupy the full disk.

This is control by this variable,

> <https://github.com/mendersoftware/mender-convert/blob/master/configs/mender_convert_config#L38-L43>

---

<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: [April 1, 2020, 3:21pm UTC](https://hub.mender.io/t/mender-convert-specific-rootfs-size/1732/3 "2020-04-01T15:21:45Z")

</div>

Or I might have misunderstood your question. Can you share the output of `fdisk -l <output image>`.

Also notice that the `IMAGE_ROOTFS_SIZE` variable only controls the filesystem image size and not the partition size.

Maybe take a look at this variable as well,

> <https://github.com/mendersoftware/mender-convert/blob/master/configs/mender_convert_config#L68-L74>

---

<div class="post-metadata">

### Author: ![fnx\_qt](https://avatars.discourse-cdn.com/v4/letter/f/b4bc9f/32.png) [@fnx\_qt](https://hub.mender.io/u/fnx_qt)
#### Post date: [April 1, 2020, 3:42pm UTC](https://hub.mender.io/t/mender-convert-specific-rootfs-size/1732/4 "2020-04-01T15:42:19Z")

</div>

This is the output from fdisk on the device using the created image (checked same from img file):

```
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 24576 548863 524288 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 548864 32767999 32219136 15.4G 83 Linux
/dev/mmcblk0p3 32768000 64987135 32219136 15.4G 83 Linux
/dev/mmcblk0p4 64987136 67084287 2097152 1G 83 Linux

```

As I understood : MENDER\_STORAGE\_TOTAL\_SIZE\_MB is used to define the size of the SD Card in total. I defined this to 32768 as my SD Card is a 32GB.

Also what do you mean by filesystem image size ? How does it relate to the partition size ?

MENDER\_DATA\_PART\_GROWFS=y; this part is clear, I setted it to n so the data partition won’t grow up. The problem is that my partitions are already sized badly upon the generation of the image and not on the boot of it.  
The output of mender-convert shows :

```
2020-04-01 14:42:26 [INFO] [mender-convert-package] Total disk size: 32768 MiB
2020-04-01 14:42:26 [INFO] [mender-convert-package] Boot partition 256 MiB
2020-04-01 14:42:26 [INFO] [mender-convert-package] RootFS partitions 15732 MiB x 2
2020-04-01 14:42:26 [INFO] [mender-convert-package] Data partition 1024 MiB

```

Even though I configured the RootFS to be 8GB in size.

Is it possible to fix the RootFS size to 8192 MB (8GB) ?

Thank you for your help

---

<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: [April 1, 2020, 5:36pm UTC](https://hub.mender.io/t/mender-convert-specific-rootfs-size/1732/5 "2020-04-01T17:36:36Z")

</div>

> Is it possible to fix the RootFS size to 8192 MB (8GB) ?

Yes, increase the `MENDER_DATA_PART_SIZE_MB`.

Below should explain why (copied from [Raspberry Pi 3 Model B/B+ Raspbian - #23 by eystein](https://hub.mender.io/t/raspberry-pi-3-model-b-b-raspbian/140/23))

The SD card layout will be the following using the default  
arguments (this with the default 8GB size):

| Part | Type | Purpose | Size | Configure size |
| --- | --- | --- | --- | --- |
| mmcblk0p1 | vfat | Store the bootloader | 44MB | `MENDER_BOOT_PART_SIZE_MB` |
| mmcblk0p2 | ext4 | Store the root file system and kernel (active) | 3908MB | `MENDER_STORAGE_TOTAL_SIZE_MB`[1](https://hub.mender.io/t/raspberry-pi-3-model-b-b-raspbian/140/23#footnote1) |
| mmcblk0p3 | ext4 | Store the root file system and kernel (inactive) | 3908MB | `MENDER_STORAGE_TOTAL_SIZE_MB`[1](https://hub.mender.io/t/raspberry-pi-3-model-b-b-raspbian/140/23#footnote1) |
| mmcblk0p4 | ext4 | Store persistent data, preserved during Mender updates. | 128MB | `MENDER_DATA_PART_SIZE_MB`[2](https://hub.mender.io/t/raspberry-pi-3-model-b-b-raspbian/140/23#footnote2) |

1. The rootfs partition size is calculated using the  
following formula:

```auto
 (storage-total-size-mb - data-part-size-mb - boot-part-size) / 2

```

---

<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: [April 1, 2020, 5:39pm UTC](https://hub.mender.io/t/mender-convert-specific-rootfs-size/1732/6 "2020-04-01T17:39:32Z")

</div>

> [@fnx\_qt](#):
>
> Also what do you mean by filesystem image size ? How does it relate to the partition size ?

It does not (or well, the rootfs image will go in to the partition in the ned), and that is why `IMAGE_ROOTFS_SIZE` does not impact partition sizes and only impacts the rootfs image size.

See separate response regarding partition sizes and how rootfs partition size is calculated.
