如何创建swap空间

2019-01-06  本文已影响0人  塔塔七

1/查看储存空间

 free -m

2/查看分区情况

df -h

3/创建swap文件

dd if=/dev/zero of=/home/swap bs=1024 count=512000

4/创建swap分区

mkswap /home/swap

5/查看内存

free -m

6/挂载

vi /etc/fstab

# /etc/fstab

# Created by anaconda on Fri Nov 21 18:16:53 2014

#

# Accessible filesystems, by reference, are maintained under '/dev/disk'

# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

#

UUID=6634633e-001d-43ba-8fab-202f1df93339   / ext4 defaults,barrier=0 1 1

UUID=6ff030ce-898d-4245-b6d5-ee1580c26929       swap    swap    defaults        0 0

上一篇下一篇

猜你喜欢

热点阅读