| View previous topic :: View next topic |
| Author |
Message |
Narendra LXF regular
Joined: Wed Mar 14, 2007 4:32 pm Posts: 246 Location: East Midlands, UK.
|
Posted: Wed Sep 07, 2011 9:48 am Post subject: What is swap partition? |
|
|
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 |
|
 |
RedWillow LXF regular
Joined: Thu May 29, 2008 2:05 pm Posts: 716
|
Posted: Wed Sep 07, 2011 10:13 am Post subject: |
|
|
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 |
|
 |
Dutch_Master LXF regular
Joined: Tue Mar 27, 2007 2:49 am Posts: 2354
|
Posted: Wed Sep 07, 2011 1:12 pm Post subject: |
|
|
| 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 |
|
 |
Narendra LXF regular
Joined: Wed Mar 14, 2007 4:32 pm Posts: 246 Location: East Midlands, UK.
|
Posted: Wed Sep 07, 2011 2:34 pm Post subject: |
|
|
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 |
|
 |
Ram LXF regular

Joined: Thu Apr 07, 2005 10:44 pm Posts: 1551 Location: Guisborough
|
Posted: Wed Sep 07, 2011 3:27 pm Post subject: |
|
|
DM, with only a quarter of the swap to actual memory, are you able to suspend / hibernate your system? _________________
Ubuntu LXDE 12.04 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
|
|
| Back to top |
|
 |
Dutch_Master LXF regular
Joined: Tue Mar 27, 2007 2:49 am Posts: 2354
|
Posted: Wed Sep 07, 2011 4:21 pm Post subject: |
|
|
@RAM: I don't suspend nor hibernate any of my systems, so...
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  |
|
| Back to top |
|
 |
nelz Moderator

Joined: Mon Apr 04, 2005 12:52 pm Posts: 8002 Location: Warrington, UK
|
Posted: Wed Sep 07, 2011 6:25 pm Post subject: |
|
|
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. _________________ Unix is user-friendly. It's just very selective about who it's friends are. |
|
| Back to top |
|
 |
Rhakios Moderator

Joined: Thu Apr 07, 2005 12:18 am Posts: 7473 Location: Midlands, UK
|
Posted: Thu Sep 08, 2011 1:15 pm Post subject: |
|
|
| 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 |
|
 |
nelz Moderator

Joined: Mon Apr 04, 2005 12:52 pm Posts: 8002 Location: Warrington, UK
|
Posted: Thu Sep 08, 2011 2:43 pm Post subject: |
|
|
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  _________________ Unix is user-friendly. It's just very selective about who it's friends are. |
|
| Back to top |
|
 |
Rhakios Moderator

Joined: Thu Apr 07, 2005 12:18 am Posts: 7473 Location: Midlands, UK
|
Posted: Thu Sep 08, 2011 2:56 pm Post subject: |
|
|
| 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  |
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 |
|
 |
nelz Moderator

Joined: Mon Apr 04, 2005 12:52 pm Posts: 8002 Location: Warrington, UK
|
Posted: Thu Sep 08, 2011 3:00 pm Post subject: |
|
|
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. _________________ Unix is user-friendly. It's just very selective about who it's friends are. |
|
| Back to top |
|
 |
pastychomper
Joined: Wed Apr 07, 2010 11:54 am Posts: 36
|
Posted: Thu Sep 08, 2011 3:35 pm Post subject: |
|
|
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 |
|
 |
nordle LXF regular

Joined: Fri Apr 08, 2005 10:56 pm Posts: 1497
|
Posted: Thu Sep 08, 2011 11:01 pm Post subject: |
|
|
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 |
|
 |
Nuke LXF regular

Joined: Wed Feb 09, 2011 12:11 pm Posts: 134 Location: Chepstow, UK
|
Posted: Wed Sep 14, 2011 1:58 pm Post subject: Two Topics Here? |
|
|
| 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 |
|
 |
Ram LXF regular

Joined: Thu Apr 07, 2005 10:44 pm Posts: 1551 Location: Guisborough
|
Posted: Wed Sep 14, 2011 5:27 pm Post subject: |
|
|
If suspend suspends to ram (power still consumed) where is hibernate stored no power used. _________________
Ubuntu LXDE 12.04 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
|
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|