In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you the "sample Analysis of redhat linux swap Partition extension", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let the editor lead you to study and study the "sample Analysis of redhat linux swap Partition extension".
Three methods of redhat linux swap Partition extension
Swap introduction:
When the physical memory is used up, when the system needs more physical memory, the inactive pages in the physical memory is move to the swap space. Swap space is located on the hard disk, so access is slower than physical memory.
When the physical memory of the machine changes, the swap partition should be extended accordingly:
There are three ways to extend the swap partition:
Expand the logical volumes of the swap partition in use (recommended)
2. Create a new swap partition
3. Create a new swap file
The specific steps are as follows:
Expand the logical volumes of the swap partition in use
Set the logical volume used as the swap partition to: / dev/VolGroup00/LogVol01
Disable swapping for the associated logical volume:
# swapoff-v / dev/VolGroup00/LogVol01
Resize the LVM2 logical volume by 256 MB:
# lvm lvresize / dev/VolGroup00/LogVol01-L + 256m
Format the new swap space:
# mkswap / dev/VolGroup00/LogVol01
Enable the extended logical volume:
# swapon-va
Test that the logical volume has been extended properly:
# cat / proc/swaps or # free
2. Create a new swap partition
Set the logical volume of the newly created swap partition to: / dev/VolGroup00/LogVol02
Create the LVM2 logical volume of size 256 MB:
# lvm lvcreate VolGroup00-n LogVol02-L 256m
Format the new swap space:
# mkswap / dev/VolGroup00/LogVol02
Add the following entry to the / etc/fstab file:
/ dev/VolGroup00/LogVol02 swap swap defaults 00
Enable the extended logical volume:
# swapon-va
Test that the logical volume has been extended properly:
# cat / proc/swaps or # free
3. Create a new swapfile
To extend swap in this way, the first step is to calculate the number of block. Specifically, the size of the swapfile expanded as needed, in M units. Block=swap partition size * 1024. For example, if you need to extend 64m swapfile, then: block=64*1024=65536.
Then do the following steps:
Dd if=/dev/zero of=/swapfile bs=1024 count=65536
Setup the swap file with the command:
Mkswap / swapfile
To enable the swap file immediately but not automatically at boot time:
Swapon / swapfile
To enable it at boot time, edit / etc/fstab to include the following entry:
/ swapfile swap swap defaults 0 0
After adding the new swap file and enabling it, verify it is enabled by viewing the output of the command cat / proc/swaps or free.
The above is all the content of the article "sample Analysis of redhat linux swap Partition extension". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.