X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsystem%2Fadd_swap_mount.sh;fp=scripts%2Fsystem%2Fadd_swap_mount.sh;h=593115fe2f58784938efbdde9c730f8c1024b4f2;hb=7b39f7e279005c8466ef508220a532ce2aa4abf8;hp=0000000000000000000000000000000000000000;hpb=3fbd372b35b15a19fb171d5ae34294ff7b1e6485;p=feisty_meow.git diff --git a/scripts/system/add_swap_mount.sh b/scripts/system/add_swap_mount.sh new file mode 100644 index 00000000..593115fe --- /dev/null +++ b/scripts/system/add_swap_mount.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# auto-find the scripts, since we might want to run this as sudo. +export WORKDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )" # obtain the script's working directory. +source "$WORKDIR/../core/launch_feisty_meow.sh" + +#hmmm: should be able to add a new swap drive if desired. + +#hmmm: why all the hard-coded paths below? + +/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 +test_or_die "creating swap file" + +/bin/chmod 600 /var/swap.1 +test_or_die "setting swap file permissions" + +/sbin/mkswap /var/swap.1 +test_or_die "formatting swap file as swap partition" + +/sbin/swapon /var/swap.1 +test_or_die "enabling new swap partition" + +free +