Linux temporarily increases swap space

Source: Internet
Author: User

Linux temporarily increases swap space:
Step 1:
#dd If=/dev/zero Of=/home/swap bs=1024 count=500000
Note: Of=/home/swap, place swap space; Count is the size of the increased swap space, 1024 is the block size, here is 1K, so the total space is bs*count=500m
Step 2:
# Mkswap/home/swap
Note: Format the space just to swap all kinds of
Step 3:
#swapon/home/swap
Comment: Make the swap space you just created
To close the newly opened swap space, just command: #swapoff
Solaris temporarily increases swap space:
Step 1:
#mkdir/swap

Step 2:
#mkfile 51200k/swap/s01
Comment: Create an empty file of the desired size

Step 3:
#swap-a/swap/s01
Note: Parameter a indicates a new swap partition
Step 4:
#swap-L
Comment: Verify that the swap file is correctly added to the disk space pool
Step 5:
#swap-S
Comment: summary information for swap space

Other:
If you want to use the entire partition as the swap space, you can take the block device name as a parameter to the swap command:
#swap-a/dev/dsk/c1t1d2s1
to ensure that the partition is added as swap at startup, you need to/etc/ The Vfstab file adds the following:
#deveice device Mount FS fsck mount Mount
#to mount to fsck point type Pass a tboot ops
/dev/ DSK/C1T1D2S1--Swap-no-

-D option to remove a file (or device) from the Swap Space pool:
#swap-D/swap/s01
#swap-D/dev/dsk/c1t1d2s1< /p>

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.