例如,我想在Ubuntu下调整我的分区大小并使用命令行工具:parted。通常我需要几个步骤来回答它的问题。
root@intel-corei7-64:~# parted /dev/mmcblk0 resizepart 3 29000M
Warning: Not all of the space available to /dev/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 53420032 blocks) or continue with the current setting?
parted: invalid token: 3
Fix/Ignore? Fix
Partition number? 3
Warning: Partition /dev/mmcblk0p3 is being used. Are you sure you want to continue?
Yes/No? Yes
End? [3914MB]? 29000MB
Information: You may need to update /etc/fstab.
第一个命令行是parted /dev/mmcblk0 resizepart 3 29000M
然后我回答Fix
的第一个问题。然后3
代表第二个问题。然后Yes
代表第3个问题。然后29000MB
作为最后一个问题。
我需要通过一个脚本自动完成所有这些步骤,如何制作这样的脚本?
答案 0 :(得分:0)
echo -e "Fix\n3\nYes\n29000MB" | parted /dev/mmcblk0 resizepart 3 29000M