Why does a 2-core (75GB) runner create a 106GB root volume for custom images? #185818
Replies: 2 comments 3 replies
-
|
Why does a 2-core (75GB) runner create a 106GB root volume for custom images? Thanks for raising this. What you’re observing is expected behavior based on how GitHub provisions runners for custom image creation versus how disk limits are enforced when those images are used at runtime. When a 2-core runner is used to build a custom image, it may be provisioned on a larger underlying block device (~106GB) than the advertised 75GB SSD. The 75GB value represents the maximum disk size supported when running jobs on 2-core runners, not necessarily the physical disk size of the VM used during image generation. On Ubuntu 24.04, the root filesystem is automatically expanded at boot (via growpart and resize2fs) to use all available space on the attached device. As a result, the root filesystem (/dev/root) expands to approximately 106GB, which is what is reported by df -h. When a snapshot is created, GitHub preserves the partition layout and filesystem size of the runner. This means the resulting custom image reflects the expanded root filesystem and therefore ends up being larger than the ~74GB image size limit enforced for 2-core runners at runtime. This behavior may differ from what was observed previously, as changes to base images (such as Ubuntu 24.04) and underlying runner infrastructure can affect how disks are provisioned and initialized. Why reducing disk usage does not change the image size Removing packages or cleaning caches does not reduce the final image size in this case. Snapshot creation captures the filesystem size, not just the amount of data stored within it. As long as the root filesystem remains expanded, the image size will exceed the supported limit. Recommended workaround To ensure a custom image can be used on 2-core runners, the root filesystem should be resized to within the supported limit prior to snapshot creation. As a final step in the image build workflow, run: sudo resize2fs /dev/root 74G This should be done after all installations and before the snapshot is taken. Summary In short, this is an infrastructure and image-building behavior difference, not a workflow misconfiguration. Until disk sizing is aligned or enforced during custom image creation, manually resizing the root filesystem is the recommended approach for producing custom images compatible with 2-core runners. |
Beta Was this translation helpful? Give feedback.
-
Why does a 2-core (75GB) runner create a ~106GB root volume for custom images?This happens because runner size (CPU/RAM) and disk size are decoupled, especially when using custom images. Key reasons:
Important notes:
Can this be reduced?
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Why are you starting this discussion?
Question
What GitHub Actions topic or product is this about?
Actions Runner Image
Discussion Details
Issue Summary
When creating a custom image on a 2-core runner with 75GB SSD specification, the root volume (
/dev/root) isunexpectedly expanded to 106GB. This results in a 110GB custom image that cannot be used on 2-core runners due to disk
capacity constraints.
Environment
hodai-custom-image-generator-2core(2-core, 75GB SSD)Current Behavior
When running a workflow to create a custom image:
2-core : 8 GB RAM : 75 GB SSDdf -hshows the actual volume size:Filesystem Size Used Avail Use% Mounted on
/dev/root 106G 25G 81G 24% /
tmpfs 3.9G 100K 3.9G 1% /dev/shm
tmpfs 1.6G 1.1M 1.6G 1% /run
...
Expected Behavior
Steps to Reproduce
snapshot: <image-name>to create a custom imagedf -hin the workflow/dev/rootshows 106GB instead of expected ~75GBWorkflow Configuration
Beta Was this translation helpful? Give feedback.
All reactions