LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-13-2009, 08:28 PM   #1
ceantuco
Member
 
Registered: Mar 2008
Location: New York
Distribution: Debian
Posts: 809

Rep: Reputation: 88
Question how to tell Ubuntu to use swap space?


Hello,

a friend of mine recently installed Ubuntu in his Laptop however is running really slow. It's Dell 1520 so I don't think the computer is that slow. I think what the problem is that he doesn't have a swap space. ok, I could use GPARTED to resize the HD and create SWAP space but how can I tell the system to permanently use that space?
Thanks any help is greatly appreciate it.
 
Old 10-13-2009, 08:37 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Add an appropriate line to /etc/fstab

Would help to know what you created, and how.


Cheers,
Tink
 
Old 10-13-2009, 08:41 PM   #3
ceantuco
Member
 
Registered: Mar 2008
Location: New York
Distribution: Debian
Posts: 809

Original Poster
Rep: Reputation: 88
Tinkster, thanks for your quick response. I haven't created anything yet. I figured I could use GPARTED to create a swap partition (I think it has the option to format it or label it as swap) correct me if I'm wrong... OK I will create the line to fstab.
Thanks!
 
Old 10-13-2009, 09:01 PM   #4
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
its probably best to make it about the same size as the ram
the old rule of the ram * 2 is outdated since 512 mb rams came about
 
Old 10-13-2009, 09:11 PM   #5
bryanl
Member
 
Registered: Dec 2003
Posts: 97

Rep: Reputation: 35
see Move to swapfile rather than swap partition and the article it references at Techie Buzz. The utilities are mkswap and swapon (see man pages).
 
Old 10-13-2009, 09:17 PM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by ceantuco View Post
a friend of mine recently installed Ubuntu in his Laptop however is running really slow. It's Dell 1520 so I don't think the computer is that slow. I think what the problem is that he doesn't have a swap space.
I don't think that is a correct diagnosis.

If you are correct that there is zero swap space, that is probably worth fixing, but once that is fixed, you'll probably still be trying to diagnose what is making the laptop slow.

Quote:
I could use GPARTED to resize the HD and create SWAP space but how can I tell the system to permanently use that space?
First make sure the system doesn't already have swap space. Then make sure the HD doesn't already have a swap partition that isn't being used because it wasn't formatted as swap space or it wasn't put in /etc/fstab. If there really is no swap partition, then you might consider fixing the partitioning.

Some stats on the system and some idea about what was measured or experienced to get the idea it is slow, might help us tell you what to check to correctly diagnose why it is slow.

Last edited by johnsfine; 10-14-2009 at 08:17 AM. Reason: typo
 
Old 10-13-2009, 09:27 PM   #7
ceantuco
Member
 
Registered: Mar 2008
Location: New York
Distribution: Debian
Posts: 809

Original Poster
Rep: Reputation: 88
thank you guys for all your posts! yes, def tomorrow I will go to my friends house and take a look at it. I asked him to give me his IP so I could connect and take a look at it but he refused (I wonder why) lol I will post the results tomorrow.
Thanks!
 
Old 10-13-2009, 09:37 PM   #8
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by ceantuco View Post
thank you guys for all your posts! yes, def tomorrow I will go to my friends house and take a look at it. I asked him to give me his IP so I could connect and take a look at it but he refused (I wonder why) lol I will post the results tomorrow.
Thanks!
A:how could you connect with an ip
B:he probably has a dynamic ip anyway
 
Old 10-13-2009, 09:46 PM   #9
ceantuco
Member
 
Registered: Mar 2008
Location: New York
Distribution: Debian
Posts: 809

Original Poster
Rep: Reputation: 88
A: Remote Desktop
B: www.whatismyip.com (usually IP leases are for 24 hours or more)
 
Old 10-14-2009, 02:07 PM   #10
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
A also recommend using a simple swap file instead of a swap partition:
http://tldp.org/HOWTO/Partition/setting_up_swap.html
 
Old 10-14-2009, 02:44 PM   #11
bryanl
Member
 
Registered: Dec 2003
Posts: 97

Rep: Reputation: 35
Quote:
If you are correct that there is zero swap space, that is probably worth fixing, but once that is fixed, you'll probably still be trying to diagnose what is making the laptop slow.
This is a good point. With a diagnosis offered, we get so focused on implementation we often forget the original symptoms. Unless the system is severely memory constrained, it is likely that swap isn't the issue for slowdowns.

Speeding up a laptop gets into a lot of interesting issues from power management to disk allocations to cache to video to driver quality to system trimming and runtime optimizing and then to habits and behavior.
 
Old 10-14-2009, 02:49 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by H_TeXMeX_H View Post
A also recommend using a simple swap file instead of a swap partition:
http://tldp.org/HOWTO/Partition/setting_up_swap.html
Unless you're trying to remedy an instant need using
files is less efficient (and effective, for that matter)
than a swap partition. You get swaps built in mechanics
on top of the file-system => slower than a partition.



Cheers,
Tink
 
Old 10-14-2009, 04:19 PM   #13
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Nowadays (and for a long time now) it really doesn't matter much. The only thing you should really do -if you are really going to use a file instead of a partition- is to create the file when the fs is young and non-fragmented, to avoid any penalty due to fragmentation.

When using a swap file the kernel bypasses the fs layer. The kernel directly maps the offsets. But probably Morton can explain it better than I do.

http://lkml.org/lkml/2005/7/7/326
 
Old 10-14-2009, 04:34 PM   #14
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by i92guboj View Post

When using a swap file the kernel bypasses the fs layer. The kernel directly maps the offsets. But probably Morton can explain it better than I do.

http://lkml.org/lkml/2005/7/7/326
Thanks for that; I knew that was the advice from Andrew Morton, but hadn't seen the detail behind it. Interesting.

BTW, back on the original topic

Quote:
I don't think that is a correct diagnosis.

If you are correct that there is zero swap space, that is probably worth fixing, but once that is fixed, you'll probably still be trying to diagnose what is making the laptop slow
.

Agree with that completely (and its more or less what I was about to write after having read the first post in the thread). It will be worth looking for the obvious stuff (is the disk light on all the time?) and using, eg, top/atop/htop/vmstat to see if anything jumps out as being wrong.

Also, what sort of slow is it? If it is just networking that is slow, you probably have a networking problem (at times like this, stating the painfully obvious can actually be helpful )
 
Old 10-14-2009, 06:57 PM   #15
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by johnsfine View Post
some idea about what was measured or experienced to get the idea it is slow, might help us tell you what to check to correctly diagnose why it is slow.
Quote:
Originally Posted by salasi View Post
Also, what sort of slow is it?
I'm glad to see you agree with that part of my post as well
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to reduce swap space and reclaim the space grantm Linux - Newbie 7 08-16-2012 07:05 AM
swap file or swap space? simonb1975uk Linux - General 11 08-15-2008 02:39 PM
swap space (or) swap file yusufs Linux - Newbie 8 07-17-2008 02:02 AM
how much swap space is needed; how to increase swap space? johnpaulodonnell Linux - Newbie 5 03-23-2007 03:20 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration