In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to create a swap partition". In daily operation, I believe many people have doubts about how to create a swap partition. The editor consulted all kinds of materials and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the doubts about "how to create a swap partition". Next, please follow the editor to study!
An error was reported when building oracle on redhat 7.2. there is no swap partition.
Because oracle requires swap partitions, it is not allowed to install oracle databases without swap partitions.
So add swap partitions to the existing system.
Use df-h to view the existing disk size
[root@ip-xxxxxxx] # df-h
Filesystem Size Used Avail Use% Mounted on
/ dev/xvda2 15G 12G 3.2G 80% /
Devtmpfs 3.9G 0 3.9G 0% / dev
Tmpfs 3.7G 0 3.7G 0% / dev/shm
Tmpfs 3.7G 17M 3.7G 1% / run
Tmpfs 3.7G 0 3.7G 0% / sys/fs/cgroup
Tmpfs 757m 0757m 0% / run/user/1001
Tmpfs 757m 0757m 0% / run/user/0
View memory size
[root@ip-xxxxxxx ~] # free
Total used free shared buff/cache available
Mem: 7747784 628112 4903364 1212908 2216308 5695152
Because the memory is 8g, theoretically the swap should also be 8g, but because it is a test library and the disk size is insufficient, set swap to 1g (enough)
1. Create a file to be a swap partition with a size of 1G. The command is written as follows, where the count is equal to the number of blocks you want (bs*count= file size).
# dd if=/dev/zero of=/swapfile bs=1k count=1024000
two。 Format to swap partition file:
# mkswap / swapfile # build the file system of swap
3. Enable swapping partition files:
# swapon / swapfile # enable swap files
4. Modify the file / etc/fstab and set it to boot.
Add on the last line
/ swapfile swap swap default 0 0
5. Note: if you do not use swap, kill the swap partition
Swapoff / swapfile
At this point, the study on "how to create a swap partition" 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.