Author Topic: LXDE - Is swap space needed?  (Read 1617 times)

Offline --Ed--

  • Jr. Member
  • **
  • Posts: 12
    • The Best Linux Distribution
LXDE - Is swap space needed?
« on: September 27, 2010, 06:54:13 AM »
I have installed the latest LXDE version on my Asus 701 4G surf. I finally got rid of the stock Xandros. It has a 4G SSD and 2G ram. When installing I let the installer determine the partitioning. Checking the SSD I see that 3.2G are for "/" and 439M for the swap.  I am thinking of re-installing and setting limits to the (at least I think it's the) "/" size to 2.5G and the rest for /usr and using ram for swap space. So the question is: is it possible to set up the system so that ram can be used for swap instead of the HD or in this case the SSD?

uncleV

  • Guest
Re: LXDE - Is swap space needed?
« Reply #1 on: September 27, 2010, 06:59:18 AM »
Some more info from old-polack:
http://www.pclinuxos.com/forum/index.php/topic,69910.0.html

Also Search the forum on "swap" in topics.

Offline pags

  • Hero Member
  • *****
  • Posts: 2606
  • Keep it clean.
Re: LXDE - Is swap space needed?
« Reply #2 on: September 27, 2010, 07:14:10 AM »
I would hesitate from having SWAP on an SSD because of wear on the drive...depending on how you use the machine (it is a netbook), that shouldn't be a problem...

Why do you want to separate / and /usr?  One single partition may be more flexible (being only 4Gb in total, you'll want to be judicious in the use of space, and keep it fairly clean).

You should also research setting up fstab, and consider additional options such as noatime, which can further reduce the number of writes occurring to the drive...

My wife also has a 701, but with only 1Gb of RAM...I would like to setup KDE on it (with the netbook interface), but the drive is too small.  I've run it from a 20Gb USB HDD, and it performs OK (with swap)...so I was going to try it on a 16GB SD card (but I don't have one, yet).

Let us know how this works out for you  :)

Offline melodie

  • Hero Member
  • *****
  • Posts: 5946
  • Internet Relay Chat sur Freenode
    • PCLinuxOS Fr
Re: LXDE - Is swap space needed?
« Reply #3 on: September 27, 2010, 07:14:52 AM »
The module ramzswap is available in the latest kernels:

Quote
# grep SWAP config-2.6.33.7-pclos4.bfs
CONFIG_SWAP=y
CONFIG_X86_BSWAP=y
CONFIG_RAMZSWAP=m
CONFIG_RAMZSWAP_STATS=y
CONFIG_RING_BUFFER_ALLOW_SWAP=y


Therefore if you have one of the latest kernels, you can load the module at boot (in /etc/modprobe.preload I think).

What is ramzswap ? It's provided by the compcache program:
http://code.google.com/p/compcache/

Do you think this answers your question ?


melodie at #lpic-fr on irc.freenode.net

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12662
Re: LXDE - Is swap space needed?
« Reply #4 on: September 27, 2010, 07:45:14 AM »
The installer and boot scripts expect to find a swap partition so to be safe I would create one even if it was a tiny one like 128mb.

Thanks to everyone who donates. You keep the servers running.
Follow me on Twitter for the latest development info.

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6475
  • I'm going South
Re: LXDE - Is swap space needed?
« Reply #5 on: September 27, 2010, 07:51:13 AM »
Having swap in RAM is usually counterproductive. swap is used  when you run out of RAM; if you move it to RAM you'll run out of RAM that much faster.

Also, even if having /usr on a partition of its own used to make sense on some systems it doesn't really on a PCLinuxOS system. It meant that you could reinstall your base system without touching your installed programs (and it sometimes meant that you could have /usr on a read-only filesystem).

But in PCLinuxOS reinstalling will overwrite /usr anyway. And as most of what you install or upgrade goes into /usr, having it on a separate partition is simply not economical use of your disk space.
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline --Ed--

  • Jr. Member
  • **
  • Posts: 12
    • The Best Linux Distribution
Re: LXDE - Is swap space needed?
« Reply #6 on: September 27, 2010, 08:32:06 AM »
Thanks for all of the replies.  While waiting I did some reading and created a swap file and added a line to fstab to enable the file. After rebooting and running free -m it looked like the swap space had doubled to 1 gig. At this point I changed the size of the / partition to 2.5G and created a /home partition of the rest of the SSD. A reboot at this point revealed something wrong. It hangs at  [<c038eef0>] syscall_call+0x7/0xb.

I will reinstall and select the partitions at the installer level this time.

Pads, this is a big reason why I am hoping to use ram for swap instead of the SSD. It is a netbook and came with 512M of ram which I upgraded to 2G. Since I am not an intense heavy user (no big games or apps) I don't believe that I would run into RAM limitations. So by using ram I would be extending the life of the SSD.

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
Re: LXDE - Is swap space needed?
« Reply #7 on: September 27, 2010, 08:42:40 AM »
--Ed--,
As Texstar said, you can create a small swap.
Quote from: Texstar
The installer and boot scripts expect to find a swap partition so to be safe I would create one even if it was a tiny one like 128mb.

If I were installing on that netbook, I'd set up a 128mb swap and use the rest for /. On so small a drive, this would be the more efficient partitioning scheme.

vjeko

  • Guest
Re: LXDE - Is swap space needed?
« Reply #8 on: September 27, 2010, 08:49:01 AM »
netbook in question having ssd wear and intended light use pointed out, i see no use of swap but to hibernate.

you could have 2gb mem card inserted and allocated as swap space (it has to be a minimum the size of amount of max ram you have at your disposal)
« Last Edit: September 27, 2010, 08:51:59 AM by V »

Offline pags

  • Hero Member
  • *****
  • Posts: 2606
  • Keep it clean.
Re: LXDE - Is swap space needed?
« Reply #9 on: September 27, 2010, 09:22:48 AM »
Even these machines as originally shipped had no swap (and only 512 Mb RAM), and the ran "OK".  With 2 Gb and no swap, they should be fine!

I would suggest one, single 4Gb / partition, no swap, no swap file, and go from there (try booting a LiveUSB with no swap, first, to get a feeling for performance  ;)).

...
hmmm
The installer and boot scripts expect to find a swap partition so to be safe I would create one even if it was a tiny one like 128mb.

OK...maybe a tiny 128Mb swap after the /, which can be deleted after install (or, at the very least, disabled to reduce wear)...

Offline --Ed--

  • Jr. Member
  • **
  • Posts: 12
    • The Best Linux Distribution
Re: LXDE - Is swap space needed?
« Reply #10 on: September 29, 2010, 09:03:03 AM »
 Just thought I'd update how things stand. I reloaded LXDE and formated the SSD with two partitions. the / partition has all of the SSD except 128M which I gave to swap.  After installation I deleted the swap partition. Everything seems to be operating okay and I haven't noticed any drop in performance. Granted, all I have done is some browsing, but then that is what I'll be spending 90% of the time doing on this PC.

Thanks everyone.


vjeko

  • Guest
Re: LXDE - Is swap space needed?
« Reply #11 on: September 29, 2010, 10:58:56 AM »
ive never had a regular working rig with swap so far, and had no problems, neither with the setup nor operation, regardless of the distro in question

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1517
  • In theory, theory=practice, in practice ???
Re: LXDE - Is swap space needed?
« Reply #12 on: September 29, 2010, 06:31:44 PM »
I have installed the latest LXDE version on my Asus 701 4G surf. I finally got rid of the stock Xandros. It has a 4G SSD and 2G ram. When installing I let the installer determine the partitioning. Checking the SSD I see that 3.2G are for "/" and 439M for the swap.  I am thinking of re-installing and setting limits to the (at least I think it's the) "/" size to 2.5G and the rest for /usr and using ram for swap space. So the question is: is it possible to set up the system so that ram can be used for swap instead of the HD or in this case the SSD?


Have Mercy,

I have an Asus900 w/ 16gb SSD and 1 gb RAM.  With 2 gb RAM you should need 0 swap.
Unless you're writing graphics I'm not accustomed to.  Most of those old machines came with 512mb RAM.  Just install custom partitioning with no swap then.  The old Asus's have small and slow SSD's tied into the motherboard speed.  My PCLinux is on a 16gb flash then, not too shabby, and my 1gb RAM has never needed swap.  I install everything on one xfs partition.  New SSD's are faster somehow, but cost more than the whole original PC.  LXDE or possibly Xfce are good choices but your SSD is small and slow (so is mine).  Your setup on a $30 Kingston 16gb flash from buy.com is was most ASUS'ers I think would recommend.  Perhaps use the fixed 4gb SSD for backup and a 16gb USB flash for everyday use.  Tho not a Panasonic Toughbook the ASUS for PCLinux with that setup is great.  More than your question asked for and I know this machine.  Any questions route them right thru.  Should work super.   What's the processor speed on that wonderful machine ?


Respects,

Patrick013
ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3892
Re: LXDE - Is swap space needed?
« Reply #13 on: September 29, 2010, 07:11:17 PM »
The installer and boot scripts expect to find a swap partition so to be safe I would create one even if it was a tiny one like 128mb.

Is it possible to trick or modify these scripts to use a swap file? I created a swap partition on a thumb drive to get openbox mini installed on a low memory machine. It would have been much easier to create and a delete a swap file on the thumb drive, if it would work.

Galen

Offline melodie

  • Hero Member
  • *****
  • Posts: 5946
  • Internet Relay Chat sur Freenode
    • PCLinuxOS Fr
Re: LXDE - Is swap space needed?
« Reply #14 on: September 30, 2010, 12:24:43 AM »
The installer and boot scripts expect to find a swap partition so to be safe I would create one even if it was a tiny one like 128mb.

Is it possible to trick or modify these scripts to use a swap file? I created a swap partition on a thumb drive to get openbox mini installed on a low memory machine. It would have been much easier to create and a delete a swap file on the thumb drive, if it would work.

Galen

I never thought about creating a swap partition to a thumb drive. How low in memory is the machine you installed to ?

melodie at #lpic-fr on irc.freenode.net