2

I'm trying to troubleshoot a script that used to work in some scenarios before. If I substitute script variables, what I'm trying to run is:

parted -s /dev/sdb unit MiB resizepart 1 307199

This produces:

Warning: Partition /dev/sdb1 is being used. Are you sure you want to continue?

But after this there is the OS prompt with no changes to feed an answer to parted. More over, if I run it without -s:

parted /dev/sdb unit MiB resizepart 1 307199

I'm getting this:

Warning: Partition /dev/sdb1 is being used. Are you sure you want to continue?
Yes/No? Yes
End?  [102399MiB]?

I'm not sure why am I being asked about End, if it was already provided on the command line above, can you explain?

Here is some more diagnostic commands:

# parted -v
parted (GNU parted) 3.3
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by <http://git.debian.org/?p=parted/parted.git;a=blob_plain;f=AUTHORS>.

parted /dev/sdb unit MiB print

Model: VMware Virtual disk (scsi) Disk /dev/sdb: 307200MiB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags:

Number Start End Size File system Name Flags 1 1.00MiB 102399MiB 102398MiB ext4 primary

The end goal is to be able to continue using this in a script, that is without human input at the runtime.

0 Answers0