LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Swap Partition vs File (https://www.linuxquestions.org/questions/linux-general-1/swap-partition-vs-file-461020/)

Philips 07-04-2006 06:04 PM

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?

Agrouf 07-04-2006 06:10 PM

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).

Philips 07-04-2006 06:12 PM

I have 192mb of ram, so i should make the swap partition 500MB?

Agrouf 07-04-2006 06:17 PM

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.

Philips 07-04-2006 06:21 PM

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.

tgo 07-04-2006 06:24 PM

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.

Agrouf 07-04-2006 06:34 PM

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.

Philips 07-04-2006 06:38 PM

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?

Agrouf 07-04-2006 06:41 PM

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.

Philips 07-04-2006 06:45 PM

Alright cool, its good to know that i can always change it. So the boot partition is primary and the swap logical?

Agrouf 07-04-2006 06:48 PM

Not necessarily. It is like you want. Only the mbr has a fix position.

Philips 07-04-2006 06:51 PM

Im auctaully a little confused about what primary partitions and logical partitions? What configuration would be best for my situation?

btmiller 07-04-2006 09:00 PM

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.


All times are GMT -5. The time now is 03:42 AM.