GNU bug report logs - #79171
-s is ignored when using resizepart for shrinking a partition

Previous Next

Package: parted;

Reported by: Casey Fitzpatrick <kcghost <at> gmail.com>

Date: Mon, 4 Aug 2025 20:53:03 UTC

Severity: normal

To reply to this bug, email your comments to 79171 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-parted <at> gnu.org:
bug#79171; Package parted. (Mon, 04 Aug 2025 20:53:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Casey Fitzpatrick <kcghost <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-parted <at> gnu.org. (Mon, 04 Aug 2025 20:53:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Casey Fitzpatrick <kcghost <at> gmail.com>
To: bug-parted <at> gnu.org
Subject: -s is ignored when using resizepart for shrinking a partition
Date: Mon, 4 Aug 2025 16:19:02 -0400
[Message part 1 (text/plain, inline)]
When using resizepart with "-s" a warning prompt is still printed when
shrinking a partition. Then the command fails without actually prompting
for Yes/No.

Seen using parted version 3.6:
```
$ sudo parted -s /dev/loop0 unit B resizepart 1 420478975
Warning: Shrinking a partition can cause data loss, are you sure you want
to continue?
$ echo $?
1
```
[Message part 2 (text/html, inline)]

Information forwarded to bug-parted <at> gnu.org:
bug#79171; Package parted. (Mon, 04 Aug 2025 21:59:02 GMT) Full text and rfc822 format available.

Message #8 received at 79171 <at> debbugs.gnu.org (full text, mbox):

From: "Brian C. Lane" <bcl <at> redhat.com>
To: Casey Fitzpatrick <kcghost <at> gmail.com>
Cc: 79171 <at> debbugs.gnu.org
Subject: Re: bug#79171: -s is ignored when using resizepart for shrinking a
 partition
Date: Mon, 4 Aug 2025 14:57:49 -0700
On Mon, Aug 04, 2025 at 04:19:02PM -0400, Casey Fitzpatrick wrote:
> When using resizepart with "-s" a warning prompt is still printed when
> shrinking a partition. Then the command fails without actually prompting
> for Yes/No.
> 
> Seen using parted version 3.6:
> ```
> $ sudo parted -s /dev/loop0 unit B resizepart 1 420478975
> Warning: Shrinking a partition can cause data loss, are you sure you want
> to continue?
> $ echo $?
> 1
> ```

parted defaults to not doing things that could lose data, so shrinking
is only supported in interactive mode. This comes up from time to time.
eg.

https://lists.gnu.org/archive/html/bug-parted/2024-06/msg00000.html

Brian

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart





Information forwarded to bug-parted <at> gnu.org:
bug#79171; Package parted. (Mon, 04 Aug 2025 22:54:01 GMT) Full text and rfc822 format available.

Message #11 received at 79171 <at> debbugs.gnu.org (full text, mbox):

From: Casey Fitzpatrick <kcghost <at> gmail.com>
To: "Brian C. Lane" <bcl <at> redhat.com>
Cc: 79171 <at> debbugs.gnu.org
Subject: Re: bug#79171: -s is ignored when using resizepart for shrinking a
 partition
Date: Mon, 4 Aug 2025 18:53:13 -0400
[Message part 1 (text/plain, inline)]
Thanks! I missed that somehow searching around. I'm glad there is a
workaround at least.

On Mon, Aug 4, 2025, 5:57 PM Brian C. Lane <bcl <at> redhat.com> wrote:

> On Mon, Aug 04, 2025 at 04:19:02PM -0400, Casey Fitzpatrick wrote:
> > When using resizepart with "-s" a warning prompt is still printed when
> > shrinking a partition. Then the command fails without actually prompting
> > for Yes/No.
> >
> > Seen using parted version 3.6:
> > ```
> > $ sudo parted -s /dev/loop0 unit B resizepart 1 420478975
> > Warning: Shrinking a partition can cause data loss, are you sure you want
> > to continue?
> > $ echo $?
> > 1
> > ```
>
> parted defaults to not doing things that could lose data, so shrinking
> is only supported in interactive mode. This comes up from time to time.
> eg.
>
> https://lists.gnu.org/archive/html/bug-parted/2024-06/msg00000.html
>
> Brian
>
> --
> Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart
>
>
[Message part 2 (text/html, inline)]

This bug report was last modified 10 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.