# File integrity check in Mender

**URL:** <https://hub.mender.io/t/file-integrity-check-in-mender/1586>\
**Category:** General Discussions\
**Tags:** yocto\
**Created:** [February 27, 2020, 10:42am UTC](https://hub.mender.io/t/file-integrity-check-in-mender/1586 "2020-02-27T10:42:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mEK](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mek/32/377_2.png) [@mEK](https://hub.mender.io/u/mEK)\
**Post date:** [February 27, 2020, 10:42am UTC](https://hub.mender.io/t/file-integrity-check-in-mender/1586/1 "2020-02-27T10:42:04Z")

</div>

Hi community.

While writing a blog on Mender’s update mechanism, I noticed a sentence regarding Mender’s security and robustness :

`*Root filesystem integrity checksum to avoid corruption during transfer or storage.`

However, I could not reach more detailed information about this. How does Mender ensure file integrity? I searched on the source code but couldn’t find it. If anyone has information, I would be happy if he could give details about it.

Thanx,  
Emre

---

<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:** [February 27, 2020, 11:38am UTC](https://hub.mender.io/t/file-integrity-check-in-mender/1586/2 "2020-02-27T11:38:39Z")

</div>

This is possibly referring to the fact that the mender artifact file that gets uploaded to the server and then later downloaded and installed onto your device, contains checksums of all the files inside the artifact. Also if your signing the artifact then you also get artifact signature verification of the artifact prior to install

---

<div class="post-metadata">

**Author:** ![mEK](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mek/32/377_2.png) [@mEK](https://hub.mender.io/u/mEK)\
**Post date:** [February 27, 2020, 11:53am UTC](https://hub.mender.io/t/file-integrity-check-in-mender/1586/3 "2020-02-27T11:53:39Z")

</div>

Hi @dellgreen

As I understand it, Mender can check the integrity of files in the artifact by comparing checksums. Well, can we say that?  
“Mender protects against tampering in the file system.?”

---

<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:** [February 27, 2020, 12:57pm UTC](https://hub.mender.io/t/file-integrity-check-in-mender/1586/4 "2020-02-27T12:57:37Z")

</div>

Hi @mEK currently the regular rootfs-image installer does not read back the image after it has been written, the checksum is calculated as the image is streamed onto the passive partition. It is not read back a second time afterwards, as it assumes it is the responsibility of the memory controller to get the bits handed to it safely onto the underlying memory.

However, delta-updates will do this I think, as `xDelta` needs to verify the delta it has written. So if this is a concern, maybe delta-updates is for you? 🙂

---

<div class="post-metadata">

**Author:** ![mEK](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mek/32/377_2.png) [@mEK](https://hub.mender.io/u/mEK)\
**Post date:** [February 27, 2020, 1:17pm UTC](https://hub.mender.io/t/file-integrity-check-in-mender/1586/5 "2020-02-27T13:17:40Z")

</div>

Hi @oleorhagen Thanks for your revealing answer but for delta update service, I have to use Mender Professional or enterprise, which is a paid service 🙂

---

<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:** [February 27, 2020, 2:02pm UTC](https://hub.mender.io/t/file-integrity-check-in-mender/1586/6 "2020-02-27T14:02:40Z")

</div>

@mEK. Yes, indeed. Deltas are a premium feature.

However, OS is open-source.

And for this, I guess you might not even have to touch the core code. If it is important for you to verify the rootfs, also after it has been written, I suggest maybe creating a custom update module (even one for rootfs), see:

[Update Modules](https://docs.mender.io/2.2/devices/update-modules)

The opportunities are endless 😉

---

<div class="post-metadata">

**Author:** ![mEK](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mek/32/377_2.png) [@mEK](https://hub.mender.io/u/mEK)\
**Post date:** [February 27, 2020, 3:13pm UTC](https://hub.mender.io/t/file-integrity-check-in-mender/1586/7 "2020-02-27T15:13:36Z")

</div>

@oleorhagen I am aware of the unlimited opportunities of Mender and I support this as much as possible.  
I’ll think about it 🙂  
Thanks

---

<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, 12:59pm UTC](https://hub.mender.io/t/file-integrity-check-in-mender/1586/8 "2020-03-03T12:59:18Z")

</div>

@mEK I nearly forgot. Curious about that blog post. Will you link to it here?
