把Swap添加到Ubuntu的开机启动项的方法介绍
时间:2022-06-15 11:52:07
众所周知,Swap是Ubuntu系统中的交换分区,其功能有点类似Windows系统的虚拟内存。在Ubuntu中添加Swap分区后,可以加快系统的速度。把Swap添加到Ubuntu的开机启动项,就能让Swap开机自动挂载,具体如何操作呢?下面跟随小编一起来看看把Swap添加到Ubuntu的开机启动项的方法介绍。
Swap
1.增加 Swap
增加 2G Swap分区,只需要 修改 count=2k
sudo dd if=/dev/zero of=/swap.disk bs=1M count=2k
sudo mkswap -f /swap.disk
sudo swapon /swap.disk
or
sudo dd if=/dev/zero of=/swap.disk bs=1M count=2k && sudo mkswap -f /swap.disk && sudo swapon /swap.disk
2.加入启动
sudo vi /etc/rc.local
exit 0 之前加入:
#sudo dd if=/dev/zero of=/swap.disk bs=1M count=2k && sudo mkswap -f /swap.disk && sudo swapon /swap.disk
sudo mkswap -f /swap.disk && sudo swapon /swap.disk
exit 0
标签:Swap,Ubuntu,
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Power Manager是如何显示不活动警告的,你一定要知道!
2022-02-06 16:26:46
![](https://img.aspxhome.com/file/2023/9/a209449_0s.png)
wps打开文件很慢很卡怎么办?wps打开文件很慢很卡的解决方法
2022-06-10 09:31:12
![](https://img.aspxhome.com/file/2023/4/a182194_0s.png)
Excel中如何统一加相同金额的工资
2023-01-25 07:26:00
![](https://img.aspxhome.com/file/2023/9/a161169_0s.jpg)
Win10省电模式怎么设置?Win10设置省电模式的方法
2023-07-07 09:18:32
![](https://img.aspxhome.com/file/2023/28/a242856_0s.jpg)
win10 10074最新预览版Aero特效回归
2023-02-04 18:04:16
![](https://img.aspxhome.com/file/2023/28/a250490_0s.jpg)
win7系统鼠标右键无法弹出菜单怎么办?
2022-09-10 07:26:14
![](https://img.aspxhome.com/file/2023/1/a281914_0s.png)
epic逃生者2怎么联机-epic逃生者2联机方法
2023-10-25 18:08:17
![](https://img.aspxhome.com/file/2023/4/a305104_0s.jpg)
MacOS如何修复磁盘权限?MacOS修复磁盘权限的方法
2023-08-17 01:15:47
![](https://img.aspxhome.com/file/2023/3/a215893_0s.png)
Win7主题安装失败 删第9个字符空格的具体步骤
2022-09-09 19:21:53
![](https://img.aspxhome.com/file/2023/29/a259206_0s.jpg)
Win11打开注册表编辑器的八种方法介绍
2023-06-30 09:01:30
![](https://img.aspxhome.com/file/2023/30/a268508_0s.jpg)
苹果 iOS 16.2 全新“无边记”应用是什么?如何使用?
2023-06-05 04:11:55
![](https://img.aspxhome.com/file/2023/0/44800_0s.png)
Win10此设备不支持接收Miracast无法投影的解决方法
2023-05-05 04:54:42
![](https://img.aspxhome.com/file/2023/28/a239480_0s.jpg)
Adobe Acrobat DC怎么调整PDF多级书签的顺序?
2023-08-21 21:14:36
![](https://img.aspxhome.com/file/2023/4/15774_0s.png)
Win11卡顿怎么解决? Win11卡顿严重完美解决方法
2023-11-15 08:47:05
![](https://img.aspxhome.com/file/2023/27/a237225_0s.jpg)
Win11无法退回Win10怎么办 Win11恢复不了Win10的方法
2023-04-05 23:08:39
![](https://img.aspxhome.com/file/2023/1/a282834_0s.jpg)
如何释放Gmail空间解决空间不足的问题?
2022-07-31 23:29:40
![](https://img.aspxhome.com/file/2023/2/a206262_0s.jpeg)
WPS 纸质版怎么扫描成Word版
2023-09-18 11:07:05
![](https://img.aspxhome.com/file/2023/3/a186123_0s.jpg)
Win10无法连接到这个网络怎么办?Win10无法连接到这个网络的解决方法
2023-06-14 06:53:03
![](https://img.aspxhome.com/file/2023/3/46443_0s.jpg)
Win10系统怎么启用内置虚拟机?内置虚拟机开启教程
2022-08-13 13:28:08
![](https://img.aspxhome.com/file/2023/25/a218984_0s.jpg)
windows8系统下无权限使用RD命令的解决方法
2022-12-12 22:06:58
![](https://img.aspxhome.com/file/2023/4/a303564_0s.jpg)