#!/bin/bash -x # Create an ad hoc 1 GB extra swap space in Linux without reboots. # Run as root in a suitable place. Double-check manually whether it works! # # 2003-03-04, LTu FILE=swapfile.$RANDOM dd if=/dev/zero of=$FILE bs=1024k count=1024 mkswap $FILE swapon $FILE swapon -s free