Created
November 27, 2012 07:07
-
-
Save badboy/4152865 to your computer and use it in GitHub Desktop.
smartos-vmtools rc.local script for hdd-resizing.
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
reformat_disk() { | |
size=$(mdata-get sdc:disks.0.size) | |
swapsize=$(mdata-get swap_size) | |
size=$(echo ${size}-${swapsize} | bc) | |
cat <<EOF | fdisk /dev/vda | |
d | |
n | |
p | |
1 | |
+${size}M | |
n | |
p | |
2 | |
w | |
EOF | |
partprobe | |
} | |
# after reboot: | |
resize2fs /dev/vda1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment