You are here: TWiki > Guides Web > Solaris > AddingSwap r3 - 07 Mar 2006 - 07:56 - JesseSuen


Start of topic | Skip to actions

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

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback