linux - Bash script with fdisk -
i came across bash script expand fs after making root volume larger on ami made packer. can please explain meaning of fdisk options in heredoc?
#!/bin/bash fdisk /dev/xvda <<eeof d n p 1 1 w eeof exit 0
thank you!
to determine these mean, @ built-in fdisk
. details may differ based on implementation; mine, looks this:
command (m help): m help: dos (mbr) toggle bootable flag b edit nested bsd disklabel c toggle dos compatibility flag generic d delete partition l list known partition types n add new partition p print partition table t change partition type v verify partition table misc m print menu u change display/entry units x functionality (experts only) save & exit w write table disk , exit q quit without saving changes create new label g create new empty gpt partition table g create new empty sgi (irix) partition table o create new empty dos partition table s create new empty sun partition table
...so:
d
deletes partition (presumably script developed version offdisk
if there's 1 partition, there's no prompt on delete).n
creates new partition.p
indicates it's primary partition being created.1
indicates should primary partition #11
indicates should start @ sector #1- the following blank line accepts default end sector
w
writes changes disk.
Comments
Post a Comment