Adding an additional swap file on Linux
Adjust your call to dd to get the size you want.
[root@host ~]# dd if=/dev/zero of=/swapfile bs=1024 count=1048576
1048576+0 records in
1048576+0 records out
[root@host ~]# sync
[root@host ~]# mkswap /swapfile
Setting up swapspace version 1, size = 1073737 kB
[root@host ~]# swapon /swapfile
[root@host ~]# echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
Don’t try this under OpenVZ/VZ though, seems to actually use _more_ memory.
May 20th, 2007 at 11:19 am