LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 05-08-2008, 01:40 AM   #1
verndog
Member
 
Registered: Oct 2007
Posts: 94

Rep: Reputation: 17
swap file vs. swap partition


I ran across the idea of making a swap file in place of a swap partition.
Anyone have experience using swap file? Any pros or cons for either?

Here is some links on the subject:
SwapFile1

SwapFile2
 
Old 05-08-2008, 01:49 AM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu 10.04
Posts: 9,196

Rep: Reputation: 190Reputation: 190
Been asked before:
http://www.linuxquestions.org/questi...s-file-461020/

No subjective difference. If you have two drives, you can get a performance increase by putting your swap partition on a different drive to root. In general, partitions are faster than files. However, 21st century computers are so fast anyway...

(if you care so much about speed - do without swap altogether and run at least 1024MiB RAM.)
 
Old 05-08-2008, 02:47 AM   #3
UndiFineD
LQ Newbie
 
Registered: Jun 2004
Location: Netherlands
Distribution: adistro
Posts: 21

Rep: Reputation: 0
And what about suspend to disk ?

It uses the swap to store all memory contents.

If you need swap, sure place it at the lowest possible sectors and on a separate harddisk.

if you just use it for suspend and minor swap actions a swap file somewhere on your disk might be fine.


what is the future for swap with solid-state disks ?

mostly suspend actions, memory is relatively cheap.
so new systems should have few reasons to swap.
 
Old 05-08-2008, 04:54 AM   #4
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu 10.04
Posts: 9,196

Rep: Reputation: 190Reputation: 190
Quote:
And what about suspend to disk ?
Yep - if you care more about hibernate than speed, you want swap. If you want both - enable swap = RAM size and set swappiness to zero.

Quote:
If you need swap, sure place it at the lowest possible sectors and on a separate harddisk.
After the first swap - it won't be noticable. Single-disk setups often put swap in it's own extended partition.

There is usually quite a lot of debate about how best to use swap. Truth is, on modern systems the fine tuning is not noticeable without special equipment.
 
Old 05-09-2008, 01:12 AM   #5
verndog
Member
 
Registered: Oct 2007
Posts: 94

Original Poster
Rep: Reputation: 17
The reason I even brought this subject up was so that I could have only one partition instead of several that Linux likes to have. Windows typically has only one partition and cloning or imaging a system is easy. I wanted to do the same. I have learned through my ignorance that I don't need to back up the swap partition , and that I can easily recreate it.

I know a lot of thinking is that one should have '/home' as a separate partition, but if I image regularly what's the difference?
 
Old 05-09-2008, 05:06 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 21,615
Blog Entries: 47

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
While some distributions or users may automagically go for a "/" plus swap layout there's good reasons for having multiple partitions. Most of them are discussed in partitioning threads and we've got quite a few for you to read.
 
  


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 file & Boot Partition Resize surfer2k3 Linux - Newbie 4 07-17-2008 07:50 PM
Using swap and page file on same partition jgtg32a Linux - Desktop 1 10-25-2007 03:28 PM
Can the swap file partition be shared? benerivo Linux - Newbie 3 01-04-2007 10:20 AM
Swap Partition vs File Philips Linux - General 12 07-04-2006 09:00 PM
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 08:04 AM


All times are GMT -5. The time now is 02:08 AM.

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