[Bug 1270203] Re: no way to use resizepart non-interactively on busy partition

walterav 1270203 at bugs.launchpad.net
Thu Mar 12 21:33:34 UTC 2020


It still affects me on Ubuntu Focal Fossa 20.04 using parted 3.3, using
@Sunil Mohan Adapa (f-su7il-g)#6 workaround does work however the
upstream bug report seems to suggest its intentional?

https://lists.gnu.org/archive/html/bug-parted/2020-01/msg00005.html

In Ubuntu 19.10 using parted 3.2 this command used to work without interaction and without the -s/--script arguments:
parted /dev/sdX resizepart 2 y 100%

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to parted in Ubuntu.
https://bugs.launchpad.net/bugs/1270203

Title:
  no way to use resizepart non-interactively on busy partition

Status in parted package in Ubuntu:
  Confirmed

Bug description:
  I can't see a way to really use resizepart usefully on a mounted
  partition (which is kind of the point of the functionality).

  There are a few issues:
  a.) it seems that the size provided is in MB when realistically I'd like to provide the number in sectors or blocks, something more fine-grained than that.
  b.) no way to say 'grow as big as you can'
  c.) no way to use 'force' or use non-interactively outside of undocumented flag.

  Example:
  $ echo "1,1000,L" | sudo sfdisk /dev/vdb
  $ grep "vdb" /proc/partitions
   253 16 20971520 vdb
   253 17 504000 vdb1
  $ sudo mkfs /dev/vdb1
  $ sudo mount /dev/vdb1 /mnt

  ## now /dev/vdb is busy (mounted) try to resizepart on it.

  $ sudo parted /dev/vdb resizepart 1 </dev/null
  Warning: Partition /dev/vdb1 is being used. Are you sure you want to continue?
  $ echo $?
  1

  # so that didn't resize (reading from /dev/null). Not surprising.
  # try with 'Yes' to stdin.
  echo "Yes" | sudo parted /dev/vdb resizepart 1; echo $?
  Warning: Partition /dev/vdb1 is being used. Are you sure you want to continue?
  1

  
  I've also tried the undocumented '---pretend-input-tty' without success.
  It seems it can be used for some operations, but not for others.
  For example, this worked on an unmounted partition:
   echo "Yes" | sudo parted ---pretend-input-tty /dev/vdb resizepart 1 500

  But this doesn't seem to work on a mounted partition which is really my goal:
  echo "Yes" | sudo parted ---pretend-input-tty /dev/vdb resizepart 1 1000
  Warning: Partition /dev/vdb1 is being used. Are you sure you want to continue?
  parted: invalid token: 1000
  Yes/No? Yes
  End?  [500MB]?

  
  Related bugs:
   * bug 1212492: cloud-init  cc_growpart broken if parted resizefs found

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1270203/+subscriptions



More information about the foundations-bugs mailing list