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

Skip filesystem shrinking without error if it's already right-sized #231

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joelbu
Copy link

@joelbu joelbu commented Feb 28, 2022

I had a case handed to me by a user of your script where I observed the following:

The image was 60 GB large but only had a 0.5 GB fat32 partition and an 5.81 GB ext4 partition. Maybe the image was not expanded after being moved before, I don't know. The resize2fs estimate was that the filesystem could not be shrunk so the whole script errored out with error 11.

The filesystem already being right-sized is not inherently an unrecoverable error. We can continue the process anyway and proceed with shrinking partitions and truncating the file. That's all that my change does, replaces the error by a branch and changes some log messages to indicate the behaviour.

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 this pull request may close these issues.

None yet

1 participant