Increase swap space in fedora 19
Hi, I just installed fedora 19 live version and i want to increase the swap memory size from 2 gb to 4 gb.I have a standard partition.Please help.
Hi, I just installed fedora 19 live version and i want to increase the swap memory size from 2 gb to 4 gb.I have a standard partition.Please help.
You can increase swap size with 2 different ways:
Method A - Add a hard drive partition
With fdisk, cfdisk or any other tool (gui tool also) create a new partition with the size you want, let's say 2 GB and the name is /dev/sdc1
Now create this simple partition into swap
# mkswap /dev/sdc1
# swapon /dev/sdc1
# /dev/sdc1 swap swap defaults 0 0
# swapon -s Filename Type Size Used Priority /dev/sda2 partition 4192956 0 -1 /dev/sdc1 partition 1048568 0 -2
Method B: Add a File
You can also use a file on your disk to use as swap.
# dd if=/dev/zero of=/root/myswapfile bs=1M count=2048
2048+0 records in 2048+0 records out
# ls -l /root/myswapfile
-rw-r--r-- 1 root root 1073741824 Aug 14 23:47 /root/myswapfile
# chmod 600 /root/myswapfile
# mkswap /root/myswapfile
# swapon /root/myswapfile
# cat /etc/fstab /root/myswapfile swap swap defaults 0 0
# swapon -s Filename Type Size Used Priority /dev/sda2 partition 4192956 0 -1 /root/myswapfile file 1048568 0 -2
Please read more from aritcle source here.
Asked: 2013-10-03 10:59:27 -0500
Seen: 5,051 times
Last updated: Dec 08 '15
Are you using logical volumes? LVM?
Please add the output of the
lsblk
andfdisk -l
commands. You can either enlarge the existing swap partition (i.e. resize the partition and reformat it), which is best if you have free space immediately after the current partition; or you can add a second swap partition where you do have free space.