Bug 1423357

Summary: Backport resizepart command from parted 3.1.90
Product: Red Hat Enterprise Linux 7 Reporter: Abhishek Karvi <akarvi>
Component: partedAssignee: Brian Lane <bcl>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: low Docs Contact: Petr Bokoc <pbokoc>
Priority: low    
Version: 7.4CC: bcl, carl, cc, cww, imz, joerg.kastning, jstodola, jvavra, lmiksik, pbokoc, redhat, tcarlin
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: parted-3.1-29 Doc Type: Enhancement
Doc Text:
*parted* can now resize partitions using the "resizepart" command The ability to resize disk partitions using the "resizepart NUMBER END" command is now backported to the *parted* disk partitioning utility distributed with Red Hat Enterprise Linux 7. See the *parted(8)* man page for information. Note that this command only resizes partitions, not file systems residing on them. Use file system utilities such as *resize2fs* to grow or shrink file systems.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 17:40:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1420851, 1478303    

Description Abhishek Karvi 2017-02-17 05:39:32 UTC
Description of problem:

currently unable to resize partitions using parted utility.
option to resize partitions was removed from parted.
cu would like to use resize option in parted instead of deleting and recreating partitions using fdisk.

Version-Release number of selected component (if applicable):

parted version 3.1

Additional info:

option to resize partitions was removed from parted.
cu would like to use resize option in parted instead of deleting and recreating partitions using fdisk.
this was requested by cu in case # 01778631

Comment 2 Brian Lane 2017-02-17 17:21:38 UTC
Upstream removed the filesystem resize feature and moved it into a library. It will not be added back into parted. If you want to resize filesystems use a tool provided by the filesystem.

My opinion, as I have stated in previous bugs for this, is that since parted does not closely track filesystem development it is dangerous to depend on it for resizing your filesystems. Use the tools created for that purpose by the filesystem creators.

Comment 3 Red Hat Bugzilla Rules Engine 2017-02-17 17:21:44 UTC
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.

Comment 4 Joerg K 2017-02-24 18:36:58 UTC
(In reply to Brian Lane from comment #2)
> Upstream removed the filesystem resize feature and moved it into a library.
> It will not be added back into parted. If you want to resize filesystems use
> a tool provided by the filesystem.

Well, the [documentation](https://www.gnu.org/software/parted/manual/parted.html) of parted stated in section 2.4 that the resize command is removed after version 2.4. But a new option called [resizepart](https://www.gnu.org/software/parted/manual/parted.html#resizepart) was added instead. This option offers the exact functionality I would like to use.

Because filesystem tools like `resize2fs` could only grow a filesystem to the boundary of the partition the `resizepart` command is needed to moves the end of a partition number first. Of course in case of shrinking a partition you have to use tools like `resize2fs` first to shrink the filesystem, before you shrink the partition with `resizepart`.

> My opinion, as I have stated in previous bugs for this, is that since parted
> does not closely track filesystem development it is dangerous to depend on
> it for resizing your filesystems. Use the tools created for that purpose by
> the filesystem creators.

To avoid a misunderstanding. I would not use parted to resize a filesystem. But I would like to use it to resize the partition in which the filesystems live. The solution of using fdisk to resize a partition as suggested in the [storage administration guide section 12.4](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html-single/Storage_Administration_Guide/index.html#s2-disk-storage-parted-resize-part) is imho much worse than using parted with the resizepart command.

Please, reconsider adding parted with the resizepart command to rhel 7.

Comment 5 Brian Lane 2017-02-24 21:54:35 UTC
Ah! Sorry, I thought you meant the combined filesystem and partition resize.

It looks like this would need these commits backported:

5c79385 - Document resizepart command
56bfbe2 - parted: Add stub resize command for backward compatibility
f09ca96 - libparted: Add support for partition resize
33fd692 - tests: excersise resize command
21c58e1 - parted: add resizepart command

It's a moderate amount of work, not a simple change, but it looks like it's mostly self-contained.

Comment 6 Joerg K 2017-02-25 07:10:36 UTC
Thank you for reconsidering. I'm looking forward to getting this feature.

Comment 8 Joerg K 2017-06-02 13:28:23 UTC
Hello Brian,

Today I had a look on the [RHEL 7.4 Beta Release Notes](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7-Beta/html-single/7.4_Release_Notes/index.html). I couldn't find there any word from a new parted feature or version.

Does that mean that there won't be a backport of the resize feature from parted 3.1.90 in the next minor release? Or is the change just to small to be mentioned in the release notes and the backport will be available with the final release of 7.4?

Comment 9 Brian Lane 2017-06-02 14:42:38 UTC
(In reply to Joerg K from comment #8)
> Does that mean that there won't be a backport of the resize feature from
> parted 3.1.90 in the next minor release? Or is the change just to small to
> be mentioned in the release notes and the backport will be available with
> the final release of 7.4?

This change wasn't approved for 7.4, we will hopefully get it into 7.5

Comment 10 Joerg K 2017-06-06 06:40:06 UTC
(In reply to Brian Lane from comment #9)
> This change wasn't approved for 7.4, we will hopefully get it into 7.5

Ok, I got confused the version of this bug is 7.4 and target release 'rc'. Thanks for the update. I'm looking forward getting this change in 7.5.

Comment 16 Joerg K 2018-03-31 14:24:11 UTC
Hello,

I just want to let you know that I could successfully resize a partition with parted-3.1-29 in RHEL 7.5 Beta.

Thanks for this backport!
Joerg K.

Comment 18 errata-xmlrpc 2018-04-10 17:40:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0948

Comment 19 feeble 2018-06-05 21:17:21 UTC
I see this is closed. But I just wanted to add that this change has made it possible to run partprobe on the system partiton without error. In the past you would get a message similiar to this.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

Now it actually re-reads the table. I am fine with this. But I jsut want to make sure that it does not cause issues with the system disk. I think it is fine.

Comment 20 Brian Lane 2018-06-05 23:09:48 UTC
Glad to hear it works. This included updating the partition sync code to the newer/better way of doing things so that's likely why you see the difference.