Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-18-2008, 09:33 AM   #1
Registered: Aug 2003
Location: chennai
Posts: 115

Rep: Reputation: 15
increase swap size

i installed fedora9 in my desktop machine with 512 MB RAM.
partitions size are
now i increased the RAM 512MB to 1GB i want to increase my swap file to 2GB without losing data
plz tell me how to
Old 08-18-2008, 09:39 AM   #2
Registered: Jun 2006
Location: Johannesburg, South Africa
Distribution: Ubuntu, CentOS, Debian
Posts: 47

Rep: Reputation: 15
You can use a utility such as parted to resize your partitions to give your swap partition more space.
Old 08-18-2008, 09:42 AM   #3
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
Is that 11.1 GB the size of the whole hard drive? Or do you have unpartitioned space or do you have other partitions you didn't mention?

Do you have a more significant reason to want to increase your swap space or are you just following some formula that says it should be double the ram size?

You can use the partitioning tool when booted from a liveCD to move, shrink and grow partitions as you like, and you could increase that swap partition without losing data. If you move the boot partition, you might need to reinstall stage 1 of grub, but that is also easy while booted in that liveCD.

Before trying any of that, you should have a better idea of whether increasing your swap partition size is a good idea. From the little info you've provided, I would guess it is not.
Old 08-18-2008, 09:45 AM   #4
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,988

Rep: Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217
In other words, don't bother unless you are already paging (with the new memory installed).
Old 08-18-2008, 10:42 AM   #5
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
And if you do use swap considerably with your new memory in use and think you need to extend the swap partition, consider buying even more RAM.
Old 08-18-2008, 10:23 PM   #6
Senior Member
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 3,271

Rep: Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586
You can make another swap file:

linux # dd if=/dev/zero bs=1M count=1000 of=/home/sam/swapfile
mkswap /home/sam/swapfile
swapon /home/sam/swapfile

This way you can test if you really need it, and if you do, put an entry in /etc/fstab, and if you don't, delete it.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOw increase the swap disk size? hinetvenkat Linux - Server 1 07-25-2007 09:55 PM
Is there an easy way to increase SWAP size? Mow Slackware 5 07-25-2007 07:32 PM
How to increase swap size in LVM? Akhran Debian 1 04-04-2006 10:47 AM
ubuntu - increase swap size dna9 Linux - Distributions 11 01-24-2005 12:45 PM
increase point size size when printing PDF files newlin Red Hat 0 09-27-2003 08:13 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration