LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 10-25-2010, 02:50 PM   #1
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Rep: Reputation: 60
Ubuntu 10.10 recreating swap file after install of USBSTICK


I made a mistake and during the setup created a seperate swap partition and noticed that using this on a usbstick hindered performance. So I want to simply add the swap to the same partition as root and the others. I used this ubuntu help file. Will this suffice:


https://help.ubuntu.com/community/SwapFaq

Last edited by metallica1973; 10-25-2010 at 02:52 PM.
 
Old 10-25-2010, 02:59 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Did you install your Ubuntu to a USB-stick? I can not see that clearly from your post. If you installed it to the USB-stick there should be no performance loss, only because you made a swap partition and not a swap file. Generally I don't think that all of the recommendations in the mentioned article make sense. Why should someone use more swapspace on a computer with more RAM, except for hibernation? And why should I use more swapspace on the same harddisk size only because I have more RAM. Maybe I don't see the point here. then please correct me.
 
Old 10-25-2010, 03:18 PM   #3
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
there is a delay when opening up web browsers and basically multi-tasking. I am trying to figure out why it is sluggish. I am using a new laptop with usb 2.0. I have installed Ubuntu 10.10. multiple time on this memory stick and cannot figure out what it is. I have stipped it down and prevented the services. Help.
 
Old 10-25-2010, 03:35 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Did you check with the free command, if you actually use swap? How much RAM do you have? Maybe your memory-stick is not very fast?
 
Old 10-25-2010, 03:46 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
That article seems to cover things - easy enough to test, easy enough to undo again if/when nothing changes.

Maybe try latencytop.
 
Old 10-25-2010, 05:57 PM   #6
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
the article worked but I am still trying to figure out the intermittent lag between programs. I have installed 3 different installs including Lubuntu 10.10, Ubuntu 9.04 and now Ubuntu 10.10 and all three have the same issue. Any suggestions?
 
Old 10-25-2010, 06:10 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Use the free command to see if it is a swap issue. Make a benchmark of your memory-stick using the command sudo hdparm -tT /dev/sdX with X replaced by the letter of your memory-stick.
Is the lag only at the first start of your program? How much RAM do you have?
 
Old 10-25-2010, 07:08 PM   #8
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
is it a persistent usb install with a casper-rw persistent file?
if yes then thats why
nothing you can really do about that except

if usb-creator made a casper-rw file on fat32 usb
then instead create a 2nd partition on usb, ext3, labeled "casper-rw"
delete the old casper-rw file also
this will only speed it up a bit
you culd also probably edit the persistent /etc/fstab and make sure it mounts the casper-rw partition with noatime
 
Old 10-26-2010, 05:54 AM   #9
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
I did a straight install and used EXT4. It is an 8 Gig stick. I used a 512MG swap file. There isnt a casper-rw. The lag is happening about every 10 seconds. I can only move the mouse. I have disable most of the unnecessary services from starting up like NIS, Bluetooth Garbage and others. The system has 4 GIG of memory and I have tried using this stick on several systems with the same issue. Could the stick be bad or do usbsticks have a history of performance issues?

P.S

Linus72
Growing up I listened to a lot of Christian Metal, have you heard the group Stryper. They are one of my favorites.

Last edited by metallica1973; 10-26-2010 at 06:01 AM.
 
Old 10-26-2010, 08:29 AM   #10
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
Here are the results of free and sudo hdparm -tT /dev/sdb1

PHP Code:
Fidel@Castro:~$ free
             total       used       free     shared    buffers     cached
Mem
:       3977924     409232    3568692          0      32476     179516
-/+ buffers/cache:     197240    3780684
Swap
:       524284          0     524284
Fidel
@Castro:~$ sudo hdparm -tT /dev/sdb1
[sudopassword for Fidel
/
dev/sdb1:
 
Timing cached reads:   6104 MB in  2.00 seconds 3053.59 MB/sec
 Timing buffered disk reads
:   48 MB in  3.05 seconds =  15.72 MB/sec 
The only difference that I can see from the other installs are that they are persistent as opposed to an install or that is could be a bad stick. This lag shouldn't be present.

Last edited by metallica1973; 10-26-2010 at 09:07 AM.
 
Old 10-26-2010, 09:40 AM   #11
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
15 MB/s is a average rate, but this shouldn't be the cause for a lag. You wrote that you have the lag every 10 seconds, so I would assume that one of your applications or the system itself is making a write operation every 10 seconds, because write operations are slower with most flash disks. Maybe this slows your system down. I would try to get your /tmp, /var/cache and similar folders to a RAM disk and look if this will solve your issues.
With 4 GB of RAM you shouldn't need a swap partition/folder.
 
Old 10-26-2010, 10:00 AM   #12
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
ramdisk, would that be what the live cdrom uses. If that is the case I willing to bet that is the issue. My other usbstick are using persistent files and there are not any issues with them. How can I see if there are using "RAMDISK"

Many thanks.

P.S

http://www.vanemery.com/Linux/Ramdisk/ramdisk.html

and add that to /etc/grub.conf. When I tried to install Ubuntu 10.10 it complained about not having a swap area or partition. So I just went through with the install and added a swap area. So what I intend on doing it deleting the swap partition if there is one and adding a RAMDISK to /tmp and seeing what that does. I would like to add the additional space to root. Maybe I use gparted or something.

Would that suffice?

Last edited by metallica1973; 10-26-2010 at 10:28 AM.
 
Old 10-26-2010, 10:01 AM   #13
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
here's nFluxOS Ubuntu installed to usb using usb-creator in read-only livecd mode
Code:
[root@ubuntu ubuntu]# free
             total       used       free     shared    buffers     cached
Mem:        766880     525004     241876          0      70316     284044
-/+ buffers/cache:     170644     596236
Swap:      2273160          0    2273160
[root@ubuntu ubuntu]# sudo hdparm -tT /dev/sda1

/dev/sda1:
 Timing cached reads:   572 MB in  2.00 seconds = 285.29 MB/sec
 Timing buffered disk reads:   38 MB in  3.02 seconds =  12.60 MB/sec
try using the noatime in /etc/fstab
Quote:
The use of noatime, nodiratime or relatime can help disk performance for ext2, ext3, and ext4 filesystems. Linux by default keeps a record (writes to the disk) every times it reads from the disk. This was more purposeful when Linux was being used for servers and doesn't have much use for desktop use. This works good for almost all applications but Mutt that needs this information. For mutt, you should only use the relatime option.
http://wiki.archlinux.org/index.php/Fstab

/dev/sda1 / ext4 defaults,noatime 0 1
 
Old 10-26-2010, 10:27 AM   #14
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
@Metallica1972:
I think you misunderstood me, I meant to put your whole /tmp and the other directories into a ramdisk, not create a ramdisk into your /tmp.
For example, add to your /etc/fstab (not /etc/inittab, this file has a complete other purpose) this entry:
Code:
tmpfs  /tmp  tmpfs rw  0 0
Then reboot and look if your system is laggy, if it is try one of the other directories, like /var/cache or ~/.cache
 
Old 10-26-2010, 10:45 AM   #15
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
I tried the noatime option and it does the same thing, lag. I will try moving all the !!#!!#$ into /tmp. Here is my /etc/fstab

PHP Code:
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sdb5 during installation

UUID=164461c1-73d8-447a-b252-975620358fea /               ext4    errors=remount-ro 0       1
/dev/sdb1       none            swap    sw              0       0 
It has to be the RAMDISK!!!! Let me investigate many thanks to all I will get back to you on this issue.

Last edited by metallica1973; 10-26-2010 at 12:49 PM.
 
  


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
Having trouble partitioning IDE HD for swap file to install v13.0 64bit mothergoose729 Slackware 2 11-20-2009 08:14 AM
Ubuntu Server Won't Use Swap File xXCanisLupusXx Linux - Newbie 6 02-16-2009 10:20 AM
Assign existing Ubuntu swap for FC8 install? buccaneere Linux - Software 5 02-11-2009 01:08 AM
Fast Question: SWAP-file in Ubuntu disabled by default? Waerner Ubuntu 2 07-14-2005 09:57 AM
Swap file install theapodan Slackware 15 06-04-2002 12:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 01:23 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