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 > Development >
Share
Shulou(Shulou.com)06/01 Report--
The content of this article mainly focuses on how to re-mount the SWAP partition in the Linux system. The content of the article is clear and clear. It is very suitable for beginners to learn and is worth reading. Interested friends can follow the editor to read together. I hope you can get something through this article!
SWAP partition is the swap partition of temporary data in Linux system. When the physical memory of the system is insufficient, a part of the hard disk memory is released to be used by the currently running program, so how to remount the SWAP partition in the Linux system?
1. Execute the device name of the swapoff swap partition to close the swap file.
2. Delete the original swap partition from the device name of swap and create a new swap partition. You can do this using fdisk
If you partition a / dev/sda device:
Fdisk / dev/sda
Screen Tip:
Command (m for help):
Type p
The screen lists all the current partition device number, size, file format, and other parameters.
Delete the partition as follows:
Screen Tip:
Command (m for help):
Type d
Screen Tip:
Partition number (1murx):
X is the number of partitions you have, and if you have two partitions, x is 2; start with the last partition when you delete a partition, type 2:
Screen Tip:
Command (m for help):
Type p
List the current partition and find that sda2 has been deleted
Continue typing d, then 1, and then p, and find that all the partitions of sda have been deleted
Screen Tip:
Command (m for help):
Type w
Save the current delete operation and go back to the main interface. If there is also a partition on / dev/sdb, delete it according to the above method.
The following is the operation to create a partition:
Fdisk / dev/sda
Screen Tip:
Command (m for help):
Type p
There should not be any partitions on the hard drive at this time
Type n
Screen Tip:
First cylinder (abcd-efgh, default abcd):
Both abcd and efgh are numbers, indicating the number of cylinders at the beginning of the new partition. Type enter directly.
Screen Tip:
Last cylinder or + size or + sizeM or + sizeK (abcd-ijkl, default ijkl):
Abcd and ijkl are also numbers. Here, you are required to define the size of the partition. If you want to establish a 2G space, type + 2000m. If you want to separate all the space behind, type enter directly. Note that the partition is large.
Small units M and K must be capitalized!
Screen Tip:
Command (m for help):
Type p
It is found that a partition sda1 has been established with a size of 2G
Follow the above method to create more partitions, which can be viewed with p, and finally type w to save the operation.
3. After rebuilding the swap in this way, you can use mkswap / dev/sda [x], where [x] represents your partition.
4. Activate the swap partition swapon / dev/sda [x] 5. If you want to activate this swap file automatically when the system starts, you should add the following line in / etc/fstab:
/ dev/sda [x] swap swap defaults 0 0
After adding the swap file and enabling it, use the cat / proc/swaps or free command to see if the swap file is
Was successfully enabled.
What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.
Thank you for your reading. I believe you have some understanding of "how to remount SWAP partition in Linux system". Go to practice quickly. If you want to know more about it, you can follow the website! The editor will continue to bring you better articles!
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.