# Gentoo on small laptops

## magnet

hello,

I'm installing gentoo on a compaq armada 1592 DT.it's a pentium-mmx 233 with 32 mb of ram and 6.4 gb on the HD.

I want to have maximum performance , doe you guy have some special tips and tricks ? I already found many in the forums or in documentation...

but it's never enough  :Smile: 

----------

## TwistedKestrel

Well, I suppose I can help you out a bit. I'm playing around with a P233 MMX with 32MB of ram as a server, and I can tell you you're gonna want to get used to hammering the swap file. Oh yeah; definitely make sure your swap file is bigger than mine (64MB) ... maybe make it 128 or 192, you've got a big enough HD for it. I would also highly recommend optimizing as -Os instead of -O3 ... I mean, that's what I did, and, well, it works  :Razz: .

Seriously, the best thing you could do for your laptop is buy some more memory for it ... easy for me to say, I know, but I don't even use X on said P233.

I hope somebody else gives ya tips, because they'd apply to me too  :Razz: .

Well, okay, one more. I'm not claiming to have invented this, but I hardly ever see it brought up ... if you use cfdisk, or whatever it was called, make sure you make the swap partition sit at the end of the available free space. The theory being that your hard drive reads data faster off the outer tracks, and since the swap will be the most used part of your hard drive (guarenteed), it'll help.

----------

## magnet

thanks for the tips,

are you sure that -Os will be better than -O3 ?

----------

## pilla

-Os tries to reduce binary sizes, which may be a good idea when you have small caches, hard disks,  and not enough memory. I am using -Os in my Pentium III even with 512 MB, because I didn't see significant performance improvement with -O3 and the binaries were larger

 *magnet wrote:*   

> thanks for the tips,
> 
> are you sure that -Os will be better than -O3 ?

 

----------

## magnet

ummm moderator ? ok I'll put the OS thinggy   :Razz: 

valeu !

----------

## g0dzuki

Only tip I can think of is to avoid using KDE or Gnome if your going to install X... look into BlackBox or Enlightenment instead -- they don't have all the bells and whistles that K or G have but need alot less power and RAM to run.

Just a thought!

~ g0dzuki

----------

## magnet

hell yea.

I'm a xfce fan.through I think about puttin evilwm,it's quite fast and it rox.  :Razz: 

----------

## xentric

I've got a Dell Latitude 233Mhz MMX with 96Mb RAM and 20Gb HD. I'm running KDE3.1 and

I'm pretty satisfied with the results... although I have a bit more RAM I still need about 20-100Mb

of swap space. Ofcourse this all depends on what is running.

While I was building my Gentoo system I chrooted to my Debian partition and started X/Kde3. Damn,

this was much faster than what I was used to with Debian. So I was very hopeful that Gentoo

would speed things up considerably. However, once I had built my system and got KDE and other

stuff installed, I never got back the speedy & responsive system that I experienced during that 

impatient little testrun.

Looking back I finally remembered that my Debian system was running on an ext2 partition

and that I had moved my Gentoo system to Reiserfs somewhere during the installation.

So I'm really wondering if reiserfs (no internal checks enabled) is making my system

slower. 

Also, I remember that the best place to put your swap partition is at the beginning (hda1)

of your drive. This is exactly opposite to what was mentioned in another post in this topic.

I would like to get more info on this because I have it at the very end of my disk and was

just planning to move it to the front.

Another important point is to put 'hdparm -qd1 -qA1 -qm16 -qu1 -qa64 /dev/hda' 

in /etc/conf.d/local.start so that it is run everytime your systems starts. This improved

disk performance by 200% on my machine. 

As far as optimizing with compiler flags, I'm currently building a stage1 system on another

partition with the following compiler flags:

CFLAGS="-march=pentium-mmx -O3 -pipe -fomit-frame-pointer"

But I have doubted if I should go for -Os instead. Maybe I will start over once again when

the new system is up and running to compare the overal speed and responsiveness.

A small tweak is to turn off some virtual terminals. I only need two, on #1 I log in under

my username and run startx, on #2 I log in as root, chroot to other partition and build

the new system. You can turn the rest off in /etc/inittab in the TERMINALS section by commenting

out c3-c6. This won't free up much, but my strategy is to disable everything I don't use.

I don't need a parallel-port, so no support in kernel, just make a module and the same goes

for USB and serial support.

The CD-Rom isn't used often so isofs.o is accessible as a module too. All these small things

will add up and you'll save some valuable resources if you stick to this rule.

I may use the 2.5.65-mm3 (mm-sources) or newer kernel with the new system I'm

building as it's got a better scheduler built-in. (pass elevator=cfq to the kernel at boot time!)

This should be better for desktop responsiveness, but I'm not sure if this extra scheduling will

improve or possibly even lower the overall performance. I'll just have to test...

On the software side I could pick a lighter WM/DE but I really like the KDE environment

and you don't hear me complaining about how it's running. Not bad for a stage3 system!

For browsing I started with Konq but have made a switch to Opera (static) because

it feels much faster. Just ignore the advertisements or pay for it. Konq somehow seems

to slow down my whole system. I don't use it anymore.

I'm always listening to mp3's with XMMS and it just skips mildly when the system is under

heavy load when compiling my new system. But as a former windows user I'm actually

impressed that it keeps playing my music during heavy load  :Very Happy: 

So the things I'm gonna improve are:

- Trying to get the max amount of RAM (128Mb)

- Building stage1 system (optimized with -O3)

- Newer kernel (as clean as possible)

- Changing back to ext2

- Putting swap at front of HD (256Mb)

- More tweaking of HD with hdparm

- Removing all fancy and useless stuff from KDE (no themes/transparency/wallpapers etc.)

----------

## magnet

hello,

first so what's up with this partition thinggy ?

mine is actualy on hda2 and is 64 mb large . hda1 is 100mb .

I use reiserfs  ,and started this morning to compile with the following options :

CFLAGS="-march-pentium-mmx -ffast-math -fomit-frame-pointer -foptimize-sibling-calls -funroll-loops -mmmx -pipe"

second what's up with reiserfs ? I read everywhere that is was faster than ext2/3 

for the hdparm thing, I used hdparm -c1 -d1 /dev/hda,

hdparm -t /dev/hda give me around 8,5 mb/sec ( excuted 5 five time it's the average )

the same test with your flags give me about 9.5 mb  :Smile: 

I'm currently using kernel 2.4.21-pre5-ac3 , will the mm one be faster ?

thanks for all men.

 :Mr. Green: 

----------

## xentric

 *magnet wrote:*   

> 
> 
> first so what's up with this partition thinggy ?
> 
> mine is actualy on hda2 and is 64 mb large . hda1 is 100mb .
> ...

 Well, I've googled around and came up with the following info...

You get the best results when you put your swap partition at the beginning of the drive.

Secondly, the extra movements of the heads takes time so you should put the swap partition on a

second HD. Since we have laptops with probably 1 disk we will have to do with swap on hda.

I still have windows on hda1 (expect problems moving it to hda2) so the second best position

for the swap partition should be at the disks geographical center.

This should minimize the travel of the heads, but I'm not quite sure if it actually works like this.

 *Quote:*   

> I use reiserfs  ,and started this morning to compile with the following options :
> 
> CFLAGS="-march-pentium-mmx -ffast-math -fomit-frame-pointer -foptimize-sibling-calls -funroll-loops -mmmx -pipe"
> 
> second what's up with reiserfs ? I read everywhere that is was faster than ext2/3

 It scales better with small files and is possibly faster, but we are running slow systems

and I really wonder if it is faster for us too. That's why I'm gonna change back to ext2 when

my new system is done (somewhere next week) just to see if there's a speed improvement.

 *Quote:*   

> for the hdparm thing, I used hdparm -c1 -d1 /dev/hda,
> 
> hdparm -t /dev/hda give me around 8,5 mb/sec ( excuted 5 five time it's the average )
> 
> the same test with your flags give me about 9.5 mb 

 

Nice!  :Cool: 

 *Quote:*   

> I'm currently using kernel 2.4.21-pre5-ac3 , will the mm one be faster ?

  Don't even know yet if it supports all my hardware, but I'm gonna give it a try soon... 

It should make things run smoother, but I'm afraid this will come with

overall loss of performance on my system.

I would like to hear more from people with old or low-end systems !

----------

## magnet

we definitly need more info about reiserfs, I'm gonna google some and share informations.

damn it's time compiling the system again to test -Os.

----------

## wim

i've got a toshiba 4070CDT, which is a 366 celeron machine with 128mb ram ( 64 added later ). and 4 gb hd.

the performance is quite good actually. well, i don't have gnome2 or kde...

ive got fluxbox which rox for limited hardware ( well, it rox for state off the art hardware aswell )

i got gtk2 only, not gtk1, to minimize diskusage, mozilla and gimp (unstable builds) all run stable.

the only optimisation i changed in the CFLAGS is the Os setting... for size

and another thing, i tend to USE=" -* ....." to NOT use everything except for what i define afterwards. (again, for diskspace reasons)

the remark about the swap file is quite true though, i have 128mb of ram, and i made a swap of 300. you should use the old advice used for old machines and 2.2 kernels: "allways make your swap twice as large as your ram"

another thing, the gaming-sources or the 2.5 development kernels are quite good. they give a slight performance boost... 

the gaming-sources are quite stable, so it seems, 2.5 has a couple of setbacks. but this is all up to you.

you should also use phoenix, which does work with gtk2 (if you really want it to, like me). 

and you could replace loads of Xprograms by console apps. like centericq, mpg123,....

PS: i use reiserfs, it rulez

----------

## magnet

thanks for the advices , I already use reiserfs  :Smile: 

I'm thinking about using picogui instead of X since I plan to use very light software that don t need X. console apps , and links ( -g of course ).

I still need some gui thing with window and menu.coz it's fun  :Smile:  so picogui don t seems to be the worst choice.

I also heard about tiny X , some kind of small X that run witt 4 mb of ram.  :Cool: 

----------

## magnet

surfing a bit the web, I found that there are some replacement for glibc , like dietlibc or ulibc , does someone ever tried it ?

I'm think it could speed my system a bit , if I use it.

----------

## Wiebel

You were talking about where to put the swap partition. Here are my 2 cents

 xentric you are interested in why someone said it should be the last partition. As far as I get it right it's a historical issue. In the earlier Days when the HDs could be mapped plainly without any logical management, they counted the tracks from the inside to the outer rim (like on CD).

[dup:  :Embarassed: 

 As the throughput of the disk is at it's maximum on the outside the fastest partition was the last one. But that's History nowadays, today the logical blocks begin on the outside (I belive). So in this point your right ]

BTW hda1 must not be the first partition you can relocate it to be somewhere else just use fdisk on linux  :Twisted Evil: .

[But ...  as I said it' only about the throughput. You have to take in account that any rim (outer or inner) is really a bad place to be for the head it has to travel the whole way across the disk if you are swapping and accessing something on the inner area. So the really quickest place is in the middle of the disk where the head has the shortest way to every place. ]

I'm working with AIX where the LVM constantly tries to put things in the middle, wich made me wonder so I came to this point.

I'm anything but sure if todays logical blocks and heads are in any way connected with real physical facts.

So nothing really sure from me but a little more then pure guessings   :Smile: 

Apologies if my english was causing any pain.

[edit:  :Embarassed:  sorry. Like I used to say : Being able to read is a clear advantage  :Embarassed:  ]Last edited by Wiebel on Tue Apr 01, 2003 1:10 am; edited 2 times in total

----------

## magnet

hehe duplicate post  :Smile: 

anyway interesting post.thanks.  :Razz: 

----------

## BradB

Try using distcc to help with the emerge process, speeds things up hugely.  Other than that, just stick to lightweight apps - I used to have a p2-333 Compaq Armada, running fluxbox + phoenix and other lightweight apps it ran fine.  I never did get to use it as a wireless dumb-terminal to my server though...  :Sad: 

Brad

----------

## magnet

hehe I installed distcc one hour ago , to compile X  :Smile:   :Laughing: 

----------

## TwistedKestrel

 *Wiebel wrote:*   

> You were talking about where to put the swap partition. Here are my 2 cents 
> 
> xentric you are interested in why someone said it should be the last partition. As far as I get it right it's a historical issue. In the earlier Days when the HDs could be mapped plainly without any logical management, they counted the tracks from the inside to the outer rim (like on CD). 
> 
> [dup:  
> ...

 

Sorry to resurrect a dying thread (Is that bad here? I don't even know), but what would be the point in time that this change occured? I believe you 100%, it makes good sense, I just want to know, because I have a lot of old hard drives lying around, and I was thinking about making a kind of stone soup computer cluster as a summer project  :Razz: .[/img]

----------

## Wiebel

 *TwistedKestrel wrote:*   

> 
> 
> Sorry to resurrect a dying thread (Is that bad here? I don't even know), but what would be the point in time that this change occured? I believe you 100%, it makes good sense, I just want to know, because I have a lot of old hard drives lying around, and I was thinking about making a kind of stone soup computer cluster as a summer project .[/img]

 

I think it came up with LBA (Logical Block Allocation ?!). So if your HD is using LBA it's new. No proof for this, just thinking this way.

But I have to say I stopped bothering about this thing after I made a real mess of my Partitions. Nowadays I'm using evms, it's really cool.

----------

## xentric

Well, I've looked around and searched for some more info about some of the things mentioned

in this thread.

First of all I read that the -O3 flag can make big files about 20% larger compared to files

compiled with -Os. And I need as much free RAM as possible to avoid my system from starting

to use the HD for swapping, so -Os is really the best choice without a doubt. Programs also

load faster when compiled this way. I rather have more free RAM, less swapping and faster

load times than 5% faster binaries. -O3 is definately not worth it!

So I'm going to 'emerge -e world' with:

```
CFLAGS="-march=pentium-mmx -Os -pipe -fomit-frame-pointer"
```

I found some remarkable filesystem benchmarking results:

 *Quote:*   

> Mongo Benchmarks
> 
> The original author of the previous test, Guillem Cantallops, carried up new benchmarks
> 
> (XFS vs. ReiserFS vs. JFS vs. Ext2) but this time using the Mongo script provided by
> ...

 

This confirms what I suspected to be the case, reiserfs makes my system slower than

necessary! Reiserfs may be faster for newer machines, but on my machine I have noticed

that it really slows down things. So I'm going to switch back to ext2...

And thanks for the info about the swap partition. I haven't checked this yet but I think

you are right about the newer disks. With today's hardware the fysical layout of the

disk probably isn't the same as the older single platter disks where these stories are

based upon. I would have to manually test 100Mb parts of the drive and compare read/write

results to come up with several "better" positions for the swap partition. This isn't

worth the hassle, so I'll be satisfied by placing it safely somewhere in the middle of

the disk and not worry about it any longer.

Last point, about the newer 2.5.66-mm1 kernel. I've tried it on my new stage1 system and haven't

noticed any speed improvement compared to my stage3 system running with the 2.4.19-gentoo-r10.

Stability seems to be good though, had no issues whatsoever! The 2.6.0 shouldn't be too far

away now.

But I had some fun trying to get the new Alsa driver up and running. The best tip I can give

to people who want to test the 2.5.x kernels is to install them on a system that already has

a 2.4.x kernel properly installed with pcmcia and alsa tools.

I ran into lot's of problems because these packages won't build when compiled against the new

kernel. So compile all the stuff you need against the 2.4.x kernel first, then change the

/usr/src/linux link to the new kernel and compile as you want.

Had I known this before I started, it would have saved me 2 days of staring at compiler messages

and reading posts all over the net to solve my problems...

Just buying a faster laptop would probably be a better choice, but I'm learning lots of good

stuff from tweaking my old hardware  :Wink: 

-Os compiler flag, ext2 filesystem and a gentoo-2.4.x kernel is probably the best setup for me.

----------

## magnet

I'm trying to install Xkdrive , the small X server, ,it should left enought memory to run phoenix and some irc client at decent speed.

----------

## xentric

Just a small update on my journey of making my 233Mhz system as responsive as possible...

I had a 2.4.19-r10 kernel which was pretty good, then I tried the 2.4.20-r2 kernel and was

unpleasantly surprised that my system became really slow & skippy. I used a little script

to renice X, Opera and XMMS:

```
/usr/local/bin/speedup

#!/bin/bash

echo "Renice X:"

renice -10 -p $(pidof X)

echo "Renice XMMS:"

renice -10 -p $(pidof xmms)

echo "Renice Opera:"

renice -5 -p $(pidof opera)

```

But I just installed the development 2.5.68 kernel and it really put's a smile back on my face!

Boy oh boy... my old system has never been this responsive.

Switching back from Reiserfs to ext2 didn't make a difference as far as I can see, so I'll go back

to Reiserfs because it's more efficient and modern (safety of journaling).

The compiler optimization with -Os seems to have little effect, right after booting up and

logging in I use about 3,5 Mb less RAM, and when I disable 4 unnecesary virtual terminals

I get another 1,5 Mb free RAM. I haven't noticed programs starting up faster, it's just that

they use a bit less RAM. It could have been the slow 2.4.20 kernel, but my system was a bit

less responsive (and slower) than with -O3 optimization. It's definately not worth it to do an

'emerge -e world' !

Finally, I run XMMS without Arts because it uses more CPU and RAM than using OSS or

ALSA to play my mp3's. And Opera really is the fastest browser I have tried so I'll stick to

that for the time being. It's just a pita that I still have to use IE for online banking as

it just doesn't work in any other browser.

----------

## magnet

Hello,

I use phoenix as web browser it's very good, and it's open source unlike opera.

and if the computer is really too slow ( the 233/32mb I'm using for exemple ) , I use links in graphic mode, really fast , and quite fun.

----------

## grahamdrew

Well, this is less of a technical and more of a conceptual suggestion.

Figure out what you really want to use the laptop for, and optimize it for that specific purpose.  On a older laptop, having it do EVERYTHING is a bad call.

For example, I've got a Toshiba P166 MMX with 64M of ram and a 2G  HD.  The specs are pretty much immutable at the moment, and I've got to work with what I have.  The only thing I'm really gunna use the machine for is programming.  I don't have any real need for newsreaders, word processors, or anything fancy, so I went with gcc and emacs.  I just sat down at my desktop and kept tract of what I used the most when I was programming, without the frills.  Don't really need to play music, don't have the space.  Don't really need to do web browsing, so lynx on console works fine.  I don't really need desktop management, a file manager, or anything fancy in a window manager, so I went with IceWM.  Don't really need antialiased fronts on the LCD display, they tend to just look messy and really slow the system down.

Just try to keep in mind what you absolutely need, and what you're going to really use, and cut out all the rest.

----------

## magnet

hello,

infortunatly this computer is my gf's one,she like it, and want to keep using it as main computer.

she used to code ,to surf on the web , to chat ,to type some homework,and to listen to some musics.

up to now it works nearly fine with those softwares :

links ( in vga mode ) ,vim,gcc,apache,php,irssi,abiword,mp123 .

but we wanted her to have a GUI.

----------

## darket

For console-mp3-playing, try mp3blaster. The text-gui is quite nice, works perfect, and never skips for me, in contrast to xmms (running on a P200mmx, 64MB, 20GB HDD).

Greets, darket

----------

## magnet

it works fine here too , thanks for tips  :Smile: 

----------

## chevymoon

Hi,

I'm trying to find the best way to get an install started on a 

Toshiba Satellite Pro 430CDT

1.2 GB HD

32MB RAM

P120 processor

Internal Floppy

External Parallel Port CD-RW (Philips cdd3610)

I don't currently have a NIC, but I will likely get one soon. My forum searches have been only moderately helpful because of the cdrom issue. No one seems to have posted any insight as to how to utilize the parport cdrw.

Any Suggestions?

----------

## chevymoon

Bump!  :Smile: 

----------

## dh003i2

I suggest you try the optimizations I listed in the title.

Also, if you're installing on an older laptop, you might want to consider just using RatPoison as your WM. 

For apps, I suggest LyX as your document processor, GNUplot, plotutils, Abs (spreadsheet), and links -g as your browser. Make sure to emerge links with X support. I don't know, but for me, Phoenix really sucks. I have a 1.1GHz, 256MB, 7.2krpm ULTRA ATA-100 hard-drive, and Phoenix still takes several seconds to load; whereas links -g loads instantly. Only problem with links is that I can't login to slashdot with it. Anyone know of a way to login to slashdot using links?

----------

## chevymoon

Thanks for the reply.

Yep, I realize that I'm gonna have to go with some low impact programs. But my problem is more basic than that. I don't know how to go about putting Gentoo on this laptop with only a floppy and a parallel port cdrw, which I can't boot to ( at least, it's not an option in the bios).

Any ideas about that?

----------

## dh003i2

Try looking at Gentoo's alt-install guide:

http://www.gentoo.org/doe/en/altinstall.xml

P.S.: Dude, your avator is freakin' scary.

----------

## magnet

 *Quote:*   

> 
> 
>  But my problem is more basic than that. I don't know how to go about putting Gentoo on this laptop with only a floppy and a parallel port cdrw, which I can't boot to
> 
> 

 

ok , here is my advise. take any LOAF ( small linux distributions that feet on a floppy ).

burn a cd with stage 3 tarball,boot the LOAF , then mount the cd  and  the hard drive.

then unoack the stage3 tarball and chroot .then follow instruction in install section of the website.

----------

