Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-2939

Make rootfs updates faster by reading content before writing content



    • Type: Task
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Days in progress:


      The background is that delta updates are faster because they read a lot, and only write the changed parts. We can do the same in rootfs updates one block at a time. Quick experiments with SD cards revealed ~3x reading speed when compared to writing speed.

      Acceptance criteria:

      • Mender client must do, block by block:
        1. Read the block
        2. Compare the contents of the block with the block from the rootfs update stream
        3. If (and only if) different, seek back to the beginning of the block and write that block from the update stream
        4. Proceed to next block
      • The Sync() call must only performed on written blocks
      • Must never read further than the length of the update stream (so the stream must be read first)
      • Stretch goal: Enable for UBI writing as well
        • This is likely more complicated because UBI requires an exact number of bytes to be written to be known beforehand, and that is not possibly for rootfs updates. See also this comment.
      • No test is needed, since updates are already extensively tested, but a quick manual verification of the speed improvement would be good




            • Assignee:
              oleorhagen Ole Petter Orhagen
              a10040 Kristian Amlie
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created:

                Zendesk Support