Skip to content

fstrim shrinks raw volumes on v0.6.8#1472

Description

@0xpolarzero

MicroSandbox v0.6.8 pins msb-imago 0.1.1 and msb_krun_devices 0.1.25.

An EOF-reaching virtio discard reaches File::try_discard_by_truncate, which calls file.set_len(offset).

Repro: https://github.com/0xpolarzero/imago-tail-discard-repro

before=2147483648 after=2015371264 ext4=2147483648 delta=-132112384

The live guest still reports 2 GiB. After restart, ext4 cannot mount the shortened image.

Fix: use an Imago version that preserves logical length for discard and write-zeroes.

Imago issue: XanClic/imago#7
Fix PR: XanClic/imago#8

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions