Bugzilla will be upgraded to version 5.0 on December 2, 2018. The outage period for the upgrade will start at 0:00 UTC and have a duration of 12 hours
Bug 1423357 - Backport resizepart command from parted 3.1.90
Backport resizepart command from parted 3.1.90
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: parted (Show other bugs)
7.4
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: Brian Lane
Release Test Team
Petr Bokoc
: Reopened
Depends On:
Blocks: 1420851 1478303
  Show dependency treegraph
 
Reported: 2017-02-17 00:39 EST by Abhishek Karvi
Modified: 2018-06-05 19:09 EDT (History)
12 users (show)

See Also:
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 13:40:49 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0948 None None None 2018-04-10 13:41 EDT

  None (edit)
Description Abhishek Karvi 2017-02-17 00:39:32 EST
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 12:21:38 EST
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 12:21:44 EST
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.
Comment 4 Joerg K 2017-02-24 13:36:58 EST
(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 16:54:35 EST
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 02:10:36 EST
Thank you for reconsidering. I'm looking forward to getting this feature.
Comment 8 Joerg K 2017-06-02 09:28:23 EDT
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 10:42:38 EDT
(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 02:40:06 EDT
(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 10:24:11 EDT
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 13:40:49 EDT
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 17:17:21 EDT
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 19:09:48 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.