In that example ... in the current directorygreengeek wrote:Interesting idea. Where does it create it?rufwoof wrote:Detect when memory is getting low (as per Fred's script) and ...
dd if=/dev/zero of=swapfile bs=1024k count=1024
mkswap swapfile
swapon swapfile
type thing (that creates and activates a 1GB swapfile)
I was just showing a example. My sda2 is a large ext3 format that I store data on so if I intend to render a largish video or whatever intensive activity, as more usually I don't have a swap partition/file active I usually create/activate a swapfile in the root of that sda2 partition before doing that activity. Something like :
Code: Select all
cd
mkdir -p sda2
mount /dev/sda2 sda2
cd sda2
if [ ! -f swapfile ]; then
dd if=/dev/zero of=swapfile bs=1024k count=1024
mkswap swapfile
swapon swapfile
fi