Created
July 5, 2016 15:15
-
-
Save robertlabrie/c70cb9cd3bf3975dc19b147bb1a9e99f to your computer and use it in GitHub Desktop.
A bash script to automatically resize a disk ... because Centos6
This file contains 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 | |
parted /dev/xvdf unit s print | |
#todo: detect OS type | |
start=`parted /dev/xvdf unit s print | grep primary | awk '{print $2}'` | |
echo $start | |
parted /dev/xvdf rm 1 | |
parted /dev/xvdf mkpart primary ext4 2048s 100% | |
parted /dev/xvdf set 1 boot on | |
parted /dev/xvdf unit s print | |
e2fsck -f /dev/xvdf1 | |
resize2fs -p /dev/xvdf1 | |
mount /dev/xvdf1 /mnt | |
df -h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment