Linux 7.7Setting the swap partition SWAP
1. Create the swap partition file [root@devsz wxadmin] # dd if=/dev/zero of=/opt/swapfile bs=1M count=4096 4096800 records in4096+0 records out4294967296 bytes (4.3GB) copied, 20.789 s, 207MB/s2. Authorize a document
[root@devsz wxadmin] # chmod 600 / opt/swapfile
3. Format the exchange partition [root@devsz wxadmin] # mkswap / opt/swapfile Setting up swapspace version 1, size = 4194300 KiBno label, UUID=bfe83644-0fa0-43f9-bf7e-69f9e24b391f4. Open the swap partition
[root@devsz wxadmin] # swapon / opt/swapfile
5. Check the swap partition status [root@devsz wxadmin] # free-m total used free shared buff/cache availableMem: 3789 2682 208 280 898 586Swap: 4095 0 4095 [root@devsz wxadmin] #