Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

What is swap partition?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
Narendra
LXF regular


Joined: Wed Mar 14, 2007 4:32 pm
Posts: 317
Location: East Midlands, UK.

PostPosted: Wed Sep 07, 2011 9:48 am    Post subject: What is swap partition? Reply with quote

Hello,
I have created a swap partition of 8 gb and installed ubuntu with 30 gb of space.
When the Ubuntu fills up with its all 30 gbs, will the rest of the files get swapped to this SWAP partition?
Please advise.
_________________
Narendra
Back to top
View user's profile Send private message
RedWillow
LXF regular


Joined: Thu May 29, 2008 2:05 pm
Posts: 719

PostPosted: Wed Sep 07, 2011 10:13 am    Post subject: Reply with quote

No. A swap partition is analogous to the pagefile.sys file in Windows. It is used to swap stuff out of RAM if your RAM is getting too full.

Wikipedia article on paging:

http://en.wikipedia.org/wiki/Swap_partition
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2423

PostPosted: Wed Sep 07, 2011 1:12 pm    Post subject: Reply with quote

An 8 GB swap is quite big. In general: the more RAM you have, the less likely the kernel needs swap to be used. Right now, the machines I've build have 16GB RAM, on a harddrive of just 30 GB any swap larger then 4 GB is a waste of space. In fact, using SSD's for the system make swap effectively unnecessary as these are so quick it'll have minimal impact on performance.
Back to top
View user's profile Send private message
Narendra
LXF regular


Joined: Wed Mar 14, 2007 4:32 pm
Posts: 317
Location: East Midlands, UK.

PostPosted: Wed Sep 07, 2011 2:34 pm    Post subject: Reply with quote

Thank you very much for your replies.

i tried deleted the swap partition but then the computer won't boot up, showed grub error!
I had backed up Home Folder, the Thunderbird and the Firefox. And I do not now how to fix up the Grub Error, So I reinstalled Ubuntu, without the swap partion. I already have 4 Gb of DDR3 Ram.
_________________
Narendra
Back to top
View user's profile Send private message
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1661
Location: Guisborough

PostPosted: Wed Sep 07, 2011 3:27 pm    Post subject: Reply with quote

DM, with only a quarter of the swap to actual memory, are you able to suspend / hibernate your system?
_________________

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
Back to top
View user's profile Send private message MSN Messenger
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2423

PostPosted: Wed Sep 07, 2011 4:21 pm    Post subject: Reply with quote

@RAM: I don't suspend nor hibernate any of my systems, so... Wink

However, theoretically it should be possible, as long as you close all running applications so it's only the kernel that needs room for its suspended state. In light of the above, it'll be no surprise that I haven't tried it myself Razz
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8369
Location: Warrington, UK

PostPosted: Wed Sep 07, 2011 6:25 pm    Post subject: Reply with quote

The full contents of active memory are saved, compressed if you want, but you can suspend to a file so a large swap is unnecessary.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
Rhakios
Moderator


Joined: Thu Apr 07, 2005 12:18 am
Posts: 7604
Location: Midlands, UK

PostPosted: Thu Sep 08, 2011 1:15 pm    Post subject: Reply with quote

nelz wrote:
The full contents of active memory are saved, compressed if you want, but you can suspend to a file so a large swap is unnecessary.

Is that the subject for a future tutorial, nelz, suspend to a file?
_________________
Bye, Rhakios
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8369
Location: Warrington, UK

PostPosted: Thu Sep 08, 2011 2:43 pm    Post subject: Reply with quote

If you're using TuxonIce to suspend, it's a matter of changing one line in the config file. That would make for a rather short tutorial.

If you're not using TuxOnIce, you deserve what you get Smile
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
Rhakios
Moderator


Joined: Thu Apr 07, 2005 12:18 am
Posts: 7604
Location: Midlands, UK

PostPosted: Thu Sep 08, 2011 2:56 pm    Post subject: Reply with quote

nelz wrote:
If you're using TuxonIce to suspend, it's a matter of changing one line in the config file. That would make for a rather short tutorial.

If you're not using TuxOnIce, you deserve what you get Smile

Until you mentioned it I'd never heard of it, but then I only use suspend, which works well enough on my netbook.
_________________
Bye, Rhakios
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8369
Location: Warrington, UK

PostPosted: Thu Sep 08, 2011 3:00 pm    Post subject: Reply with quote

It's an enhanced suspend that adds extra options, like suspending to a disk file, aborting a suspend and a couple of other goodies. I've used it for so long, I'd forgotten about the standard offering being more limited.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
pastychomper



Joined: Wed Apr 07, 2010 11:54 am
Posts: 52

PostPosted: Thu Sep 08, 2011 3:35 pm    Post subject: Reply with quote

Impressive. I'm assured swap files have been as fast as swap partitions for some time, so if TuxonIce is as good as it sounds then presumably there's no longer a need to have a swap partition at all.

I suppose having a dedicated partition means you can keep the swap on the fastest edge of the disc, so maybe it's still worthwhile - but would that be offset by the drive heads having to travel further from the filesystem partition(s) to do a read?
Back to top
View user's profile Send private message
nordle
LXF regular


Joined: Fri Apr 08, 2005 10:56 pm
Posts: 1500

PostPosted: Thu Sep 08, 2011 11:01 pm    Post subject: Reply with quote

Can't be arsed to fact check.
But does Suspend not go to RAM (assuming STR in bios), so swap is not essential anyway?
Hibernate may require disk space, but STR does not.

I've got 2GB RAM and 512MB swap. Never had a problem suspending PC. Longest I think was 30 something days with a daily suspend, then kernel update forced actual reboot.
_________________
I think, therefore I compile
Back to top
View user's profile Send private message
Nuke
LXF regular


Joined: Wed Feb 09, 2011 12:11 pm
Posts: 217
Location: Chepstow, UK

PostPosted: Wed Sep 14, 2011 1:58 pm    Post subject: Two Topics Here? Reply with quote

pastychomper wrote:
.. swap files have been as fast as swap partitions for some time, so if TuxonIce is .. good .. there's no longer a need to have a swap partition at all.

I suppose having a dedicated partition means you can keep the swap on the fastest edge of the disc, .. - but would that be offset by the drive heads having to travel further from the filesystem partition(s) to do a read?


It looks like two issues have got mixed in this thread : (1) Need for a swap partition, and (2) Suspending the OS. I never knew that suspending used the swap space - can someone confirm that? I thought the RAM power was maintained while all other power consuming stuff was switched off.

However Suspend works, I understand that you should always have a swap partion as some software (probably older stuff) is written to use it, even if there is plenty of memory. You should not need much though, mine's only 500 Mb.

As for having the swap as a file, not in a partition, what's the point again? I can see swap file (as opposed to a partition) getting fragmented all over the place mixed in with data files. Hardly efficient. Windows does that (from NT/XP) : ever looked at the frag map of a Windows HDD?

Anyway, as this thread has said, the swap is little used these days so a few less nanoseconds don't matter. But have you thought of trying to recover data from a corrupted disk? With valuable data mixed in with bits of swap (and therefore similar stuff appearing many times over) your disk is going to be a real mess to sort out!

I have always had two or more HDDs in my builds (four once). When I put in a bigger HDD I keep the previous one and put two partitions (at least) on it, one for the swap and the other for a first level backup. So effectively the disc is dedicated to swapping.
Back to top
View user's profile Send private message
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1661
Location: Guisborough

PostPosted: Wed Sep 14, 2011 5:27 pm    Post subject: Reply with quote

If suspend suspends to ram (power still consumed) where is hibernate stored no power used.
_________________

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
Back to top
View user's profile Send private message MSN Messenger
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast