LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-18-2008, 08:33 AM   #1
ssilayaraja
Member
 
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
/boot=100MB
/root=10GB
swap=1GB
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, 08:39 AM   #2
garyalex
Member
 
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, 08:42 AM   #3
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
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, 08:45 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
In other words, don't bother unless you are already paging (with the new memory installed).
 
Old 08-18-2008, 09:42 AM   #5
b0uncer
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, 09:23 PM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
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.
 
  


Reply



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 08:55 PM
Is there an easy way to increase SWAP size? Mow Slackware 5 07-25-2007 06:32 PM
How to increase swap size in LVM? Akhran Debian 1 04-04-2006 09:47 AM
ubuntu - increase swap size dna9 Linux - Distributions 11 01-24-2005 11:45 AM
increase point size size when printing PDF files newlin Red Hat 0 09-27-2003 07:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:28 AM.

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