# Increasing paritions size of production mender clients

**URL:** https://hub.mender.io/t/increasing-paritions-size-of-production-mender-clients/1592
**Category:** General Discussions
**Created:** [March 2, 2020, 12:43pm UTC](https://hub.mender.io/t/increasing-paritions-size-of-production-mender-clients/1592 "2020-03-02T12:43:04Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![genedupre](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/genedupre/32/289_2.png) [@genedupre](https://hub.mender.io/u/genedupre)
#### Post date: [March 2, 2020, 12:43pm UTC](https://hub.mender.io/t/increasing-paritions-size-of-production-mender-clients/1592/1 "2020-03-02T12:43:04Z")

</div>

Hello everyone,  
a while ago ive made raspbian 4 pi’s into production, these received an size limit of 8gb (standard option)  
even though they have 16gb sd-cards, the reasoning behind it was, that it was not going to be sure that all future RPI 4 pi’s would receive 16gb sd-cards, thus i decided to stick to the standaard setting.

As times passes on we came to the conclusion that indeed all future RPI 4 pi’s would get an 16gb sd-card, my question is then.  
Is it possible with mender to increase these partitions (eg state-scripts with some best practice commands)  
Or to do it single time mannually over ssh.  
Or not at all & better make an clean image with an higher MENDER\_STORAGE\_TOTAL\_SIZE\_MB

i’m aware of this post

> [@Increase the system partition storage](https://hub.mender.io/t/increase-the-system-partition-storage/1563):
>
> Hello to everyone. I have a question about OS partitions. I didn’t find a solution for this. Is it possible to increase the 2 main partitions with an update? Example: i set the OS partition to 500MB and the data partition to 2GB. I deploy some devices. Later i discover that 500MB for my OS is not enough, so i would like to increase this partition to 1GB. I would like to do this with an update and i would like to avoid to rewrite all the sd-cards. Thank you.

but it was never explained if it was possible or not.

Thanks in advance, Gene

---

<div class="post-metadata">

### Author: ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)
#### Post date: [March 2, 2020, 3:40pm UTC](https://hub.mender.io/t/increasing-paritions-size-of-production-mender-clients/1592/2 "2020-03-02T15:40:06Z")

</div>

In the Yocto layer we have support for systemd-growfs which automatically resizes the data partition on boot. Adding the following to your local.conf should enabled this:

```auto
MENDER_FEATURES_ENABLE_append = "mender-growfs-data"

```

I assume that something similar can be done with Raspbian only the mechanics will differ.

Drew

---

<div class="post-metadata">

### Author: ![oleorhagen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/oleorhagen/32/297_2.png) [@oleorhagen](https://hub.mender.io/u/oleorhagen)
#### Post date: [March 2, 2020, 3:54pm UTC](https://hub.mender.io/t/increasing-paritions-size-of-production-mender-clients/1592/3 "2020-03-02T15:54:16Z")

</div>

For our Raspbian image (although not merged yet), this is what we are going to use, to expand the data partition to fill the sd-card. This is using parted to resize the last partition only (data), but more advanced workflows should be possible.

The cue is that this needs to be run prior to the partition being mounted, as you can see by the data.mount.wants dependency of the systemd service file.

I hope this brings some inspiration, as I am not completely sure which partition(s) you are looking at expanding.

Cheers  
-O

---

<div class="post-metadata">

### Author: ![genedupre](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/genedupre/32/289_2.png) [@genedupre](https://hub.mender.io/u/genedupre)
#### Post date: [March 3, 2020, 3:05pm UTC](https://hub.mender.io/t/increasing-paritions-size-of-production-mender-clients/1592/4 "2020-03-03T15:05:11Z")

</div>

@drewmoseley & @oleorhagen  
thanks for the input! yes i will look into it more, will try some things local first.

I do have an last question, if i do enlarge the partitions (MENDER\_ROOTFS\_PART\_A & \_B)  
is there somewhere a variable that was set during the creation of the image, that has the size of these partitions?  
or does the mender client give the mender server a ‘size’ when pushing an artifact and to see if it fits on that client.  
Greets Gene

---

<div class="post-metadata">

### Author: ![oleorhagen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/oleorhagen/32/297_2.png) [@oleorhagen](https://hub.mender.io/u/oleorhagen)
#### Post date: [March 3, 2020, 3:44pm UTC](https://hub.mender.io/t/increasing-paritions-size-of-production-mender-clients/1592/5 "2020-03-03T15:44:43Z")

</div>

Hi @genedupre.

The size is part of the format we use for delivering the updates (i.e., Mender-Artifact).

Here is an example output from one I created with `mender-convert`:

```bash
mender-artifact git:(mendersoftware/master) ✗ mender-artifact read *.mender
Mender artifact:
  Name: dump
  Format: mender
  Version: 3
  Signature: no signature
  Compatible devices: '[raspberrypi]'
  Provides group: 
  Depends on one of artifact(s): []
  Depends on one of group(s): []
  State scripts:

Updates:
    0:
    Type: rootfs-image
    Provides:
	rootfs_image_checksum: aab96150f7dc51b4c9a8015dd155d7221bd965464ed212e2d71e2e96c02de721
    Depends: Nothing
    Metadata: Nothing
    Files:
      name: rootfs.tmp187950712
      size: 513
      modified: 2020-02-12 14:36:42 +0100 CET
      checksum: aab96150f7dc51b4c9a8015dd155d7221bd965464ed212e2d71e2e96c02de721

```

As far as I know, there is no size-checks on the backend side, so a bigger update can be pushed in a later installment. The client will accept the update, and then fail, when it discovers that the size of the update is larger than the partition is writes to.

This is the error message you should be encountering in this case:

```bash
update (%v bytes) is larger than the size of device %s (%v bytes)

```

I hope this answers your question  
-Ole

---

<div class="post-metadata">

### Author: ![genedupre](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/genedupre/32/289_2.png) [@genedupre](https://hub.mender.io/u/genedupre)
#### Post date: [March 3, 2020, 4:04pm UTC](https://hub.mender.io/t/increasing-paritions-size-of-production-mender-clients/1592/6 "2020-03-03T16:04:22Z")

</div>

@oleorhagen, yes i know enough now, thanks for the help!
