In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces you how to add swap partition in Linux, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Create a normal Linux partition (either primary partition or logical partition)
Fdisk / dev/sdbCommand (m for help): pDisk / dev/sdb: 8589 MB, 8589934592 bytes255 heads, 63 sectors/track, 1044 cylinders Total 16777216 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x740e36e3 Device Boot Start End Blocks Id System/dev/sdb1 63 4194367 2097152 + 83 Linux/dev/sdb2 4194368 16777215 6291424 5 Extended/dev/sdb5 4194431 8388735 2097152 + 83 Linux/dev/sdb6 8388799 16777215 194208 + 83 Linux
Take sdb6 as an example, you can see that the hexadecimal code of the partition is 83, that is, the normal Linux partition.
Modify the hexadecimal coding of the partition type
/ / t command: overwrite partition hexadecimal coding Command (m for help): t Partition number (1-6): 6Accord L command to view the hexadecimal codes of different partitions The exchange partition is 82Hex code (type L to list codes): 82Changed system type of partition 6 to 82 (Linux swap / Solaris) Command (m for help): pDisk / dev/sdb: 8589 MB, 8589934592 bytes255 heads, 63 sectors/track, 1044 cylinders Total 16777216 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x740e36e3 Device Boot Start End Blocks Id System/dev/sdb1 63 4194367 2097152 + 83 Linux/dev/sdb2 4194368 16777215 6291424 5 Extended/dev/sdb5 4194431 8388735 2097152 + 83 Linux/dev/sdb6 8388799 16777215 194208 + 82 Linux swap / Solaris// partition table writes to disk and exits Command ( M for help): wThe partition table has been altered calling ioctl () to re-read partition table.Syncing disks.
Format swap partition
Mkswap / dev/sdb6Setting up swapspace version 1, size = 4194204 KiBno label, UUID=40eff2c0-3f6b-440e-bc2a-f71d3d5581a7
Enable swap partition
Swapon / dev/sdb6
View the load status of the swap partition
Free total used free shared buffers cachedMem: 1030108 160768 869340 264 12040 56188 Muhammad + buffers/cache: 92540 937568Swap: 6291352 06291352
Deactivate the swap partition
Swapoff / dev/sdb6
P.s.
You cannot mount the swap partition directly using the mount command, because the swap partition does not have a mount point.
Modify the / etc/fstab configuration file directly to make it mount automatically when the system starts:
/ dev/sdb6 swap swap defaults 00 dev/sdb6 swap swap defaults / View swap partition swapon-sFilename Type Size Used Priority/dev/sda2 partition 2097148 0-1/dev/sdb6 partition 4194204 0-2 what is the Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-thread and multi-CPU operating system Using Linux, you can run major Unix tools, applications, and network protocols.
On how to add swap partition in Linux to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.