# Mender Convert - Data Partition / Rootfs Overlay Permissions

**URL:** <https://hub.mender.io/t/mender-convert-data-partition-rootfs-overlay-permissions/3817>\
**Category:** General Discussions\
**Created:** [July 1, 2021, 1:00pm UTC](https://hub.mender.io/t/mender-convert-data-partition-rootfs-overlay-permissions/3817 "2021-07-01T13:00:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexC](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@AlexC](https://hub.mender.io/u/AlexC)\
**Post date:** [July 1, 2021, 1:00pm UTC](https://hub.mender.io/t/mender-convert-data-partition-rootfs-overlay-permissions/3817/1 "2021-07-01T13:00:37Z")

</div>

Hi,

Following a previous discussion I’ve been looking into using mender convert rather than snapshots

And I think it’s very nearly there however I have two areas I’m not clear on:

I’m running a program which writes out to a file in the users home directory, I’d like this file to persist between rootfs updates.

I understand that the` /data` partition should be used for this however I don’t have write access as the partition is owned by root.

Is there a way to configure `mender-convert` to change the permissions on the created partitions during the conversion?

Or would it be possible to use state scripts to move files from home to /data and back again during the update process?

My other issue is using rootfs overlays, is there any information on what the permissions / owner of overlay files need to be on the host machine or how ownership is assigned during conversion?

I can’t seem to reliably recreate the issue but when using an overlay (just adding a file to home directory) the file is added correctly however the permissions of other files seemed to be randomly altered (e.g. /etc is owned by pijuice which is a user created by the UPS software similar for random files in the home directory)

Any assistance of info would be greatly appreciated

Thanks

---

<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:** [July 1, 2021, 2:26pm UTC](https://hub.mender.io/t/mender-convert-data-partition-rootfs-overlay-permissions/3817/2 "2021-07-01T14:26:31Z")

</div>

With respects to data partition, in your golden master, setup the /data folder with a subfolder structure as per your requirements with correct permissions and it’ll get copied to the data partition during mender-convert conversion

---

<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:** [July 1, 2021, 2:39pm UTC](https://hub.mender.io/t/mender-convert-data-partition-rootfs-overlay-permissions/3817/3 "2021-07-01T14:39:56Z")

</div>

You also have hooks available to make changes during the mender-convert process

[https://docs.mender.io/system-updates-debian-family/convert-a-mender-debian-image/customization](https://docs.mender.io/system-updates-debian-family/convert-a-mender-debian-image/customization)

---

<div class="post-metadata">

**Author:** ![AlexC](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@AlexC](https://hub.mender.io/u/AlexC)\
**Post date:** [July 1, 2021, 2:53pm UTC](https://hub.mender.io/t/mender-convert-data-partition-rootfs-overlay-permissions/3817/4 "2021-07-01T14:53:33Z")

</div>

Thank you for the quick reply

Just to clarify, I don’t need a separate `data` partition on my master image but only a folder called `data` placed at root `/`?

---

<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:** [July 1, 2021, 3:01pm UTC](https://hub.mender.io/t/mender-convert-data-partition-rootfs-overlay-permissions/3817/5 "2021-07-01T15:01:04Z")

</div>

Yes, that’s correct. Also, regarding ownership, I think anything created in your golden master will be copied into the new image with the same ownership and permissions.

You can also add files through the mender-convert rootfs-overlay in a similar fashion.

Drew

---

<div class="post-metadata">

**Author:** ![AlexC](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@AlexC](https://hub.mender.io/u/AlexC)\
**Post date:** [July 5, 2021, 11:01am UTC](https://hub.mender.io/t/mender-convert-data-partition-rootfs-overlay-permissions/3817/6 "2021-07-05T11:01:57Z")

</div>

Thanks for the reply

Tried this morning and no luck, do I need to alter a config / parameter somewhere?  
I’m just using the base scripts/configs from `mender-convert` and adding a custom config just for LZMA compression

I’ve added a `data` folder to my golden image’s root which contains a second folder inside (`backup`) that is owned by the user so they have a place to backup to between rootfs updates.

However it doesn’t seem to copy over to the converted image/artifact, after uploading and deploying I see `/data/mender/...` but no `/data/backup/...` on the updated Pi

---

<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:** [July 5, 2021, 2:18pm UTC](https://hub.mender.io/t/mender-convert-data-partition-rootfs-overlay-permissions/3817/7 "2021-07-05T14:18:20Z")

</div>

if starting with the golden master, then you need to do a full re-image of the device from the full disk image created by mender-convert, it wont be part of the mender-artifact as far as i’m aware.

---

<div class="post-metadata">

**Author:** ![AlexC](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@AlexC](https://hub.mender.io/u/AlexC)\
**Post date:** [July 5, 2021, 2:58pm UTC](https://hub.mender.io/t/mender-convert-data-partition-rootfs-overlay-permissions/3817/8 "2021-07-05T14:58:29Z")

</div>

Ah of course, enrolled devices will already have a `/data` partition configured which isn’t being touched by a rootfs update

Flashed a full image and that Pi seems to have the correct structure with the `backup` folder under `/data` will do some testing with it tomorrow

I guess I’ll have to reflash my existing devices or remote in and manually restructure `/data`

Thanks again
