美文网首页
ubuntu 将交换区的文件转移到内存

ubuntu 将交换区的文件转移到内存

作者: 你说你要一场 | 来源:发表于2019-07-05 18:12 被阅读0次

将交换区的文件转移到内存,以使那些被转移到交换区的网页等文件可以快速打开。
方式是:卸载对应的交换区,然后再重新挂载。
1.查看交换区挂载信息:

h@h-B360M-D2VX-SI:~$ swapon -s
Filename                Type        Size    Used    Priority
/swapfile                               file        2097148 1130376 -2
/root/swapfile                          file        20971516    161632  -3

2.卸载交换区,这个指令会有一定的执行时间,为的就是把文件转移到物理内存。

h@h-B360M-D2VX-SI:~$ sudo swapoff /swapfile
[sudo] password for h: 

3.再次查看挂载状态。

h@h-B360M-D2VX-SI:~$ swapon -s
Filename                Type        Size    Used    Priority
/root/swapfile                          file        20971516    159976  -2

4.重新挂载。

h@h-B360M-D2VX-SI:~$ sudo swapon -a

5.查看挂载状态。

h@h-B360M-D2VX-SI:~$ swapon -s
Filename                Type        Size    Used    Priority
/swapfile                               file        2097148 0   -3
/root/swapfile                          file        20971516    159976  -2

相关文章

网友评论

      本文标题:ubuntu 将交换区的文件转移到内存

      本文链接:https://www.haomeiwen.com/subject/sixyhctx.html