Repository navigation
Conversation
Validate both GPT copies and preserve Recovery in a staged disk image before replacing the original. Leave APFS growth to the guest on its next boot.
Remove unrelated display and config-write changes while retaining disk safety checks. Name the GPT and MBR layout constants and the Recovery copy buffer size.
edi-oai
left a comment
There was a problem hiding this comment.
I think you can already achieve this with Packer builder for Tart VMs, see recovery_partition setting for more details.
Hi @edi-oai thanks for pointing that out. It's true that Packer already supports preserving and relocating Recovery. The motivation for this PR is to expose that operation directly through tart's existing There is also a difference in failure handling. Packer's implementation saves the Recovery contents, updates the original disk's partition table, and then restores the contents at the new location. This PR performs the changes on a staging copy, validates both GPT copies, and replaces the original disk only after that completes. A failure before the final replacement therefore leaves the original disk intact. The scope is deliberately limited to stopped VMs with standalone raw macOS disks. APFS filesystem expansion remains a separate step, handled by the guest agent or inside the guest. I think the native CLI integration and staged disk replacement make this useful alongside the existing Packer implementation. |
Hi, this PR adds
--relocate-recoverytotart set --disk-sizefor standalone raw macOS disks. It preserves theRecoverypartition while moving it to the end of the disk, making room for APFS expansion.Previously, tho
tart set --disk-sizecan enlarge the raw disk image, but it won't relocateRecovery. WithRecoverysitting after the system APFS partition, macOS couldn’t use the added space for APFS expansion.