Increasing Swap Space
Solaris 10
- Create a swapfile in a desired location. The following command will create a 8 gigabyte file in the root directory called swapfile:
# mkfile 8g /swapfile
- Edit your
/etc/vfstab so that it will mount the swapfile the next time the machine reboots. The vfstab entry should look like this:
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
/swapfile - - swap - no -
- You can add the /swapfile to your swap without rebooting using the following command:
# swap -a /swapfile
Red Hat
- Create swapfile. If the blocksize (bs) is 1024 bytes, and we are creating an 8 gigabyte swapfile, the count should be:
1024 * 1024 bytes = 1048576 bytes = 1 GB
1048576 bytes * 8 = 8388608 bytes = 8 GB
# cd /
# dd if=/dev/zero of=swapfile bs=1024 count=8388608
- Add the swapfile to your swap.
# swapon -s
# mkswap /swapfile 8388608
# swapon -s
- Edit your
/etc/fstab file to mount your swapfile upon boot.
# vi /etc/fstab
/swapfile swap swap defaults 0 0
--
JesseSuen - 02 Mar 2006