Linux 硬盘挂载及设置交换分区swap

pointfish 2019-12-14

mkswap /dev/sda2
[ ~]# swapon /dev/sda2 -a
[ ~]# free -m
total used free shared buff/cache available
Mem: 96271 793 95198 9 279 94951
Swap: 8191 0 8191

写入开机自启动
[ ~]# tail -1 /etc/fstab
/dev/sda2 swap swap defaults 0 0
[ ~]#

相关推荐