LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-25-2004, 07:56 AM   #1
SBarretDolph
LQ Newbie
 
Registered: Jan 2004
Location: Taipei Taiwan
Distribution: YDL, Mandrake, SourceMage
Posts: 16

Rep: Reputation: 0
Where to put swap


I will have the following scheme

/ 1g
/swap 1024
/var 5g
/usr 7g
/home 4g

Where should I put swap?

I would tend to do this

sda1 /
sda5 /swap
sda6 /var
sda7 /usr
sda8 /home

Will that give me problems? I have read, or remember, or don't know..that older hard drives like swap in the middle but newer and faster ones like it on the outsid. But is sda8 (on my setup) on the outside? I have a SCSI drive.

Cordially,
S. Barret Dolph
 
Old 01-25-2004, 08:20 AM   #2
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 32
Your current setup is quite fine. The swap is in a good place. And, swap must be towards the middle, and never towards the outer end!
 
Old 01-25-2004, 09:16 AM   #3
SBarretDolph
LQ Newbie
 
Registered: Jan 2004
Location: Taipei Taiwan
Distribution: YDL, Mandrake, SourceMage
Posts: 16

Original Poster
Rep: Reputation: 0
Should I then put swap more in the middle like after /var?
 
Old 01-25-2004, 09:21 AM   #4
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 32
Middle does not mean the middle literally. It means the centre if the hdd, the inner end ,i.e., the opposite of outer end. So your current setup is ok, but it will be better if you interchange the / and swap partitions.
 
Old 01-25-2004, 09:25 AM   #5
SBarretDolph
LQ Newbie
 
Registered: Jan 2004
Location: Taipei Taiwan
Distribution: YDL, Mandrake, SourceMage
Posts: 16

Original Poster
Rep: Reputation: 0
As a primary partition?
 
Old 01-25-2004, 09:40 AM   #6
bigjohn
Senior Member
 
Registered: Jun 2002
Location: UK .
Distribution: *buntu (usually Kubuntu)
Posts: 2,692
Blog Entries: 9

Rep: Reputation: 45
Just for info, I recently played with installing gentoo. I had originally had XP, mandrake and debian. All on single partitions - with no problems - i.e. no swap either.

But installing gentoo was a little like "pulling teeth", and as much as I tried, I couldn't get it to install on a single partition (the gentoo default is boot, swap and root).

So I totally re-installed/partitioned as follows:-

hda1 = windows XP (primary partition)
hda2 = boot (primary partition)
hda3 = swap (primary partition)
hda4 = extended to be hda5 with gentoo and hda6 with mandrake

When I was looking into this, I was also told about possible performance gains by placing the swap in the middle of the hard disc, but now understand that this was mainly from when hard discs weren't as fast as they are now.

I am presuming that there may still be some benefit's if your hard discs are massive and you are doing shitloads of server type stuff, then you may end up needing to centralise the swap to reduce the hard disc search times etc.

Strictly speaking, you don't really need swap, given that these days, system's tend to have enough ram to handle most app's. But as with my case, having a swap partition has made my system take the gentoo install OK, I don't know/can't tell or see if it's had any beneficial effect on my mandrake install.

Oh and I made the swap about 1.5 gig's, because I have 768 megs of physical ram installed and just followed the wisdom of having a swap of double what ram you have installed - this hasn't caused me any problems.

good luck

regards

John
 
Old 01-26-2004, 01:59 AM   #7
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 32
No, not as a primary partition. You can always make / as primary partition. I asked you to just put swap in the beginning of the drive. Unlike in Windows, you can make up to four primary partitions in linux, and the first partition need not be a primary partition(No problem even if it is a primary partition or not!)
 
Old 01-26-2004, 03:43 AM   #8
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
the swap should be placed were its most acessable from wereeever it is on teh disk, (i put mine in teh front, after reading this im like well taht could be a problem (althio it usualy only needs swap when i do stuff like compile large programs (glibc is teh only program that messed up cuse i needed to turn on swap file (i thought i 4got somthing ))
 
Old 01-26-2004, 12:38 PM   #9
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
The location of swap space really depends on how critical it's use is. Keep in mind that swap is used as additional memory when needed. Unfortunately, using swap is not as fast a real memory. If swap speed is critical, it needs to be placed on the begining of the drive where access times are fastest. If swap is being used just prevent things from locking up or crashing, then any location will do.

Last edited by stickman; 01-26-2004 at 12:40 PM.
 
Old 01-26-2004, 02:28 PM   #10
Khabi
Member
 
Registered: Aug 2003
Location: Arizona
Distribution: Gentoo
Posts: 142

Rep: Reputation: 15
Quote:
Originally posted by UltimaGuy
Your current setup is quite fine. The swap is in a good place. And, swap must be towards the middle, and never towards the outer end!
Really? I always heard it should be on the outer end because it spins faster there and will be read quicker resulting in better swap performance. I'm not doubting you, but could you explain why it would be better in the middle over the outside?
 
Old 01-26-2004, 10:44 PM   #11
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 32
Khabi, if you think about it, you'll recognize that the beginning or the center of the drive is more easily accessible than the outer end, as it has a smaller cylinder area to rotate and is more easily accessible to the R/W head. So, since swap does have a lot of R/W hits, it is better to be in the beginning.

Or, that is what I've thought. But when I googled, I did find that it is recommended to place swap partitions at the end of newer drives to improve performance. I am stumped by this, but I'll learn more when I have spare time and post it here...
 
Old 01-27-2004, 12:07 AM   #12
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
The only thing I have ran into when putting swap first and then, absentmindedly of course, pointing grub to it for the conf file. Needless to say, it didn't find it.

I put mine like this for Gentoo:

/boot
swap
/
/usr
/home

No problems. Grub is happy and it is fast. I need to get another stick of 512 for mine too. Mozilla was using 320MBs earlier. I closed it, still holding onto it. Then I did killall. That worked. Teach Mozilla to mess with me.

Your way should work just fine. Go for it.

Going to newegg for memory.

Later

 
  


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
Should I put the swap partition at the beginning or the end of the drive? mpyusko Slackware - Installation 32 04-11-2011 06:07 AM
Where to put swap partition mikieboy Linux - Software 3 11-25-2004 12:01 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 07:58 PM
Linux put the swap partition on my second HD. Don't want it there. rdaves@earthlink.net Linux - General 3 09-21-2001 08:42 AM

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

All times are GMT -5. The time now is 07:53 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