-
Notifications
You must be signed in to change notification settings - Fork 843
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
cc_growpart broken if parted resizefs found #2387
Comments
Launchpad user Scott Moser(smoser) wrote on 2013-08-15T01:45:50.924935+00:00 So it looks like we need some way to specify '--force' to parted. The use case we have is known to have 'in use' partition that we're trying to grow. |
Launchpad user Phillip Susi(psusi) wrote on 2013-08-15T01:58:42.805233+00:00 Currently the only way to have parted resize a busy partition is to use interactive mode rather than script mode and say yes at the prompt. |
Launchpad user Scott Moser(smoser) wrote on 2013-08-15T13:38:47.370557+00:00 Phillip, Any ideas on how to proceed? Should I file a bug/feature request upstream by sending mail to bug-parted mailing list ? |
Launchpad user Phillip Susi(psusi) wrote on 2013-08-16T19:00:03.764443+00:00 You have to not use --script and parse the output for the warning and answer yes. I have been mulling over a --force-things system to allow a script to specify that it expects a specific error and how it should be handled but it isn't easy the way libparted is structured. |
Launchpad user Scott Moser(smoser) wrote on 2013-08-16T20:41:39.024339+00:00 I dont think i follow what you meant by "parse the output for the warning and answer yes". Example: now /dev/vdb is busy (mounted) try to resizepart on it.$ sudo parted /dev/vdb resizepart 1 </dev/null so that didn't resize (reading from /dev/null). Not surprising.try with 'Yes' to stdin.echo "Yes" | sudo parted /dev/vdb resizepart 1; echo $? I also failed in an attempt with 'expect', but not sure thats relevant as I dont want to use expect anyway, and I might have done something wrong. |
Launchpad user Phillip Susi(psusi) wrote on 2013-08-17T01:33:02.203556+00:00 IIRC, parted assumes --script mode when stdin is not a tty. There was an undocumented switch that the test suite uses to override this, or I thought that expect allocates a pseudo tty (might need a switch) and that should also do the trick. |
Launchpad user Scott Moser(smoser) wrote on 2013-08-19T14:27:10.988612+00:00 I'm not using '--script' above. It seems to make no difference in my testing. |
Launchpad user Scott Moser(smoser) wrote on 2014-01-17T15:33:15.520114+00:00 Ok. $ parted --help | grep resizepart the END seems to be in MB, which is insufficient for my needs. I'd like it to grow it to the next partition. The undocumented flag for --script is '---pretend-input-tty', but I can't even seem to make that work. It just seems to ignore things like this: $ echo "Yes" | sudo parted ---pretend-input-tty /dev/vdb resizepart 1 1000 --machine --script but it doesn't shrink the partition table I'm going to remove the support for parted from cloud-init entirely. |
Launchpad user Phillip Susi(psusi) wrote on 2014-01-17T16:11:52.767468+00:00 You don't use ---pretend-input-tty in conjunction with --script. The point is to pretend that you are a human, not a script. |
Launchpad user Launchpad Janitor(janitor) wrote on 2014-01-25T04:03:54.170498+00:00 This bug was fixed in the package cloud-init - 0.7.5~bzr933-0ubuntu1 cloud-init (0.7.5~bzr933-0ubuntu1) trusty; urgency=medium
|
This bug was originally filed in Launchpad as LP: #1212492
Launchpad details
Launchpad user Scott Moser(smoser) wrote on 2013-08-15T01:28:13.928002+00:00
As reported in bug 1212444, the partition growing is broken if growpart is found to be usable.
There are 2 things that are broken,
a.) we invoke parted wrong (passing device after 'resizepart' rather than before)
b.) parted seems somewhat broken, and I dont know how to force it to do what we want. See:
$ sudo parted /dev/vda resizepart --script 1 </dev/null; echo $?
Warning: Partition /dev/vda1 is being used. Are you sure you want to continue?
1
Um... yes, parted, i want you to do what I told you to do.
Related bugs:
The text was updated successfully, but these errors were encountered: