现在的位置: 首页Linux>正文
Linux下开启磁盘缓存(swap)
2013年10月30日 Linux 暂无评论 ⁄ 被围观 6,097 view+

1.命令行下执行free命令,当显示如下红框内的信息(swap)时,说明swap处于启用状态

此时注意,开启时total和free处均有值。

2.命令行下执行swapoff -a,关闭swap

swapoff -a

3.关闭后状态如下:

此时注意,并闭时total和free处均为0,由此可知swap已经关闭。开启命令为swapon -a
4.附swapon、swapoff参数说明

swapon

Usage:
 swapon -a [-e] [-v] [-f]             enable all swaps from /etc/fstab
 swapon [-p priority] [-v] [-f] <special>  enable given swap
 swapon -s                            display swap usage summary
 swapon -h                            display help
 swapon -V                            display version
The <special> parameter:
 {-L label | LABEL=label}             LABEL of device to be used
 {-U uuid  | UUID=uuid}               UUID of device to be used
 <device>                             name of device to be used
 <file>                               name of file to be used

swapoff
Usage:
 swapoff -a [-v]                      disable all swaps
 swapoff [-v] <special>               disable given swap
 swapoff -h                           display help
 swapoff -V                           display version
The <special> parameter:
 {-L label | LABEL=label}             LABEL of device to be used
 {-U uuid  | UUID=uuid}               UUID of device to be used
 <device>                             name of device to be used
 <file>                               name of file to be used

给我留言

留言无头像?


×
腾讯微博