Running fsck breaks mender-binary-delta

Description

Even when running with the root filesystem read-only, running fsck (at least on ext4) updates the "Last Write Time" in the metadata of the filesystem. This results in the checksum not matching when attempting to do a binary-delta update.

For now, on Ubuntu specifically, I have worked around this by adding the following kernel command line parameters:

This doesn't seem like a good long-term solution though since it will skip the automatic fsck even on the writable partitions. Additionally, I can foresee other systems behaving differently but having similar issues.

Ideally we would find a way to account for this in the binary-delta code. The only difference seems to be exactly the "Last Write Time":

Suggested way to fix:

  • Add a new variable READ_ONLY_ROOTFS to mender-convert, defaulting to 0, and if 1, trigger the check

  • If check is triggered, check that -O ^64bit -O ^has_journal is passed to mkfs.ext4

Affects versions

None

Environment

None

Checklist

Activity

Show:

Lluis CamposSeptember 12, 2020 at 11:26 AM

The last rework in the PR removed the need for a new variable, therefore the documentation has not been updated.

Kristian AmlieSeptember 11, 2020 at 11:02 AM

I think we should document it, the intention is that we do it, although I'm aware some variables may be missing.

Lluis CamposSeptember 9, 2020 at 1:49 PM

Do we need to document it in Mender Docs? Other related variables like MENDER_DATA_PART_MKFS_OPTS are not documented there.

Lluis CamposSeptember 9, 2020 at 1:45 PM

Kristian AmlieSeptember 4, 2020 at 8:52 AM

Yep. Meta-mender was so easy that I just did it directly, see this PR.

Fixed

Details

Assignee

Reporter

Labels

Story Points

Priority

Days in progress

2

Sprint

Backlog

yes

Zendesk Support

Checklist

Created August 26, 2020 at 5:11 PM
Updated June 25, 2024 at 12:03 PM
Resolved September 11, 2020 at 4:07 PM