Skip to content

resize2fs needs e2fsck #10103

Closed
Closed

Description

@srgvg

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.

Activity

  1. self-assigned this
    on Jan 10, 2025
  2. moved this from To Do to In Progress in Planningon Jan 10, 2025
  3. added 3 commits that reference this issue on Jan 10, 2025
    52c6f25
    a9926ce
    edf5c5e
  4. moved this from In Progress to Done in Planningon Jan 13, 2025
  5. added a commit that references this issue on Jan 16, 2025
    7b59573
  6. locked as resolved and limited conversation to collaborators on Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions