Skip to content

Commit d0078c5

Browse files
adrianriobocodex
andcommitted
fix(rhel): grow disk size to external volume size
Previously the instance kept the size for the image, now it is expanded within cloud-init to the actual space for the external disk. Co-authored-by: ChatGPT <noreply@openai.com> Signed-off-by: Adrian Riobo <ariobolo@redhat.com>
1 parent 91302be commit d0078c5

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

pkg/target/host/rhel/cloud-config-base

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ rh_subscription:
44
password: {{.SubscriptionPassword}}
55
auto-attach: true
66
runcmd:
7+
- |
8+
ROOT_DEV=$(findmnt -n -o SOURCE /)
9+
DISK=$(lsblk -no pkname "$ROOT_DEV")
10+
PART_NUM=$(echo "$ROOT_DEV" | grep -o '[0-9]*$')
11+
12+
growpart /dev/$DISK $PART_NUM
13+
pvresize $ROOT_DEV
14+
lvextend -l +100%FREE $(lvdisplay | awk '/LV Path/ {print $3; exit}')
15+
xfs_growfs /
716
- while fuser /var/lib/rpm/.rpm.lock > /dev/null 2>&1 ; do sleep 1 ; done
817
- dnf install -y podman
918
{{ if .ActionsRunnerSnippet }} - sudo -u {{ .Username }} bash -c /opt/install-ghrunner.sh{{ end }}

0 commit comments

Comments
 (0)