LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 03-10-2009, 10:58 AM   #1
vibinlakshman
Member
 
Registered: Dec 2008
Location: Kerala, India
Distribution: Ubuntu 11.10
Posts: 334

Rep: Reputation: 33
Cool Help in creating swap space.


I had just installed gparted , not used yet
I have a problem , at the time of installation i havent created necessary swap space , my linux partition contains 30GB with ext2 filesystem

I'm fully having this , but my question is with the above mentioned tool can I recreate swap space from this 30GB , like 20GB as user space and rest 10 as swap space . Can I?
 
Old 03-10-2009, 12:45 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2010.12, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 9,310

Rep: Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353
A working ( mounted ) partition cannot be changed,
so you will have to reduce the 30 GB partition with
an external tool, a live cd, e.g. the Gparted live
cd. And create swap on the new empty space.

If you have 1 GB RAM, I would suggest 1..2 GB swap.
10 GB will never be used.
.....
 
Old 03-10-2009, 02:09 PM   #3
johnsfine
Senior Member
 
Registered: Dec 2007
Distribution: Mepis, Centos
Posts: 4,012

Rep: Reputation: 731Reputation: 731Reputation: 731Reputation: 731Reputation: 731Reputation: 731Reputation: 731
Linux can use a swap file instead of a swap partition. That involves a bit of extra overhead, so it isn't usually the best choice. But at this point you might find it the best choice. You could allocate that swap file in the existing partition while running in that partition. No need to resize by rebooting to a liveCD.

If you do decide to correct the partitioning, you can boot a liveCD run Gparted and shrink the existing partition and create a swap partition.

I don't agree with the implication made by knudfl that a 10GB swap partition is necessarily wrong nor that the proper size for the swap partition depends on the amount of physical RAM you have.

But it is unlikely that 10GB is a good choice for the swap partition size when you are taking that space away from a partition of only 30GB. It is likely your swap partition size should be much smaller than 10GB.

The best swap partition size depends primarily on how much rarely used data will be tied up in virtual memory by server programs, background processes, applications you've switched away from, etc. For an ordinary home user all that typically adds up to less than one GB. But I don't know what you intend to run on your Linux system. Maybe you intend a lot of virtual memory tied up in rarely running background processes.

Last edited by johnsfine; 03-10-2009 at 02:10 PM.
 
Old 03-10-2009, 02:35 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 10,465

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
There is no performance difference between swap partition vs swap file. That disparity went away with 2.4 kernels.
Here is an example of how to do allocate a swap file.
If you are running o.k. now without a swap at all, 1 Gig should be more than sufficient. A single 10 Gig swap is unnecessary - and unusable. On x86 the default system will only use 2 Gig of any extent - RHEL incorporate a patch to extend this, but I'm not aware of Ubuntu desktop using similar. Multiple swaps can be allocated should they be found to be necessary.
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
swap space (or) swap file yusufs Linux - Newbie 8 07-17-2008 02:02 AM
how to reduce swap space and reclaim the space grantm Linux - Newbie 3 11-19-2007 11:32 AM
how much swap space is needed; how to increase swap space? johnpaulodonnell Linux - Newbie 5 03-23-2007 03:20 AM
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 08:04 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM


All times are GMT -5. The time now is 08:43 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration