Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use the mkswap command of linux to establish and set up a SWAP swap partition

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you the use of linux mkswap command to establish and set up SWAP exchange partition, I hope you will learn a lot after reading this article, let's discuss it together!

The mkswap command is used to create a swap partition on a file or device. After the establishment, use the sawpon command to start using the exchange. The last optional parameter specifies the size of the swap area, but this parameter is set for backward compatibility and is not necessary to use. The entire file or device is generally used as the swap area.

Syntax format: mkswap [parameters]

Common parameters:

Before setting up the exchange area, check if there are any damaged blocks.-f set up the exchange area on the SPARC computer. Add this parameter-v0 to establish the old exchange area, which is the default value-v1 to create a new exchange area.

Reference example

Add a swap partition, assuming it exists and set / dev/sdb3 as the swap partition:

[root@linuxcool ~] # mkswap / dev/sdb2 [root@linuxcool ~] # swapon / dev/sdb2

Create a 512m swap file with dd and set the file as the swap partition:

[root@linuxcool ~] # dd if=/dev/zero of=/swapfile1 bs=1024 count=524288 [root@linuxcool ~] # mkswap / swapfile1 [root@linuxcool ~] # swapon / swapfile1 after reading this article, I believe you have some understanding of using linux's mkswap command to establish and set up a SWAP exchange partition. Want to know more about it. Welcome to follow the industry information channel. Thank you for reading!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report