LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 09:28 PM   #1
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali
Posts: 581

Rep: Reputation: 37
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, 09:37 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

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

Would help to know what you created, and how.


Cheers,
Tink
 
Old 10-13-2009, 09:41 PM   #3
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali
Posts: 581

Original Poster
Rep: Reputation: 37
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, 10:01 PM   #4
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,330

Rep: Reputation: 227Reputation: 227Reputation: 227
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, 10:11 PM   #5
bryanl
Member
 
Registered: Dec 2003
Posts: 96

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, 10:17 PM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
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 09:17 AM. Reason: typo
 
Old 10-13-2009, 10:27 PM   #7
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali
Posts: 581

Original Poster
Rep: Reputation: 37
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, 10:37 PM   #8
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,330

Rep: Reputation: 227Reputation: 227Reputation: 227
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, 10:46 PM   #9
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali
Posts: 581

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

Rep: Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285
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, 03:44 PM   #11
bryanl
Member
 
Registered: Dec 2003
Posts: 96

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, 03:49 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 05:19 PM   #13
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
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, 05:34 PM   #14
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,053

Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
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, 07:57 PM   #15
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:05 AM
swap file or swap space? simonb1975uk Linux - General 11 08-15-2008 03:39 PM
swap space (or) swap file yusufs Linux - Newbie 8 07-17-2008 03:02 AM
how much swap space is needed; how to increase swap space? johnpaulodonnell Linux - Newbie 5 03-23-2007 04:20 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 02:23 AM


All times are GMT -5. The time now is 05:10 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration