# Modify a yocto images \`/data/\` partition before flashing

**URL:** <https://hub.mender.io/t/modify-a-yocto-images-data-partition-before-flashing/3370>\
**Category:** General Discussions\
**Tags:** yocto\
**Created:** [March 15, 2021, 3:45pm UTC](https://hub.mender.io/t/modify-a-yocto-images-data-partition-before-flashing/3370 "2021-03-15T15:45:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HerrMuellerluedensch](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/herrmuellerluedensch/32/513_2.png) [@HerrMuellerluedensch](https://hub.mender.io/u/HerrMuellerluedensch)\
**Post date:** [March 15, 2021, 3:45pm UTC](https://hub.mender.io/t/modify-a-yocto-images-data-partition-before-flashing/3370/1 "2021-03-15T15:45:18Z")

</div>

Hey,  
I would like to manually modify the content of the `/data` partition from a generated yocto image. I mounted the partition using the block offset, changed some data there, compressed and flashed the image with `bmaptool`. Unfortunately, this changes a checksum which `bmaptool` complains about.

Is there a tool such as `mender-artifact` that allows to modify that partition?

EDIT: I just gave it a try to run `bmaptool create` on the (uncompressed) image. The generated `.bmap` file contains just a single line in `<BlockMap>` whereas the original hat around 15 entries. So, I guess this does not work just like that?

EDIT: I successfully flashed the image and booted the device. Also file system expansion of the `/data` partition works as expected. Are there things that can go wrong with regard to future updates this way or do I just have to live with the reduced writing efficiency because of that single `<BlackMap>` entry?

---

<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 18, 2021, 2:42pm UTC](https://hub.mender.io/t/modify-a-yocto-images-data-partition-before-flashing/3370/2 "2021-03-18T14:42:24Z")

</div>

Hi @HerrMuellerluedensch

Have you had a look at the [mender-artifact](https://github.com/mendersoftware/mender-artifact) tool?

The `cat, cp, modify` commands should be able to work with SD images and the data partition at least.
