This is my bash script to automatically partitioning new disk on Ubuntu.
The new disk will be partitioning as EXT4 filesystem.
I'm made this to automatically partition disk on Google Cloud Platform Ubuntu VM. But of course you can use this to any Ubuntu VM.
The list of command is get from https://cloud.google.com/compute/docs/disks/add-persistent-disk#expandable-2.
So you don't need to enter a command one by one.
Just run this command in your Ubuntu terminal:
wget https://gist.github.com/walditamaniko/9e25b655e8e3bcafda4e4d23dadcf2ae/raw/a2e57f617ef15880a9453a8f4d468f1b350a0e80/partition-disk.sh;sudo chmod +x partition-disk.sh;sudo ./partition-disk.sh
Then follow the instruction in your terminal