-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
parted: Resizing not working #1653
parted: Resizing not working #1653
Comments
Files identified in the description: If these files are inaccurate, please update the |
You're missing This is an omission in the docs (my fault), will fix now. Thanks! |
It's also worth pointing out if you're using GPT tables you might need to have checks around this module to fix the GPT missing at the end of a disk after a resize. See #1461 |
Thanks for the hint. But it turns out, that parted is not able to resize a partition, which is in use.
Is this a limitation of parted? I normally use cfdisk for resizing partitions, which is no problem. |
I hit this when testing after your comment, I'm a bit surprised here - I'm using this module to regularly resize in-use DOS partitions. |
It seems not to a problem of parted itself, but of the module in any way. I can resize the partition easily with parted on CLI:
Is the module using "resize" or "resizepart" ? Because resize was removed after parted v. 2.4 |
You can see the exact command run from the error message you posted:
The The default is |
Np, I am glad you responded so fast. :) Giving the label works.
But wouldn't it be nice, when the module automatically sets the correct label on "resize: true" ? And imho, "resize: true" automatically implements "state: present", so I think it shouldn't has to be to set additionally :) |
The docs are correct as they are now - GPT is a non-default label, so it's understandable you have to declare it explicitly. Whilst I agree with your last comment about it being set automatically, it requires editing logic of the module outside of the scope I've done before (I only did the resize extension) so I would like another maintainer to agree with that first. |
I've also hit this, but with a disk without a label so that's not the problem. Ansible-generated command was:
fails with
Trying the same command manually also fails - I think the actual problem is the |
Horribly it looks like it might need an undocumented flag to fix: https://stackoverflow.com/a/58840066/916373 |
Any workaround for this? |
Sorry, I missed this. Are you able to provide a reproducible scenario I can test with? |
I've tried to resize the root volume volume of AWS t3.micro (nvme based), Ubuntu 18.04 ami.
|
This reproducible on the centos 8 stream image, trying to resize the root partition. The '-s' assumes no input even though the command expects a 'Yes' to confirm, so nothing happens. Could not confirm sebastianmacarescu's solution on this image but the solution from the below link worked: |
So I'm able to replicate this, but I'm not sure there is a simple fix. You're trying to use parted to alter GPT partition tables (that wasn't clear from the context), which parted just doesn't have very good support for - as per the previous comments in this issue, and the fact it's trying to get input in script mode. The stated workarounds might work, but they change the nature of the module, meaning it doesn't run in script-mode (currently hard-coded), and relies on an un-documented flag. I don't think the solution is to include that in the module code. See #1461 for similar comments. I recommend that you use a tool like |
@sebastianmacarescu thank you for the workaround it works perfectly |
@jake2184 is it appropriate to add a note to the docs for |
Yes, that's a fair point and one I meant to add earlier. The most frustrating thing I found (and why I use this module in the first place) is the lack of an Ansible module that wraps around GPT tools! I'll update the docs |
No help ultimately required, see edit at the end. So I'm running into problems resizing a partition with msdos label, hard to be sure whether it's related to this but it's certainly similar. The task is as follows:
I did not initially have Here's the output:
The disk in question,
Now, it should be said using the parted command directly also does not work:
I suppose based on that, you could argue it's an issue with parted rather than with the module, and if it is indeed an upstream bug and there's nothing to be done here, then fair enough. I guess I'm holding out hope there might be a way to make this work nicely with the module. Admittedly, the workaround above does work:
Before going down that route, I think I'd rather create the filesystem directly on the block device and cut the partition step entirely. Still, I'd appreciate any help here. --
https://cloud.google.com/compute/docs/disks/add-persistent-disk#formatting I will therefore move ahead without creating any partition and so don't need any help on this issue. Nevertheless I will leave this comment in the event it helps anyone else. |
Files identified in the description: If these files are incorrect, please update the |
Hi, is there any kind of progress on this issue? I would really love to use the parted module with my Ubuntu servers that have GPT partition tables. My workaround is to use the command module to execute the command |
I'm not sure there is an identifiable issue with the module here, other than that the underlying binary doesn't have good support for GPT tables. This module is purely a wrapper around |
This issue is solved on rhel9 to extend LVM partitions with GPT by replace in plugins/modules/parted.py the line 573: The man command for parted say on my OS : I don't know if this option exist on other OS |
Just for reference, this is another possible workaround using
|
SUMMARY
Hi all,
I am trying to resize a partition (/dev/sda3), which is a physical volume of lvm. The resize part according to the docs (where btw is a typo in the resize example) just does nothing:
ISSUE TYPE
COMPONENT NAME
parted
ANSIBLE VERSION
STEPS TO REPRODUCE
EXPECTED RESULTS
/dev/sda3 should be resized to the max given space
ACTUAL RESULTS
Nothing happens
Thanks,
Marcus
The text was updated successfully, but these errors were encountered: