スクリプトモードでpartedをどのように使用しますか?

スクリプトモードでpartedをどのように使用しますか?

以前に特定の状況で機能していたスクリプトの問題を解決しようとしています。スクリプト変数を置き換える場合、実行する内容は次のとおりです。

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

これで以下が生成されます。

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

ただし、その後、OSは何も変更せずにpartedへの回答を提供するように求められます。さらに、次のことなく実行すると-s

parted /dev/sdb unit MiB resizepart 1 307199

私はこれを得ます:

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

Endというメッセージが表示される理由がわかりません。上記のコマンドラインですでにEndを提供している場合は、説明できますか?

追加の診断コマンドは次のとおりです。

# 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

究極の目標は、実行時に人の入力なしでスクリプトで使用でき続けることです。

ベストアンサー1

おすすめ記事