Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Kubuntu User (http://www.linux-archive.org/kubuntu-user/)
-   -   what is the difference between swap partition and swap file (http://www.linux-archive.org/kubuntu-user/261316-what-difference-between-swap-partition-swap-file.html)

Da Liu 03-10-2009 03:33 PM

what is the difference between swap partition and swap file
 
hi~
can anybody tell me the what the difference is between them? How about the efficiency?

I am not sure whether* I should enlarge the /swap partition or make a swap file
as a virtural swap partition.


Which is better?

I wanna increase the swap because my laptop cannot hibernate correctly.
(1G memory, now the /swap is ~1G) .

D. Liu
THU&&ICCAS


--

--
kubuntu-users mailing list
kubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/kubuntu-users

Matthew Flaschen 03-11-2009 06:33 PM

what is the difference between swap partition and swap file
 
Da Liu wrote:
> hi~
> can anybody tell me the what the difference is between them? How about
> the efficiency?

Supposedly, there is no difference, assuming the swap file is
contiguous. See http://lkml.org/lkml/2005/7/7/326 among other sources.

> I am not sure whether I should enlarge the /swap partition or make a
> swap file as a virtural swap partition.

It shouldn't matter for performance, but I would be tempted to say
enlarge the partition (though this may involve some backing up and
restoring), simply because reinstalls will be easier in the future.

Matt Flaschen

--
kubuntu-users mailing list
kubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/kubuntu-users

Nils Kassube 03-11-2009 07:10 PM

what is the difference between swap partition and swap file
 
Da Liu wrote:
> can anybody tell me the what the difference is between them?

A swap file is an ordinary file written to a mounted file system. A swap
partition is a separate partition used for swap only.

> How
> about the efficiency?

If you are worried about efficiency avoid swapping, i.e. install more
RAM or don't use that many huge applications simultaneously.

> I am not sure whether I should enlarge the /swap partition or make a
> swap file
> as a virtural swap partition.
>
> Which is better?
>
> I wanna increase the swap because my laptop cannot hibernate
> correctly. (1G memory, now the /swap is ~1G) .

In that case increase your swap partition because you can't use a swap
file to hibernate. From <https://help.ubuntu.com/community/SwapFaq>:

| The hibernation feature (suspend-to-disk) writes out the contents of
| the memory to the swap partition before turning off the machine.
| Therefore, your swap partition should be at least as big as your RAM
| size. The hibernation implementation currently used in Ubuntu, swsusp,
| needs a swap or suspend partition, and can not use a swap file on an
| active file system.


Nils

--
kubuntu-users mailing list
kubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/kubuntu-users

Derek Broughton 03-11-2009 07:11 PM

what is the difference between swap partition and swap file
 
Da Liu wrote:

> can anybody tell me the what the difference is between them? How about the
> efficiency?
>
> I am not sure whether I should enlarge the /swap partition or make a swap
> file as a virtural swap partition.
>
> Which is better?
>
> I wanna increase the swap because my laptop cannot hibernate correctly.
> (1G memory, now the /swap is ~1G) .

Ah - you just simplified the question. Generally speaking, I'd say a swap
file is superior for one reason - you can resize it easily. Performance
wise it's supposed to make no difference these days.

However _afaik_ you can't use a swap file for hibernation, yet. So unless
that's changed since I last looked, you don't have much choice.
--
derek


--
kubuntu-users mailing list
kubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/kubuntu-users


All times are GMT. The time now is 04:14 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.