CentOS创建swap分区的两种方法

装好系统后再添加swap分区有两种方法:分区的方法或文件的方法。

1.用分区的方法创建swap分区

这里把/dev/sdb2的文件系统改为swap

[root@sotneC6 ~]# umount /dev/sdb2
[root@sotneC6 ~]# fdisk /dev/sdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u').
Command (m for help): t          # 修改文件系统
Partition number (1-7): 2         #指定sdb2
Hex code (type L to list codes): 82     # swap分区ID
Changed system type of partition 2 to 82 (Linux swap / Solaris)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with

你可能感兴趣的:(运维,linux,centos,服务器,大数据)