Add Swap partition
Swap partition:
Swap is a virtual memory similar to the one in Jade win, and a portion of the hard disk space virtual
Memory to solve the problem of insufficient memory, but speed does not change, slow
Depending on the speed of the hard disk itself, swap is typically used when physical memory is exhausted
Instance:
[Email protected] ~]# fdisk/dev/sdb #分区sdb
Command (M for help): N
Select (default p): P
Partition number (2-4, default 2):
First sector (10487808-41943039, default 10487808):
Using Default Value 10487808
Last sector, +sectors or +size{k,m,g} (10487808-41943039, default 41943039): +5g #5G大小
Command (M for help): T #更改分区类型
Partition Number (2, default): 2 #2号分区
Hex Code (type L to list all codes): L #列出分区所有可用的分区类型
Hex Code (type L to list all codes): #==swap
Changed type of partition ' Linux ' to ' Linux Swap/solaris '
Command (M for help): W #保存退出
[Email protected] ~]# partprobe #让内核同步
[Email protected] ~]# mkswap/dev/sdb2 #格式化为swap type
Setting up Swapspace version 1, size = 5242876 KiB
No label, UUID=99F3D6AD-DE95-498D-AB22-C712B481CA97
[Email protected] ~]# free-m #查看swap大小
swap:2047 0 2047
[Email protected] ~]# swapon/dev/sdb2 #将交换分区启用
[Email protected] ~]# free-m #查看swap大小
swap:7167 0 7167
linux[base]-22-[disk partition management]-[swap partition]-[02]