[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#71790: parted -s emits a warning when shrinking a partition
From: |
Sean Warner |
Subject: |
bug#71790: parted -s emits a warning when shrinking a partition |
Date: |
Wed, 26 Jun 2024 23:51:38 +0100 |
User-agent: |
Evolution 3.52.2 |
I am also having this bug reported in 2017:
$ parted -v
parted (GNU parted) 3.6
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+
$ cat /etc/lsb-release
DISTRIB_ID="ManjaroLinux"
DISTRIB_RELEASE="24.0.2"
DISTRIB_CODENAME="Wynsdey"
-- If increasing the size of a partition the following command works but if shrinking a partition it gives a warning "Warning: Shrinking a partition can cause data loss, are you sure you want to continue?" and the command just exits back to the command prompt and no changes are made to the partition.
sudo parted -s /dev/loop0 resizepart 1 46280703s
I assumed that parted -s would automatically supply a default value of 'Yes' in this instance?
According to the Parted Man page:
-s, --script
never prompts for user intervention
Is this a bug or am I misunderstanding something?
From researching the interweb this might be a bug that for many years has never been addressed.
Previous parted versions apparently allowed for something like:
sudo parted -s /dev/loop0 resizepart 1 yes 46280703s
or
sudo parted -s /dev/loop0 resizepart 1 46280703s yes
But in parted 3.6 there appears to be no way to make this work with parted -s. The only option is to resort to the undocumented ---pretend-input-tty <-- But is this safe to keep using if not documented? Any plans to make ---pretend-input-tty an official "thing" in Parted?
Example that will work whether increasing or reducing the partition size:
echo -e "resizepart 1 46280703s\nyes\nunit s\nprint\nquit" | sudo parted /dev/loop0 ---pretend-input-tty
Any help much appreciated,
Flex
- bug#71790: parted -s emits a warning when shrinking a partition,
Sean Warner <=