Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resize2fs needs e2fsck #10103

Open
srgvg opened this issue Jan 8, 2025 · 0 comments · May be fixed by #10116
Open

resize2fs needs e2fsck #10103

srgvg opened this issue Jan 8, 2025 · 0 comments · May be fixed by #10116
Assignees

Comments

@srgvg
Copy link

srgvg commented Jan 8, 2025

Bug Report

Description

AFAIK, resizing an online ext4 partition typically always needs a preliminary file system check (e2fsck).
The latter however is not implemented in pkg/makefs/ext4. AFAICS, Ext4Resize was only implemented in context of handling the new image cache in v1.9, which is how I found this out.

Logs

talosctl get volumestatus -{n,e}172.31.32.201 IMAGECACHE -o yaml

(...)

    errorMessage: |+
        error growing filesystem: error growing ext4: exit status 1: resize2fs 1.47.1 (20-May-2024)
        Please run 'e2fsck -f /dev/nvme0n1p6' first.

Environment

  • Talos version: 1.9.1
  • Kubernetes version: N/A
  • Platform: AMD64 baremetal, nvme disk

Relevant Config

I got this working for now by avoiding the need for a resize by setting the same exact sizes with following configurations:

apiVersion: v1alpha1
kind: VolumeConfig
name: IMAGECACHE
provisioning:
  diskSelector:
    match: 'system_disk'
  minSize: 8GiB
  maxSize: 8GiB
  grow: False

and for generating the installer artifacts:

docker run --rm -t \
	-v ${buildir}:/secureboot:ro \
	-v ${buildir}:/out \
	-v ${buildir}/image-cache.oci:/image-cache.oci:ro \
	-v /dev:/dev \
	--privileged \
	ghcr.io/siderolabs/imager:${TALOS_VERSION} \
	iso \
	--image-disk-size 8GiB \
	--image-cache /image-cache.oci \
	--base-installer-image ${installimage} \
	${sysext}

(Keep in mind, setting min/maxSize to 8GB will also trigger a resize if --image-disk-size is set to 8GiB (giga vs gigi)

Proposed Solution

Always perform an e2fsck before resize2fs.

@smira smira self-assigned this Jan 10, 2025
smira added a commit to smira/talos that referenced this issue Jan 10, 2025
smira added a commit to smira/talos that referenced this issue Jan 10, 2025
@smira smira linked a pull request Jan 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants