LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 07-04-2006, 07:04 PM   #1
Philips
Member
 
Registered: Sep 2004
Posts: 40

Rep: Reputation: 15
Swap Partition vs File


I am doing an install of Slackware 10.2 and I dont have a swap partition. Im new to linux and didd't know what a swap partition was, so I looked up, and I see that I could make a swap file alternativley. Which is better (preformance)? And how large should the partition/file be since my hdd is only 10 gigs?
 
Old 07-04-2006, 07:10 PM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
A swap partition is better than a swap file for performance, because you don't have a file system overhead.
The partition should be about 2 times the size of your RAM, but it's not that important if you have a lot of RAM (if you have 512Mb or more, then only the size of RAM is nice).
 
Old 07-04-2006, 07:12 PM   #3
Philips
Member
 
Registered: Sep 2004
Posts: 40

Original Poster
Rep: Reputation: 15
I have 192mb of ram, so i should make the swap partition 500MB?
 
Old 07-04-2006, 07:17 PM   #4
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
It depends what you are doing. Are you going to edit large pictures or videos or are you going to use a lot of RAM?
For most people, 384 Mb should be enough.
 
Old 07-04-2006, 07:21 PM   #5
Philips
Member
 
Registered: Sep 2004
Posts: 40

Original Poster
Rep: Reputation: 15
Sometimes if i find a cool pic i edit/resize it and make a new avatar/signature to use on forums. In windows, it was nothing that I couldnt do in paint, but I'll be using gimp in linux. My desktop is 800x600 and so im going to be resizing some wallpapers too. I might be doing some sound editing and converting/re-encoding. Other than that, just videos, music, chat, surfing.
 
Old 07-04-2006, 07:24 PM   #6
tgo
Member
 
Registered: Dec 2004
Posts: 125

Rep: Reputation: 15
something like

dd if=/dev/zero of=/dev/swapfile ( add size or just let it run and ctrl+c )
mkswap /dev/swapfile
swapon /dev/swapfile

You will need to have swapon run every time the computer starts so add it to a startup file.
 
Old 07-04-2006, 07:34 PM   #7
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
Quote:
Originally Posted by Philips
Sometimes if i find a cool pic i edit/resize it and make a new avatar/signature to use on forums. In windows, it was nothing that I couldnt do in paint, but I'll be using gimp in linux. My desktop is 800x600 and so im going to be resizing some wallpapers too. I might be doing some sound editing and converting/re-encoding. Other than that, just videos, music, chat, surfing.
384 Mb is definitely enough.
 
Old 07-04-2006, 07:38 PM   #8
Philips
Member
 
Registered: Sep 2004
Posts: 40

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tgo
something like

dd if=/dev/zero of=/dev/swapfile ( add size or just let it run and ctrl+c )
mkswap /dev/swapfile
swapon /dev/swapfile

You will need to have swapon run every time the computer starts so add it to a startup file.
this is to create a swap file?

Im going to make my swap partition 400MB and i can always make it smaller/larger with partition manager applications such as Partition magic?
 
Old 07-04-2006, 07:41 PM   #9
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
Quote:
Originally Posted by Philips
this is to create a swap file?

Im going to make my swap partition 400MB and i can always make it smaller/larger with partition manager applications such as Partition magic?
Use gparted (for Gnome) or qtparted (for KDE). Those have a GUI, are free and very good.
You just have to deactivate and reactivate swap with swapoff and swapon before and after resizing.
 
Old 07-04-2006, 07:45 PM   #10
Philips
Member
 
Registered: Sep 2004
Posts: 40

Original Poster
Rep: Reputation: 15
Alright cool, its good to know that i can always change it. So the boot partition is primary and the swap logical?
 
Old 07-04-2006, 07:48 PM   #11
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
Not necessarily. It is like you want. Only the mbr has a fix position.
 
Old 07-04-2006, 07:51 PM   #12
Philips
Member
 
Registered: Sep 2004
Posts: 40

Original Poster
Rep: Reputation: 15
Im auctaully a little confused about what primary partitions and logical partitions? What configuration would be best for my situation?
 
Old 07-04-2006, 10:00 PM   #13
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,167

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
It doesn't matter whether the swap partition is on a primarily or logical partition -- the performance will be the same. The only reason logical partitions exist is that there's only space to store information on four primary partitions on the MBR of a PC so logical partitions were added as a hack so people could have more than four partitions per hard drive.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Swap file & Boot Partition Resize surfer2k3 Linux - Newbie 4 07-17-2008 08:50 PM
Partition Hd fr DSL and Win XP p2 What size for part, & swap file beekers Linux - Newbie 4 06-09-2005 11:14 PM
questions about switching file systems and the swap partition flyingstarfish Linux - Newbie 1 07-09-2004 01:27 PM
How do I partition so Red Hat and SuSE share the same swap file. sjia Linux - Newbie 3 01-31-2004 09:26 AM
Swap file "drive" or partition for new PC/speed questions? robbow52 Linux - Hardware 4 01-08-2004 05:59 PM


All times are GMT -5. The time now is 10:16 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration