[root@ 777 ~]# gdisk /dev/sdb
Command (? for help): n #新建分区
Partition number (2-128, default 2): #回车
First sector (34-41943006, default = 2099200) or {+-}size{KMGTP}: #回车
Last sector (2099200-41943006, default = 41943006) or {+-}size{KMGTP}: +1G #给1G
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): #回车
Changed type of partition to 'Linux filesystem'
Command (? for help): w #保存
Do you want to proceed? (Y/N): y
[root@ 777 ~]# mkswap /dev/sdb2 //格式化