LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Ubuntu 10.10 recreating swap file after install of USBSTICK (https://www.linuxquestions.org/questions/ubuntu-63/ubuntu-10-10-recreating-swap-file-after-install-of-usbstick-840384/)

metallica1973 10-25-2010 02:50 PM

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

TobiSGD 10-25-2010 02:59 PM

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.

metallica1973 10-25-2010 03:18 PM

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.

TobiSGD 10-25-2010 03:35 PM

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?

syg00 10-25-2010 03:46 PM

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

Maybe try latencytop.

metallica1973 10-25-2010 05:57 PM

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?

TobiSGD 10-25-2010 06:10 PM

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?

linus72 10-25-2010 07:08 PM

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

metallica1973 10-26-2010 05:54 AM

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.

metallica1973 10-26-2010 08:29 AM

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.

TobiSGD 10-26-2010 09:40 AM

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.

metallica1973 10-26-2010 10:00 AM

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?

linus72 10-26-2010 10:01 AM

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

TobiSGD 10-26-2010 10:27 AM

@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

metallica1973 10-26-2010 10:45 AM

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.


All times are GMT -5. The time now is 03:57 AM.