Last active
February 28, 2017 06:15
-
-
Save furlongm/983fca00ea49e0e93e0e46fe9166f9a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
num_partitions=16 | |
dev=/dev/nvme0n1 | |
let size=$(sudo parted ${dev} print | grep "Disk ${dev}" | sed -e "s/Disk.*: //" -e "s/GB//")/num_partitions | |
sudo parted -s ${dev} mklabel gpt | |
start=0 | |
for part in $(seq 1 ${num_partitions}) ; do | |
let end=${start}+${size} | |
sudo parted -a opt -s ${dev} mkpart primary ${start}G ${end}G | |
sudo sgdisk -t ${part}:45B0969E-9B03-4F30-B4C6-B4B80CEFF106 ${dev} | |
start=${end} | |
done | |
sudo parted ${dev} print |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment