Skip to content

Instantly share code, notes, and snippets.

@seeingidog
Created September 16, 2011 19:05
Show Gist options
  • Save seeingidog/1222850 to your computer and use it in GitHub Desktop.
Save seeingidog/1222850 to your computer and use it in GitHub Desktop.
# partition for swap
if [ "$(arch)" == 'x86_64' ]; then
SWAPSIZE=$[`free -m | awk '/^Mem:/{print $2}'`*2]
if [ "$SWAPSIZE" -gt "4096" ]; then
SWAPSIZE=4096
fi
sfdisk -uM /dev/sdb << EOF
,$SWAPSIZE,S
,,L
EOF
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment