[root@rhel64 ~]# fdisk -cul
[root@rhel64 ~]# fdisk -cu /dev/sdb
m查看命令帮助 t 修改分区类型 l查看分区类型代码
![]()
改为82 linux swap
w保存分区表
查看分区表、/dev/目录下设备
[root@rhel64 ~]# fdisk -cul /dev/sdb
[root@rhel64 ~]# ll /dev/sdb*
[root@rhel64 ~]# partx -a /dev/sdb
[root@rhel64 ~]# ll /dev/sdb*
[root@rhel64 ~]# mkswap -h
[root@rhel64 ~]# mkswap -L swap /dev/sdb3
查看卷标、UUID
[root@rhel64 ~]# blkid
LABEL=swap swap swap defaults 0 0
[root@rhel64 ~]# vi /etc/fstab
交换分区没有文件系统,不需要挂载点
[root@rhel64 ~]# free -m
[root@rhel64 ~]# swapon -a
[root@rhel64 ~]# free -m
[root@rhel64 ~]# reboot

吕星昊
2015.12.20
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29475508/viewspace-1875730/ ,如需转载,请注明出处,否则将追究法律责任。