1.查看现有swap空间大小
[root@centos7 ~]# free
total used free shared buff/cache available
Mem: 2028116 389108 1266584 12644 372424 1424920
Swap: 2097148 0 2097148
2.添加新磁盘,并进行分区。分区类型为82(Linux swap / Solaris)
[root@centos7 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x5dfd214d.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Using default va