[Bug 1270203] Re: no way to use resizepart non-interactively on busy partition
Scott Moser
smoser at ubuntu.com
Tue Apr 14 15:32:41 UTC 2015
ok. i gave Jesse's suggestion a try.
It does seem to work, but some things are a bit annoying
a.) if the partition is not mounted, then passing 'yes' as shown results in error.
| $ sudo mount /dev/vdb1 /mnt
| $ sudo parted /dev/vdb resizepart 1 yes 1024
| Warning: Partition /dev/vdb1 is being used. Are you sure you want to continue?
| Information: You may need to update /etc/fstab.
|
| $ echo $?
| 0
However:
| $ sudo umount /mnt
| $ sudo parted /dev/vdb resizepart 1 yes 1024
| Error: Invalid number.
| $ echo $?
| 1
b.) I have to know the target size. I'd like to just say "make it as
big as possible".
I could work around both, but both are annoying.
--
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