Skip to content
This repository was archived by the owner on Dec 8, 2023. It is now read-only.

Comments

Updated parted args to correctly grow the partition to 100%#833

Open
sameersbn wants to merge 1 commit intorancher:masterfrom
sameersbn:patch-1
Open

Updated parted args to correctly grow the partition to 100%#833
sameersbn wants to merge 1 commit intorancher:masterfrom
sameersbn:patch-1

Conversation

@sameersbn
Copy link

@sameersbn sameersbn commented Jan 13, 2022

The parted command wasn't resizing the root partition to use the available disk space. The issue in parted is also documented in the bug report https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1270203.

In this PR the invocation of the parted command has been updated so that the partition is properly resized to use the available disk space.

This works for parted 3.4 which is what's present in the current pre-release version (v0.22.2-k3s2r0) of k3os. In the release version (v0.21.5-k3s2r1) however the parted version is 3.3 and requires a slight modification in the command:

echo -e "Yes\n100%" | sudo parted $1 resizepart $2 ---pretend-input-tty unit %

In case there are further maintenance releases planned for the v0.21.5 series then we should update the line to

echo -e "Yes" | parted $1 unit % resizepart $2 100% ---pretend-input-tty || echo -e "Yes\n100%" | parted $1 resizepart $2 ---pretend-input-tty unit %

The parted command wasn't resizing the root partition to use the available disk space.  The issue in parted is also documented in the bug report https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1270203. 

In this PR the invocation of the `parted` command has been updated so that the partition is properly resized to used the available disk space.
Copy link
Contributor

@liyimeng liyimeng left a comment

Choose a reason for hiding this comment

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

why don't use -s to run parted in script mode instead?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants