Skip to content

feat: support 4k sector size disk images#13381

Merged
talos-bot merged 1 commit into
siderolabs:mainfrom
smira:feat/4k-disk-image
May 19, 2026
Merged

feat: support 4k sector size disk images#13381
talos-bot merged 1 commit into
siderolabs:mainfrom
smira:feat/4k-disk-image

Conversation

@smira
Copy link
Copy Markdown
Member

@smira smira commented May 18, 2026

By default, we create still standard 512-bytes sector size images, but optionally sector size can be set to any value.

Fixes #13227

Copilot AI review requested due to automatic review settings May 18, 2026 17:51
@smira smira added the integration/misc Run all misc integration tests (misc-0 through misc-4) label May 18, 2026
@github-project-automation github-project-automation Bot moved this to To Do in Planning May 18, 2026
@talos-bot talos-bot moved this from To Do to In Review in Planning May 18, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for building disk images with a configurable sector size (defaulting to 512 bytes), with an emphasis on enabling 4K-native disk image generation for hardware/virtual disks that present 4096-byte sectors. A new metal-4k built-in profile and corresponding e2e CI matrix entry are introduced, the makefs helpers gain a WithSectorSize option propagated through partition formatting, and the installer threads ImageSectorSize through GPT and blkid probe calls when operating in image mode. The bumped go-blockdevice/v2 v2.0.29 supplies the new gpt.WithFileSectorSize/blkid.WithSectorSize APIs being consumed.

Changes:

  • Add Options.SectorSize to makefs with implementations for XFS (-s size=), VFAT (-S) and ext4 (-b), plus tests.
  • Thread ImageSectorSize through imager profile, install options, GPT file device creation, blkid probes, and partition format options.
  • Add metal-4k default profile, testdata fixtures for versions 1.9–1.14 on amd64/arm64, and a WITH_4K_DISK_IMAGE e2e CI lane.

Reviewed changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/makefs/makefs.go Adds SectorSize to Options and the WithSectorSize option.
pkg/makefs/xfs.go Passes -s size=<N> when sector size is set.
pkg/makefs/xfs_test.go New test asserting XFS sector size honored.
pkg/makefs/vfat.go Passes -S <N> to mkfs.vfat.
pkg/makefs/vfat_test.go New test asserting VFAT sector size via minfo.
pkg/makefs/ext4.go Maps sector size to -b block size for ext4.
pkg/makefs/ext4_test.go New test asserting ext4 block size via tune2fs.
internal/pkg/partition/format.go Adds SectorSize to FormatOptions, forwards to makefs.
pkg/imager/profile/output.go New DiskSectorSize field on ImageOptions.
pkg/imager/profile/default.go New metal-4k default profile.
pkg/imager/profile/testdata/metal-4k-*.yaml Profile-version testdata fixtures for 4K metal images.
pkg/imager/out.go Passes DiskSectorSize to installer options as ImageSectorSize.
cmd/installer/pkg/install/install.go Plumbs ImageSectorSize into blkid probes, GPT file device, and partition options.
hack/test/e2e-qemu.sh Adds WITH_4K_DISK_IMAGE branch invoking make image-metal-4k.
.kres.yaml Adds e2e-disk-image-4k matrix entry.
.github/workflows/*.yaml, .github/renovate.json Regenerated by kres (workflow header bump, action version bumps, label-gated if, new env).
go.mod, go.sum Bumps go-blockdevice/v2 to v2.0.29 for WithSectorSize/WithFileSectorSize.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread hack/test/e2e-qemu.sh Outdated
@smira smira force-pushed the feat/4k-disk-image branch from 30093f2 to c3f512f Compare May 18, 2026 18:00
@github-project-automation github-project-automation Bot moved this from In Review to Approved in Planning May 18, 2026
@smira smira force-pushed the feat/4k-disk-image branch from c3f512f to 04354b7 Compare May 18, 2026 18:34
@smira smira removed the integration/misc Run all misc integration tests (misc-0 through misc-4) label May 19, 2026
@smira
Copy link
Copy Markdown
Member Author

smira commented May 19, 2026

There is a broken Canal test, but unrelated to this PR.

By default, we create still standard 512-bytes sector size images, but
optionally sector size can be set to any value.

Fixes siderolabs#13227

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
@smira smira force-pushed the feat/4k-disk-image branch from 04354b7 to be12d3d Compare May 19, 2026 10:57
@smira
Copy link
Copy Markdown
Member Author

smira commented May 19, 2026

/m

@talos-bot talos-bot merged commit be12d3d into siderolabs:main May 19, 2026
66 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in Planning May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Allow downloading metal images from factory with 4k sector size.

4 participants