Question:
I have an old Fedora installation on my system. I have just upgraded my RAM from 256 to 512 MB. My swap partition is also of 512 MB. Is there any way by which I can increase my swap space to 1 GB without formatting and reinstalling my OS.
Answer:
Sure you can increase the size of swap without reinstalling the OS. This can be done by either adding a new
swap partition or creating a swap file, instead. Here, I will discuss the steps to add a new swap file to increase the swap size as this is possible even if you do not have free unpartitioned space in your hard disk for creating new partitions, but have free space on one of your partitions. To make a swap file of 1 GB,
multiply 1024 MB and 1024 to get a block size. Now, at a shell prompt, as the root user, type the following
command with the count being equalto the desired block size:
dd if=/dev/zero of=/swapfile bs=1024 count=1048576
Now set up the swap file:
mkswap /swapfile
Enable the swap file after creating it by using the following command:
swapon /swapfile
Add the following entry in the the /etc/fstab file to make the system activate this file as swap while booting
the system:
/swapfile swap swap defaults 0 0
This will enable your 1 GB swap space, every time your system boots. You can check the size of swap by
using the free command or by cat /proc/swap.
相关文章
- 自动改变html font-size,实现移动端rem适配
- 325. Maximum Size Subarray Sum Equals k
- 深度强化学习中的episode、epoch、batch-size、iteration
- 【Pytorch中batch超参数的选择】对于batch_size解读
- ElasticSearch系列 - SpringBoot整合ES:实现分页搜索 from+size、search after、scroll
- MYSQL,innodb_buffer_pool_size内存分配
- set up size, title to tcl tk main window
- 请定义一个交通工具(Vehicle)的类,其中有: 属性:速度(speed),体积(size)等等
- 1.请定义一个交通工具(Vehicle)的类其中有: 属性: 速度(speed)、 体积(size)等,方法:移动(move)、设置速度(setSpeed(int speed))、加速 spee
- 请定义一个交通工具(Vehicle)的类,其中有: 属性:速度(speed),体积(size)等