Last active
February 13, 2017 14:30
-
-
Save giskou/ce32707fc9c0f100cc2f64455432b873 to your computer and use it in GitHub Desktop.
Set up disk
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
| #!/usr/bin/env bash | |
| mkdir $2 | |
| echo "Partitioning $1" | |
| echo -e "n\np\n1\n\n\nw" | fdisk "$1" | |
| echo "Formating $1" | |
| mkfs.ext4 "$1"1 | |
| UUID=`blkid | grep "$1" | egrep -o '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}'` | |
| echo "UUID=$UUID $2 ext4 defaults 1 2" >> /etc/fstab | |
| echo "Mounting $1 on $2" | |
| mount $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment