# Reading inactive partition version

**URL:** <https://hub.mender.io/t/reading-inactive-partition-version/4108>\
**Category:** General Discussions\
**Created:** [September 23, 2021, 5:53am UTC](https://hub.mender.io/t/reading-inactive-partition-version/4108 "2021-09-23T05:53:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)\
**Post date:** [September 23, 2021, 5:53am UTC](https://hub.mender.io/t/reading-inactive-partition-version/4108/1 "2021-09-23T05:53:29Z")

</div>

Hello,

I need to add some sanity checks during update so according mender documentation I plan to use state script. I’m in process of added ArtifactCommit\_Enter\_00\_update-certificates script which basically need to check what was previous version (actual I can read from /etc …). Is there some simple way how to read it or so I need to do magic with reading u-boot env, mount inactive and read it?

Thanks.

---

<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:** [September 23, 2021, 9:57am UTC](https://hub.mender.io/t/reading-inactive-partition-version/4108/2 "2021-09-23T09:57:43Z")

</div>

You could use a combination of `ArtifactInstall_Leave` and `ArtifactCommit_Enter`, and save a copy of what you need in `/data` temporarily in `ArtifactInstall_Leave`.

---

<div class="post-metadata">

**Author:** ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)\
**Post date:** [September 23, 2021, 10:15am UTC](https://hub.mender.io/t/reading-inactive-partition-version/4108/3 "2021-09-23T10:15:28Z")

</div>

I think it is kind of general pattern to have possibility to check from which version I’m updated to so was thinking that there is something already done in this regard 😉 . I’ll use your advice. Thanks.
