# Alter files in the new filesystem before reboot

**URL:** <https://hub.mender.io/t/alter-files-in-the-new-filesystem-before-reboot/5584>\
**Category:** General Discussions\
**Tags:** nvidia, state-scripts, ota\
**Created:** [February 1, 2023, 5:09pm UTC](https://hub.mender.io/t/alter-files-in-the-new-filesystem-before-reboot/5584 "2023-02-01T17:09:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adriannawenz](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/adriannawenz/32/1826_2.png) [@adriannawenz](https://hub.mender.io/u/adriannawenz)\
**Post date:** [February 1, 2023, 5:09pm UTC](https://hub.mender.io/t/alter-files-in-the-new-filesystem-before-reboot/5584/1 "2023-02-01T17:09:01Z")

</div>

I want to symlink certain files from the new artifact to a /data partition before rebooting. Is this possible to do in the ArtifactInstall\_Leave? I believe ArtifactInstall\_Leave occurs in the old file system. Is there a way to refer to files in the new file system and symlink them, for example using an environment variable like MENDER\_ARTIFACT\_DIR/…/rootfs/. I am using an nvidia tx2 with A/B system updates.

---

<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 3, 2023, 7:16am UTC](https://hub.mender.io/t/alter-files-in-the-new-filesystem-before-reboot/5584/2 "2023-02-03T07:16:06Z")

</div>

Forwarding explanation by @tranchitella:

In the context of a rootfs update:

- **ArtifactInstall\_Leave** happens in the old file system once the data is fully written to the inactive partition; technically you can have access to the new file system but your state script will have to mount it somewhere.

- **ArtifactReboot\_Enter** happens in the new file system after the reboot, but before the commit. There is still the possibility that the deployment will fail and the device will roll back to the old file system. Again, you can have access to the old file system but you have to manually mount it.

---

<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:** [February 6, 2023, 6:14am UTC](https://hub.mender.io/t/alter-files-in-the-new-filesystem-before-reboot/5584/3 "2023-02-06T06:14:02Z")

</div>

Slight clarification: `ArtifactReboot_Enter` also runs using the old filesystem, it is `ArtifactReboot_Leave` which runs with the new filesystem.
