In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to add a swap partition to the Llinux system, which is very detailed and has a certain reference value. Interested friends must read it!
Does swap space feel like linux's virtual memory? when there is not enough memory, use certain technical means to temporarily store some things in physical memory that have not been used for a long time when the physical memory is not large enough, and then free up some memory for programs to use.
The method of adding is very simple.
First of all, you need a superuser identity (preceded by sudo or sudo su -)
First of all, sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576
The / dev/zero file represents a device file that always outputs 0, and you can use it as input to get an all-empty file. Therefore, it can be used to create new files and to overwrite old files.
Here we create an empty file with a size of 1G (bs means to write 1024bit each time, a total of 1048576 times)
Then we set this file as the swap file.
Sudo mkswap / swapfile
Here are the parameters of the mkswap command, which can be added if necessary
-c check for damaged blocks before establishing a swap area.
-f add this parameter when establishing a swap area on a SPARC computer.
-v0 establishes a legacy exchange area, which is the default value.
-V1 to establish a new exchange area.
And then
Sudo swapon / swapfile
Just open the swap partition.
This thing uses
Sudo swapon-s to check, if it appears
/ swapfile file10485720-1
This indicates that the setting is successful.
The above is all the contents of the article "how to add swap partitions to the Llinux system". Thank you for reading! Hope to share the content to help you, more related 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: 257
*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.