# Data partition is not expanded

**URL:** <https://hub.mender.io/t/data-partition-is-not-expanded/4168>\
**Category:** General Discussions\
**Created:** [October 8, 2021, 9:08pm UTC](https://hub.mender.io/t/data-partition-is-not-expanded/4168 "2021-10-08T21:08:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![azarubkin](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@azarubkin](https://hub.mender.io/u/azarubkin)\
**Post date:** [October 8, 2021, 9:08pm UTC](https://hub.mender.io/t/data-partition-is-not-expanded/4168/1 "2021-10-08T21:08:15Z")

</div>

I have followed the [instructions](https://hub.mender.io/t/beaglebone-black-debian/1542) to install Mender to my Beaglebone Black. The only difference is that I specified a different config to prepare the image for internal eMMC rather than SD card.  
I booted the device from SD card with the official image and flashed the prepared Mender image to the eMMC.  
The device boots up and is visible in the dashboard. However, the data partition is not expanded, whereas it is said in the instructions that it should be expanded on the first boot. How can I troubleshoot this?

My partitions sizes:  
P1 - 40M  
P2 - 660M  
P3 - currently not mounted, but I assume it to be equal to P2, 660M  
P4 - 108M

The full size of Beaglebone Black eMMC is around 4G.

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [October 12, 2021, 9:44am UTC](https://hub.mender.io/t/data-partition-is-not-expanded/4168/2 "2021-10-12T09:44:27Z")

</div>

Can you check that the `/etc/fstab` contains `x-systemd.growfs` for the data partition, and that systemd is at least version 236?

---

<div class="post-metadata">

**Author:** ![azarubkin](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@azarubkin](https://hub.mender.io/u/azarubkin)\
**Post date:** [October 12, 2021, 2:00pm UTC](https://hub.mender.io/t/data-partition-is-not-expanded/4168/3 "2021-10-12T14:00:54Z")

</div>

It does, and systemd is version 241.  
Could it be that data partition resizing was tested on SD card, which is visible under /dev/mmcblk0, and I’m running off eMMC, which is visible under /dev/mmcblk1?

`sudo systemctl status systemd-growfs@data.service` says, among other things: `code=exited, status=0/success`.

Searching in /var/log/daemon.log brings up the following string: `Successfully resized "/data" to 128.0M bytes (32768 blocks of 4096 bytes).`

Here are two excertps from mender-convert log file:

```auto
2021-10-12 13:28:08 [INFO] [mender-convert-package] Using configuration file: configs/mender_convert_config
2021-10-12 13:28:08 [INFO] [mender-convert-package] Using configuration file: ./work/override_compression_config
2021-10-12 13:28:08 [INFO] [mender-convert-package] Using configuration file: configs/beaglebone_black_debian_emmc_config
2021-10-12 13:28:08 [INFO] [mender-convert-package] Rootfs filesystem size will be 1100 MiB

```

and

```auto
2021-10-12 13:29:05 [INFO] [mender-convert-package] Creating Mender compatible disk-image
2021-10-12 13:29:05 [INFO] [mender-convert-package] Total disk size: 3648 MiB
2021-10-12 13:29:05 [INFO] [mender-convert-package] Boot partition 40 MiB
2021-10-12 13:29:05 [INFO] [mender-convert-package] RootFS partitions 1728 MiB x 2
2021-10-12 13:29:05 [INFO] [mender-convert-package] Data partition 128 MiB

```

If data partition is at the end of the memory, it is understandable it can’t expand. But why mender-convert is determining rootfs filesystem size as 1100 MiB, and then setting RootFS partitions to 1728 MiB?  
In the booted image, `df -h` displays rootfs partition as 1.1G:

```auto
debian@beaglebone:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 215M 0 215M 0% /dev
tmpfs 49M 264K 49M 1% /run
/dev/mmcblk1p3 1.1G 743M 238M 76% /
tmpfs 243M 0 243M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 243M 0 243M 0% /sys/fs/cgroup
/dev/mmcblk1p1 40M 6.7M 34M 17% /boot/efi
/dev/mmcblk1p4 108M 160K 99M 1% /data
tmpfs 49M 0 49M 0% /run/user/1000

```

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [October 14, 2021, 12:39pm UTC](https://hub.mender.io/t/data-partition-is-not-expanded/4168/4 "2021-10-14T12:39:47Z")

</div>

in my experience `x-systemd.growfs` grows the file system but will not grow the partition table.

At around systemd 245/246 they added a repart service for growing partition tables, however my systems are older than that, which meant that i needed to add my own repart systemd service for my mender projects.

I believe that mender has a systemd grow partition service, which i think is only part of the meta-mender yocto layer, however there is an example of one being added in in the raspberry pi mender-convert config using a hook which you could pinch

> <https://github.com/mendersoftware/mender-convert/blob/master/configs/images/raspberrypi_raspbian_config#L22>

[https://www.freedesktop.org/software/systemd/man/systemd-repart.html](https://www.freedesktop.org/software/systemd/man/systemd-repart.html)
