LinuxQuestions.org
Help answer threads with 0 replies.
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 03-27-2004, 07:17 PM   #1
Patgod
LQ Newbie
 
Registered: Mar 2004
Location: Vermont
Distribution: Slackware 9.1
Posts: 16

Rep: Reputation: 0
Looking to increase swap partition


I'm looking to delete my swap partition(100mb) and remake it with something decent, on the order of 600mb. Is it safe to just fdisk it away and make a new one? Or should i do something in the OS first to tell it "hey, swap partition is going away"

Also, when its made should i just use the addswap option on the slack bootcd or is there a better command to do within the shell?
 
Old 03-27-2004, 07:34 PM   #2
GATTACA
Member
 
Registered: Feb 2002
Location: USA
Distribution: Fedora, CENTOS
Posts: 209

Rep: Reputation: 32
RULE #1: Backup your data BEFORE you play around with this.

Now, if you have some free space on your drive you can just add a new partition with fdisk or cfdisk and make it a swap partition. Then just add a new line to your /etc/fstab file. Reboot and you should have more swap space.

If you don't have free space that means your going to have to do some divide-and-conquer. Delete one of your current partitions (preferably not the root one). Make 2 new partiions from it. Format one of them as a swap partition and the other as whatever you like.

HTH.

Remember to backup up your data. This is relatively simple to do if you have free space on your drive. Otherwise it can be like doing brain surgery on yourself: not unheard of, but you really wouldn't wanna do it.
 
Old 03-27-2004, 07:48 PM   #3
Patgod
LQ Newbie
 
Registered: Mar 2004
Location: Vermont
Distribution: Slackware 9.1
Posts: 16

Original Poster
Rep: Reputation: 0
No data to back up. Since this is my first time touching linux i'm using an old computer, and the OS was installed yesterday. But thanks, shouldnt have any problems(knock on wood)
 
Old 03-28-2004, 03:54 PM   #4
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
How much swap are you actually using today, and what kind of box are you running? Personally, my experience is that if you've got, say, either 256Mg or 512Mg of RAM (or more) then you only need 256Mg of swap, if that. If you are running KDE, I'd recommend checking out System > Info Center > Memory. Unless your swap space is over 50% used, I'd say leave things the way they are.

The old rule of thumb with swap was to make it "twice RAM", but that was in the days where having 64Mg RAM was bleeding edge. If you've got 512Mg RAM, then it's very unlikely that your memory will be paging out to disk, and therefeore, a huge swap partition is just wasting disk space. -- J.W.
 
Old 03-28-2004, 04:35 PM   #5
Patgod
LQ Newbie
 
Registered: Mar 2004
Location: Vermont
Distribution: Slackware 9.1
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by J.W.
How much swap are you actually using today, and what kind of box are you running? Personally, my experience is that if you've got, say, either 256Mg or 512Mg of RAM (or more) then you only need 256Mg of swap, if that. If you are running KDE, I'd recommend checking out System > Info Center > Memory. Unless your swap space is over 50% used, I'd say leave things the way they are.

The old rule of thumb with swap was to make it "twice RAM", but that was in the days where having 64Mg RAM was bleeding edge. If you've got 512Mg RAM, then it's very unlikely that your memory will be paging out to disk, and therefeore, a huge swap partition is just wasting disk space. -- J.W.
~300mb of ram. the computer's akin to frankensteins monster.
 
Old 03-29-2004, 12:36 PM   #6
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
Well 300Mg of RAM isn't too shabby, and I'd definitely suggest checking to see how much swap your system actually is using (under a normal to heavy load). If you see that swap is getting hit pretty hard, then Yes, you should expand it, but if your swap usage is very, very light or essentially non-existant, then increasing swap won't have any effect. In other words, if you pretty much aren't using your swap in the first place, increasing it from 100Mg to 512Mg (or whatever) won't have any effect. An analogy: suppose you kept $100 in a jar at home just for special occasions where you don't have time to go to the ATM. If you take $10 out every once in a while, and on very rare occasions take out $20, then your actual usage of that jar is minimal, and there would be pretty much no point in adding another $500 to that jar if you typically only take out $10. Same deal with swap, there's no real point in increasing the size unless you're using it pretty extensively (ie, if your jar contains $100 but you often are taking $50 or $60 or $90 bucks out of it, then Yes, having a bigger jar (ie, $200 or $400) would be a good idea.)

Sorry for the long post, my main point is that increasing swap will only deliver better results if your current swap is being heavily used. If it is, increasing it may be helpful, otherwise you're only making disk space unavailable to yourself. You may also want to consider buying more memory, which would almost guarantee a performance increase -- J.W.
 
Old 03-29-2004, 02:06 PM   #7
webwolf11
LQ Newbie
 
Registered: Mar 2004
Location: Washington, DC
Distribution: RedHat 9
Posts: 14

Rep: Reputation: 0
Well, reading through this post made me realize that I wasted alot of disk space on my instalation. I have 1024MB of DDR3200, so I created a 2GB swap partition on my RedHat 9 install.

Would it be safe to use partition magic under windows xp to shrink my swap partition to 256mb and realocate the disk space to my root partition?
 
Old 03-29-2004, 03:40 PM   #8
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
As always, before you do any work on your partitions you should backup all of your important data first, but otherwise I see no problems with shrinking partition "A" and giving the free space to partition "B", regardless of what kinds of partitions A and B are. I don't know your level of experience with PM, but if you've been using it for a while and are comforatble with it then I'd say go for it. Even if PM is pretty new to you, resizing partitions is a good thing to learn, but you would want to do some reading first to minimize the chance of an error. (Absolute worst case scenario here would be that you'd need to drop and recreate your RH9 partitions and then do a reinstall, but if you've just recently installed RH9 anyhow, then maybe even this scenario isn't too bad. Heck, I've screwed things up so many times on my system that I must have done about 20 total reinstalls by now, but the positive outcome of all those mistakes is that I now can partition my drives and reinstall Linux in my sleep, so overall, it worked out favorably.)

Anyway, I'll assume that you've got some decent experience with PM and therefore, my suggestion would be to do the backup of your important data first, but just go for it. Good luck with the project -- J.W.
 
Old 03-29-2004, 05:46 PM   #9
webwolf11
LQ Newbie
 
Registered: Mar 2004
Location: Washington, DC
Distribution: RedHat 9
Posts: 14

Rep: Reputation: 0
Thanks, I was afraid that linux would complain about the missing swap space hehe. I will give it a try when I get home. And yes I am very confortable with partitioning disks with Fdisk/PM.
 
  


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
/tmp partition won't increase? I_AM Linux - General 1 03-19-2005 12:18 AM
ubuntu - increase swap size dna9 Linux - Distributions 11 01-24-2005 11:45 AM
I want to increase my Linux partition.Should I take space from a Windows partition? PrinceBalak Linux - General 1 06-25-2004 05:44 PM
How to increase SWAP partition space ? sureshsaragadam Linux - Newbie 23 10-01-2003 09:24 AM
Increase Swap Space? star geezer Linux - Software 9 03-10-2003 12:04 PM

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

All times are GMT -5. The time now is 03:49 PM.

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