修改swap分区太小
来源:互联网 发布:淘宝网天猫客服热线 编辑:程序博客网 时间:2024/06/11 03:42
You can always create swap file
to add more swap space. This is not same (in every aspect) as swap partition but it will be easy and dynamic.
Change /media/fasthdd/swapfile.img
to anything you like, for example it can be/swap.img
as well./media/fasthdd/swapfile.img
is just example filename, if you are using this one then of course there must be directory/media/fasthdd/
with enough free space for your new swap file.
Use any of terminal applications to run commands. All command should be run with root privileges, to do this you can either add sudo
to beginning of every command or runsudo bash
before running commands.
1. Create empty file:
This file will contain virtual memory contents so make file big enough for your needs. This one will create 1Gb file which means +1Gb swap space for your system:
dd if=/dev/zero of=/media/fasthdd/swapfile.img bs=1024 count=1M
If you want to make 3Gb file then change count value to count=3M
. Seeman dd
for more information.
2. Bake swap file:
Following command is going to make "swap filesystem" inside your fresh swap file.
mkswap /media/fasthdd/swapfile.img
3. Bring up on boot:
To make sure that your new swap space is activated while booting up computer you should add it to filesystem configuration file/etc/fstab
. Add it to end of file, this is recommended because other filesystems (at least one that contains swap file) must be mounted in read-write mode before we can access any files.
# Add this line to /etc/fstab/media/fasthdd/swapfile.img swap swap sw 0 0
4. Activate:
You can either reboot your computer or activate new swap file by hand with following command:
swapon /media/fasthdd/swapfile.img
If everything goes well
you should see that more swap space is available for use. You can use following commands to check your new swap and confirm that it is active:
cat /proc/swaps Filename Type Size Used Priority /media/fasthdd/swapfile.img file 8388604 2724 -1grep 'Swap' /proc/meminfo SwapCached: 4772 kB SwapTotal: 8388604 kB SwapFree: 8355812 kB
- 修改swap分区太小
- SWAP分区太小了怎么办?
- Swap分区太小 无法休眠 解决方法
- 修改Swap分区大小
- ubuntu修改swap分区大小
- ubuntu修改swap分区大小
- ubuntu修改swap交换分区大小
- 增加修改Ubuntu系统swap分区大小
- Linux修改swap分区空间大小
- linux下修改swap分区大小
- 修改swap交换分区的大小
- Ubuntu 修改交 swap 分区的大小
- swap分区
- Swap分区
- Swap分区
- Swap分区
- Swap分区
- swap分区
- 从无到有写一个C#弹球小游戏(二)
- Java笔记--CenOS6.5搭建hadoop2.7.1伪分布式环境
- OSX下brew cask install 本地安装pkg,dmg
- (4.2.1.3)EventBus使用详解(二)——EventBus使用进阶
- Android AlertDialog和PopupWindow使用和区别
- 修改swap分区太小
- Array类型(迭代与归并方法)
- (4.2.1.4)EventBus使用详解——新版本SDK
- Matlab中调用C语言生成Mex文件的方法
- 14.spark RDD深度解析
- 【USACO题库】4.1.1 Beef McNuggets麦香牛块
- Java并发之线程间协作Object的wait()、notify()、notifyAll()
- [数据挖掘工具] R语言书籍的学习路线图(转自格物堂)
- 自定义组件使用总结