-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Sep 16 2025 14:01:11 +0200, Thomas Lange wrote:
> >>>>> On Tue, 16 Sep 2025 11:38:56 +0100, Vanush Misha Paturyan 
> >>>>> <[email protected]> said:
> 
>> Quick version of the question: can setup-storage be configured to preserve 
>> the "Disk Identifier" and "Partition UUIDs" via its `disk_config` 
>> configuration file?
> 
> I'm not sure about the status.
> 
> First, you only use preserve_always for a certain partition. But you
> can also define preserve_always:all in the disk_config line.
> This may skip the steps to recreate each partition.
>
> Then you can use always_format for a partition, for which a new
> filesystem should be created.

Yes, preserve_always:all in the disk_config in combination with
always_format for Linux partitions works, but only if Linux
partitions have already been created. FAI stops with "cannot preserve
partition" error for PCs that have not seen Linux yet (just Windows
partitions exist). But this behaviour makes sense: preserve_always:all
means do not (re)create the partition.

Combination of "preserve_always:all preserve_lazy=5,6,7,8" for
disk_config is not allowed (setup-storage fails complaining of the
configuration file, which is also makes sense).

Adding "preserve_lazy" to partition configuration lines leads to the
execution of `parted -s <disk> mklabel gpt` which resets disks's
identifiier.

It also leads to execituion of `parted mkpart` for each of the preserved
partitions, albeit preserving starting and ending sectors, which
preserves the file system within the partition, but resets its UUID
and label.

I haven't tried specifying labels for partitions, but since I also
don't see any mentions of UUIDs in the code I suspect UUIDs will still
be changed.

So maybe this behaviour should be considered a bug in setup-storage? I
would expect it not to run `parted mklabel gpt` if there is at least
one partition that should be preserved (always, lazy or otherwise). I
also would not expect it to run `parted mkpart` on preserved
partitions.

Writing two hooks sounds like the "quickest" option for me (compared
to trying to patch setup-storage.

I'll report back with my findings once I have two hooks written.


Cheers

Misha

- -- 
Vanush "Misha" Paturyan
Chief Technical Officer
Room 120
Computer Science Department
Eolas Building
Maynooth University
Maynooth


-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE6+LRtrEuh+wT6ouqkfqpCCBpZcEFAmjJkggACgkQkfqpCCBp
ZcHZRgf+Id5zFmPy/hEj1BK9J/zggPwuJwgTGAE8scFP/+PPw86AdVoEd/22/AQG
cFvtXbBgLjA2i7u7EFAcvxnggi0evy72hMOeuTe6RM1qpm/BWIaYO+PfVWC+WKuX
Nr+ewup/z9psaq0cH0RBZWs+8EgTEn2UDiGPs6VZq020PYlR7bYZ4+xecCJ1dlmS
exHGOYyCFW57VkyD6Clj+kFzgKD0FRjznlLjwewc4WtGDRAnsjRh67RGFJWhhCmZ
cz3NF21skCKCD4UA+qiLaF6jMDrheiq/dh3jS4ffabEIKPvounFB6HWgxWudl2Rr
06jnBtHE3ArLampL3jg8saRCVlon7A==
=ew2b
-----END PGP SIGNATURE-----

Antwort per Email an