systemd icon indicating copy to clipboard operation
systemd copied to clipboard

systemd-pull: Discard partition contents before applying update

Open mcassaniti opened this issue 3 years ago • 1 comments

Component

systemd-import, other

Is your feature request related to a problem? Please describe

I suspect but am yet to prove that systemd-veritysetup is failing because the existing partition contents has not been cleared out. In any case it still makes sense to issue a discard to the underlying storage if supported before writing a partition.

Describe the solution you'd like

Discard the contents of a partition before extracting the data. If this is not possible, fallback to filling the partition with zeros. I'd recommend that filling the partition with zeros is behind an option.

Describe alternatives you've considered

There aren't really any alternatives besides rolling my own solution.

The systemd version you checked that didn't have the feature you are asking for

No response

mcassaniti avatar Sep 15 '22 04:09 mcassaniti

by "discard" you mean zero out?

You are running systemd-veritysetup format client-side on a partition block device, after systemd-import pulled some file into it? And because veritysetup will include the unused space after the downloaded data until the partition end in the data to protect you get useless data?

I guess we can add an option that discards/zeroes out after the end of the download till the end of the block device.

poettering avatar Sep 15 '22 11:09 poettering