Skip to content

Instantly share code, notes, and snippets.

@drsnyder
Created January 5, 2012 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drsnyder/1563912 to your computer and use it in GitHub Desktop.
Save drsnyder/1563912 to your computer and use it in GitHub Desktop.
Creating swap space
#!/bin/bash
mkdif -f /var/lib/swap
for swapf in {0..3}; do
dd if=/dev/zero of=/var/lib/swap/2-$swapf count=4194304 bs=512
mkswap /var/lib/swap/2-$swapf
echo "/var/lib/swap/2-$swapf swap swap defaults 0 0" >> /etc/fstab
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment