In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to increase swap partition in linux". In daily operation, I believe many people have doubts about how to increase swap partition in linux. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to increase swap partition in linux". Next, please follow the editor to study!
1. Check the current partition:
# free-m
Total used free shared buffers cached
Mem: 2027 1826 200 0 28 1543
-/ + buffers/cache: 254 1772
Swap: 2047 0 2047
2. Increase the swap partition file and size. If you want to increase the swap partition of 2G size, the command is written as follows, where the count is equal to the desired block size.
# dd if=/dev/zero of=/home/swap bs=1024 count=2048000
2048000000000 records in
2048000000000 records out
2097152000 bytes (2.1 GB) copied, 50.2328 seconds, 41.7 MB/s
3, format the swap partition
# mkswap / home/swap
Setting up swapspace version 1, size = 2097147 kB
4, enable swapping partition files immediately
# swapon / home/swap
5, if you want to enable it automatically at boot time, edit the / etc/fstab file and add a line:
# vi / etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot / boot ext3 defaults 1 2
Tmpfs / dev/shm tmpfs defaults 0 0
Devpts / dev/pts devpts gid=5,mode=620 0 0
Sysfs / sys sysfs defaults 0 0
Proc / proc proc defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
/ home/swap defaults 0 0
"/ etc/fstab" 8L, 574C written
6. Check the current partition:
# free-m
Total used free shared buffers cached
Mem: 2027 1975 51 02 1712
-/ + buffers/cache: 259 1767
Swap: 4047 0 4047
At this point, the study on "how to add swap partitions to linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical 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.