[buug] Using swap on an SSD...or not.

Rick Moen rick at linuxmafia.com
Wed Sep 30 16:52:33 PDT 2009


Quoting Zeke Krahlin (pewterbot9 at gmail.com):

> Not an option in my situation. It is *not* easier to upgrade ram on my
> Asus EeePC 701SD netbook.  

You would seem qualified to say so, since you have such a machine in
front of you and I don't think I've even seen one.  

However, FWIW, this other gentleman claims to _also_ have a 701SD, and
his view seems to contradict yours:

    i have a 701sd, i put my 1gb ram stick from my dell 1737 laptop into
    my 701sd and it works fine.  [...]

http://forum.eeeuser.com/viewtopic.php?id=57841

Whatever.  I don't care.  I'd just be a bit astonished if upgrading RAM
on most netbooks is somehow fearfully difficult, though I'm sure there 
are exceptions, e.g., cheapo units where RAM is soldered in and there
are no accessible slots.


> Nor do I care to, nor see any need to.

Now, _that_ is a different matter.  Obviously, when I was outlining your
alternatives, I had no present knowledge of either how much RAM you use
or even how much physical RAM you had.  Therefore, all I said was that 
_if_ you were hitting swap, then it's easier to make sure you have
enough RAM to not need swap on flash media.


> If I must resort to swap, so be it.

If I understand correctly, your next step should be to determine the
answer to that question of fact, rather than assume it.


>> No offence intended, but do you know how to do that? }}
> 
> I already know about TOP, and...

You still _do_ know how to correctly interpret what top -- or
pointy-clicky variants thereof that suffer from undetermined reliability
and lack of freedom from dependency issues -- tells you.

Anyway, sure, top is one relevant tool.  The Debian box in front of me 
has this, for example:

Mem:   2074864k total,  1194224k used,   880640k free,   168352k buffers
Swap:  1951888k total,       88k used,  1951800k free,   196864k cached

Point is, swap isn't actually within a country mile of being "used" in 
any real sense, despite that "88k" thing, which really amounts to the
swapper thread tapping gently on the swap partition to ensure that it's
still there.

> I have already noticed that sometimes a small piece of swap being
> used, even when plenty of RAM was still avialable. And yesterday,
> after having removed swap, Firefox wouldn't load, nor would Synaptic
> Package Manager or Update Manager. So I created a swap partition on
> the SDHC card...and will test it out tomorrow.

Well, if you ever get tired of wasting RAM and having to chew up SDHC
cards pointlessly, consider losing the GNOME bloat.

Or, if you don't want to lose the bloat, get some more RAM already.

 
> I assume--and perhaps wrongly--that Linux will automatically find the
> swap partition. 

You'll want to look at your fstab .

$ grep swap /etc/fstab 
/dev/sda2       none            swap    sw              0       0


> (If not, I haven't located any references yet that
> explain how to point the OS to the swap location...my hunch is fstab.)

Hey, it's almost like you bothered to look.  ;->


> I am slowly working towards that...have already eliminated certain
> daemons I know I don't need...such as the one for bluetooth. As I
> learned what each  of these running processes are, I can continue to
> eliminate more...as well as uninstall what applications I don't need.
> Sort of a reverse engineering method.

Here's a general method.

1.  Run "ps auxw > /tmp/processes".
2.  Look at each process snapshotting in /tmp/processes.  For each
    one, consider whether you know why you're running it.  If you're
    not sure, or you know you do _not_ want to run it, figure out
    how to turn it off.
3.  Turn such processes off.  By a functional test, if you don't 
    miss them, then you didn't need them.  This assumes you 
    are aware enough, and curious enough, about the functioning of
    your system that you'll be able to determine that particular
    things might be needed for general machine welfare, even if
    the lack of them doesn't steal your personal lunch, e.g., the
    cron daemon.
4.  If a given process proves by a functional measure to be not
    needed, figure out separately how to disable its re-launching 
    at subsequent boot times.
5.  Iterate until you've gone through all the processes.

Clue:  The more baroque the environment you're running when you conduct
this exercise, the more involved and time-consuming it becomes to track
down what all those obscure processes are.  (Thus, in part, earlier
point about some advantages to losing GNOME bloat.)  You might
eventually decide that an environment that autolaunches a huge number of
obscure processes you have no interest in running is not your friend,
and that there are other ways to run a system.

As a minor example of points #3 and 4, consider those six or so "getty"
processes in the "ps" output.  Upon researching them, you'll find that
they're virtual consoles #1 through 6.  Scratch your head and ask
yourself how often you've needed even as many as two virtual text
consoles.  On recent Ubuntu releases, this would be controlled at boot
time by /etc/event.d/ttyN startup file (N=1 to 6).  See:
http://www.linux.com/archive/feature/125977

On more-traditional *ixes including most Linuxes, they would be lines in
/etc/inittab.


> There is also the matter of turning on more people to Linux.

Really?  I thought this conversation was about your 701SD and dealing
with its possible swap issue.  If this is going to turn into a
discussion about OS-advocacy, let me know so I can ignore the thread.
(Sorry, but OS-advocacy by Linux users remains kinda dumb.
http://www.smh.com.au/articles/2002/12/26/1040511127721.html )


[big snip]

> --end excerpt
> 
> And it goes on.

Me, I'd not have done a text dump on it.  Summary might have been
interesting.




More information about the buug mailing list