LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-27-2006, 08:52 AM   #1
Kristian2
Member
 
Registered: May 2004
Location: Netherlands
Distribution: Slackware 13
Posts: 97

Rep: Reputation: 15
what is best location of swap


The first part of my HD is occupied by XP, the rest I plan to fill with Linux. I was wondering what is performance wise the best physical location of swap, if it matters all that much in the first place.
My Linux partitions will be something like:
/root
/tmp
/var
/swap
/home
/usr/local/games
/boot (primary partition, all the rest logical)

where root and home being the largest. I thought between the two largest partitions would be the best choice, or otherwise at the beginning.
I have 1G of RAM and twice this amount of swap seems a bit waste of space, I thought around 500MB.
What can you suggest?
 
Old 10-27-2006, 09:13 AM   #2
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
The physical of swap isn't very important, as long as you set the right config options for your HDD (like DMA etc - If your distro doesn't do so out of the box, use hdparm). Is is true that the nearer to the beginning of the HDD the faster the access times, but the differences are very small, and then there's the matter of the distribution of the cylinders... don't worry. Just keep in mind that it's easier to change the size of a partition at the end of it than at the beginning, and that if you want to tweak the other partition sizes (change them in any way after your initial install or add new partitions later) it's probably a good idea to have swap before anything else so you won't have to remember its location and modify fstab accordingly.

As for swap=2xRAM, that's true for older machines with little RAM. In your case it will depend on what you are going to use your box for. A server may need more RAM/SWAP, a typical desktop will be fine with 500MB RAM
 
Old 10-27-2006, 09:17 AM   #3
Kristian2
Member
 
Registered: May 2004
Location: Netherlands
Distribution: Slackware 13
Posts: 97

Original Poster
Rep: Reputation: 15
Appreciated/fixed
 
Old 10-27-2006, 09:38 AM   #4
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
Graag gedaan!
 
Old 10-27-2006, 10:07 AM   #5
Kristian2
Member
 
Registered: May 2004
Location: Netherlands
Distribution: Slackware 13
Posts: 97

Original Poster
Rep: Reputation: 15
I thought you were Spanish.
 
Old 10-28-2006, 11:47 AM   #6
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
Think again!

I just live there (/here)
 
Old 10-28-2006, 12:29 PM   #7
Kristian2
Member
 
Registered: May 2004
Location: Netherlands
Distribution: Slackware 13
Posts: 97

Original Poster
Rep: Reputation: 15
I'm afraid the subject gets a little off topic, pensionado.
 
Old 10-28-2006, 01:01 PM   #8
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
If you are creating a system for desktop use, there is little advantage in making so many partitions. Most people just need / and a seperate /home. As for swap, try to avoid making it the first partition on any hard drive. I've seen a few people who had problems booting their systems due to having swap on the first primary partition.
 
Old 10-28-2006, 01:20 PM   #9
Kristian2
Member
 
Registered: May 2004
Location: Netherlands
Distribution: Slackware 13
Posts: 97

Original Poster
Rep: Reputation: 15
The first part of my hd consists of XP, of which the first partition is primary and the other partitions are logical. As you can have one extended partition, this means that my other (linux) partitions are logical, except for the last /boot partition.
The partitions /tmp and /var (trash directories) are subject to frequent change and in order to avoid defragmentation it is not unwise to have separate partitions of them. To have a separate partition of /usr (or better /opt) as well, is perhaps for a desktop pc not necessary, but programs that are regularly updated or modified I prefer to have on a separate partition as well, perhaps a little overly diligent. It may waste some harddisk space in exchange for less fragmentation. However fragmentation seems to be hardly an issue on Unixes. No one bothers, does one?

Last edited by Kristian2; 10-28-2006 at 02:34 PM.
 
Old 10-28-2006, 01:26 PM   #10
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
Buy as much RAM as your machine can hold.

I set up my systems with three partitions: /boot, swap space, and everything else. For ordinary purposes this gives the most flexibility. (I set up big servers differently.)

I allocate swap-space that's 2.5 times the size of physical RAM.

If there is more than one fast disk-volume available, and the I/O infrastructure is such that multiple disk I/Os can be performed simultaneously (usually not the case on a garden-variety PC), then I'll divide the swap space across all of the spindles that are available.

But RAM is king. The best swap is the one you never have to do. "Chips are cheap."
 
Old 10-28-2006, 02:39 PM   #11
Kristian2
Member
 
Registered: May 2004
Location: Netherlands
Distribution: Slackware 13
Posts: 97

Original Poster
Rep: Reputation: 15
What about that fragmentation issue (from swap to fragmentation), to what extend does fragmentation play a role?
 
Old 10-28-2006, 03:13 PM   #12
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
Is fragmentation an issue at all? THere are no defrag aps AKAIK so I thought it wasn't.

(P.S. pensionado? I wish - Not sure if that still exists by the time I'm eligeable)
 
Old 10-28-2006, 05:43 PM   #13
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Linux filesystems don't fragment very much. Search for "linux+disk+defragmentation" and "linux+fragmentation" on google and you will find lots of articles that explain the issue in detail.

Last edited by reddazz; 10-28-2006 at 05:45 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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache: location in location eantoranz Linux - Networking 2 08-08-2005 09:37 PM
Linux swap / solaris not appearing as swap in Ubuntu? Erik_the_Red Linux - Newbie 1 07-30-2005 12:57 PM
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
best location for swap partition spyderusa11 Linux - General 14 07-22-2003 02:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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