How to Increase swap space in Solaris/Linux

Source: Internet
Author: User

Linux temporarily adds swap space:

Step 1:

# Dd if =/dev/zero of =/home/swap bs = 1024 count = 500000

Note: of =/home/swap: place the swap space. The size of count is the size of the added swap space, and the size of 1024 is the block size. Here it is 1 K, so the total space is bs * count = 500 M

Step 2:

# Mkswap/home/swap

Note: format the space in the previous step into various swap types.

Step 3:

# Swapon/home/swap

Note: Make the created swap space

To close the newly opened swap space, run the following command: # swapoff

Solaris temporarily increases swap space:

Step 1:

# Mkdir/swap

Step 2:

# Mkfile 51200 k/swap/s01

Note: Create an empty file of the required size

Step 3:

# Swap-a/swap/s01

Note: parameter a indicates creating a swap partition.

Step 4:

# Swap-l

Note: Verify that the swap file is correctly added to the disk space pool.

Step 5:

# Swap-s

Note: Summary of swap space

In addition:

If you want to use the entire partition as the swap space, you can use the block device name as the parameter of the swap command:

# Swap-a/dev/dsk/c1t1d2s1

To make sure that the partition is added as swap at startup, add the following content to the/etc/vfstab file:

# Deveice device mount FS fsck mount

# To mount to fsck point type pass a tboot ops

/Dev/dsk/c1t1d2s1--swap-no-

-D option can delete a file (or device) from the swap space pool:

# Swap-d/swap/s01

# Swap-d/dev/dsk/c1t1d2s1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.