# Why is my root filesystem so much smaller than my root partition?

**URL:** https://hub.mender.io/t/why-is-my-root-filesystem-so-much-smaller-than-my-root-partition/7563
**Category:** General Discussions
**Tags:** ubuntu, mender-convert, rootfs
**Created:** [February 13, 2025, 5:00pm UTC](https://hub.mender.io/t/why-is-my-root-filesystem-so-much-smaller-than-my-root-partition/7563 "2025-02-13T17:00:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![JamesTann](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/jamestann/32/2274_2.png) [@JamesTann](https://hub.mender.io/u/JamesTann)
#### Post date: [February 13, 2025, 5:00pm UTC](https://hub.mender.io/t/why-is-my-root-filesystem-so-much-smaller-than-my-root-partition/7563/1 "2025-02-13T17:00:22Z")

</div>

I am trying to create a new mender artifact for a Ubuntu Server 22 system. My golden image is a bit less than 30GB. I am now using `mender-convert` to make the Mender image.

I am using the `generic_x86-64_hdd_config` and I have set `MENDER_STORAGE_TOTAL_SIZE_MB=61440` in the config.

During my conversion, I noticed a line that stood out to me:

```auto
2025-02-13 15:02:14 [INFO] [mender-convert-package] Rootfs filesystem size will be 16102 MiB

```

I figured this might have been an issue with my partitions but then later in the logs I saw:

```auto
2025-02-13 15:07:50 [INFO] [mender-convert-package] Creating Mender compatible disk-image
2025-02-13 15:07:50 [INFO] [mender-convert-package] Total disk size: 61440 MiB
2025-02-13 15:07:50 [INFO] [mender-convert-package] Boot partition 1080 MiB
2025-02-13 15:07:50 [INFO] [mender-convert-package] RootFS partitions 30104 MiB x 2
2025-02-13 15:07:50 [INFO] [mender-convert-package] Data partition 128 MiB

```

which looks correct to me. So **why is the actual root filesystem so much smaller than its partition?** I am aware that some space is reserved when using an ext4 filesystem but my filesystem is roughly half of the partition size.

I tried installing the new image anyway to see what would happen. Sure enough, it matches the output of `mender-convert`. The partition sizes of the rootfs are each ~30GB but the rootfs (according to `df -h`) is only about ~16GB. **Is there something I need to set in Mender to tell it to resize the root filesystem to use as much of the root partition as it can?**

Any help or insight would be appreciated!

---

<div class="post-metadata">

### Author: ![JamesTann](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/jamestann/32/2274_2.png) [@JamesTann](https://hub.mender.io/u/JamesTann)
#### Post date: [February 13, 2025, 5:16pm UTC](https://hub.mender.io/t/why-is-my-root-filesystem-so-much-smaller-than-my-root-partition/7563/2 "2025-02-13T17:16:47Z")

</div>

I managed to answer my own question after going through my config for `mender-convert` line by line. I had set `IMAGE_ROOTFS_SIZE` to the default `0` thinking this meant it would match the filesystem size on my golden image, but it actually sets it to the size of the _filesystem content_ according to [the docs](https://docs.mender.io/operating-system-updates-debian-family/variables#image_rootfs_size).

Simply setting that to `-1` instead fixed my issue! Hopefully someone will find this helpful in the future to avoid my mistake.

---

<div class="post-metadata">

### Author: ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)
#### Post date: [February 14, 2025, 9:44am UTC](https://hub.mender.io/t/why-is-my-root-filesystem-so-much-smaller-than-my-root-partition/7563/3 "2025-02-14T09:44:00Z")

</div>

Thanks a lot @JamesTann for sharing so our future selves can benefit from it!
