Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Basic gentoo tips that worked for me
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
martinbishop
n00b
n00b


Joined: 16 Dec 2003
Posts: 66

PostPosted: Wed Dec 24, 2003 11:43 pm    Post subject: Basic gentoo tips that worked for me Reply with quote

I don't know that this will help anyone, but here are some basic tips for gentoo that have worked for me.

One: System Performance

Su to root and try hdparm -Tt /dev/hda (or your system drive) and check that both speeds are good, for a 7200rpm drive, the top should be well into the hundreds, and the second test should be around 40MB/s. I was getting really lagged on single compiles and large downloads, turns out that I missed an option for my IDE drives in the kernel, look in Device drivers, ATA/ATAPI,blah support, and try to find your ide device under the ide support section, enabling the correct one for me helped ALOT.

Two: /boot

when copying a new bzImage to your boot sector, MAKE SURE TO HAVE /BOOT MOUNTED.
doing cp arch/i386/boot/bzImage /boot will NOT give you errors since there is a /boot on your / directory.

Three: ALSA

2.6 has alsa built in to the kernel, but you still need to emerge alsa-utils and get alsamixer and unmute the bars as needed.

Four: ALSA-xmms

This one took a while to get an answer for, but I saw it help at least 3 people at the same time as it helped me. When playing mp3's and streaming radio, there would be annoying poping sounds from my speakers, nothing I did would help. Heres how I finally fixed it. Open preferences in XMMS and make sure you have the alsa-xmms plugin used for your audio. Then click advanced, and deselect the Mmap option. Problem solved.

Note: All these solutions were usually given to me or to someone else from people who really know what the hell they are doing, and I am glad they share what they know.
Back to top
View user's profile Send private message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Thu Dec 25, 2003 12:16 am    Post subject: Reply with quote

thanks for the tips; though i knew them myself,
there's nothing wrong with sharing what you know;
there's always someone who can benefit from it.

and merry christmas :wink:
Back to top
View user's profile Send private message
chipi
n00b
n00b


Joined: 05 Oct 2003
Posts: 62
Location: Israel

PostPosted: Fri Dec 26, 2003 2:53 pm    Post subject: Reply with quote

Thank you for the tips, but can explain a little further about the first one? I think I'm getting low results.. the first one is about ~240MB/s and the second one is ~7MB/s... That doesn't sound too good for me... and it happens with all of my hardrives (i have two, both are 7200RPM).

If can explain how you solved it - it would be great :)
Back to top
View user's profile Send private message
dkaplowitz
Guru
Guru


Joined: 22 Nov 2003
Posts: 596
Location: Philadelphia, PA

PostPosted: Fri Dec 26, 2003 3:21 pm    Post subject: Reply with quote

chipi wrote:
Thank you for the tips, but can explain a little further about the first one? I think I'm getting low results.. the first one is about ~240MB/s and the second one is ~7MB/s... That doesn't sound too good for me... and it happens with all of my hardrives (i have two, both are 7200RPM).

If can explain how you solved it - it would be great :)


I got:

Code:

/dev/hda:
 Timing buffer-cache reads:   1048 MB in  2.00 seconds = 522.95 MB/sec
 Timing buffered disk reads:   20 MB in  3.03 seconds =   6.61 MB/sec


I'm running a 7200rpm 80GB drive (Maxtor I think) with reiserfs. And my system was only running X at the time I ran the test.

I've been curious about my disk's performance since installing Gentoo. I did a couple of large file x-fers (~4gb) and my system couldn't multitask anymore ---stuff like xmms would start sputtering out and chopping up the music I was listening to. Though I know a file x-fer like this will hammer my disk's performance, my old Redhat install (same drive with ext3) would still allow me to mult-task. Is it possible I misconfigured something that would cause such poor system performance with my disk?
_________________
http://dkap.info
Back to top
View user's profile Send private message
edave
n00b
n00b


Joined: 28 Sep 2003
Posts: 9

PostPosted: Fri Dec 26, 2003 4:31 pm    Post subject: Reply with quote

dkaplowitz and chipi:

That is most likely due to DMA being turned off. Try hdparm -d /dev/hda and see wether it is turned on or not. If not, you may turn it on by hdparm -d1 /dev/hda (assuming your chipset supports IDE DMA)
Back to top
View user's profile Send private message
hulk2nd
Guru
Guru


Joined: 25 Mar 2003
Posts: 512
Location: Freiburg, Germany

PostPosted: Fri Dec 26, 2003 4:48 pm    Post subject: Reply with quote

Code:
/dev/hda:
 Timing buffer-cache reads:   1172 MB in  2.00 seconds = 585.80 MB/sec
 Timing buffered disk reads:   76 MB in  3.05 seconds =  24.94 MB/sec

without any tweaking on my 5400rpm 40gb hitachi notebook hdd. i remember to have MUCH better results when playing around a little bit with hdparm settings.

greets,
hulk
Back to top
View user's profile Send private message
chipi
n00b
n00b


Joined: 05 Oct 2003
Posts: 62
Location: Israel

PostPosted: Fri Dec 26, 2003 5:17 pm    Post subject: Reply with quote

Well yes, I have DMA turned off on both of my hard-drives.
But when I try to turn it on, it gives me "Operation not permitted". I'm logged as root.

Why?
Back to top
View user's profile Send private message
Wedge_
Advocate
Advocate


Joined: 08 Aug 2002
Posts: 3614
Location: Scotland

PostPosted: Fri Dec 26, 2003 5:21 pm    Post subject: Reply with quote

I think that may mean the kernel you're using doesn't properly support your IDE controller. Try a newer version and see if that helps.
_________________
Per Ardua Ad Astra
The Earth is the cradle of the mind, but we cannot live forever in a cradle - Konstantin E. Tsiolkovsky
Gentoo Radeon FAQ
Back to top
View user's profile Send private message
joem
Retired Dev
Retired Dev


Joined: 20 Dec 2002
Posts: 508
Location: Bloomington, In

PostPosted: Fri Dec 26, 2003 5:31 pm    Post subject: Reply with quote

There is a turn dma on by default option for hard disks option that you can select in your kernel config
Back to top
View user's profile Send private message
dkaplowitz
Guru
Guru


Joined: 22 Nov 2003
Posts: 596
Location: Philadelphia, PA

PostPosted: Fri Dec 26, 2003 5:47 pm    Post subject: Reply with quote

edave wrote:
dkaplowitz and chipi:

That is most likely due to DMA being turned off. Try hdparm -d /dev/hda and see wether it is turned on or not. If not, you may turn it on by hdparm -d1 /dev/hda (assuming your chipset supports IDE DMA)


Thanks for the tip. It looks as though I will need to enable this in my kernel, since this is the result I got:

Code:

# hdparm -d1 /dev/hda

/dev/hda:
 setting using_dma to 1 (on)
 HDIO_SET_DMA failed: Operation not permitted
 using_dma    =  0 (off)


I'm gonna go look for the option in my kernel config. Hopefully it's relatively easy to find..
_________________
http://dkap.info
Back to top
View user's profile Send private message
airflow
Apprentice
Apprentice


Joined: 14 Dec 2003
Posts: 173
Location: Vienna, Austria

PostPosted: Fri Dec 26, 2003 8:14 pm    Post subject: Re: Basic gentoo tips that worked for me Reply with quote

martinbishop wrote:
Two: /boot

when copying a new bzImage to your boot sector, MAKE SURE TO HAVE /BOOT MOUNTED.
doing cp arch/i386/boot/bzImage /boot will NOT give you errors since there is a /boot on your / directory.


I would generally suggest to mount the /boot-Partition permanently via an entry in fstab. I don't know why the default-setting in gentoo is the non-permanent variant.

regards,
airflow
Back to top
View user's profile Send private message
dkaplowitz
Guru
Guru


Joined: 22 Nov 2003
Posts: 596
Location: Philadelphia, PA

PostPosted: Fri Dec 26, 2003 9:53 pm    Post subject: Re: Basic gentoo tips that worked for me Reply with quote

airflow wrote:
martinbishop wrote:
Two: /boot

when copying a new bzImage to your boot sector, MAKE SURE TO HAVE /BOOT MOUNTED.
doing cp arch/i386/boot/bzImage /boot will NOT give you errors since there is a /boot on your / directory.


I would generally suggest to mount the /boot-Partition permanently via an entry in fstab. I don't know why the default-setting in gentoo is the non-permanent variant.

regards,
airflow


Although I don't really get why it's so, they say it's for security reasons. Others recommended that I not mount it in fstab, but rather to leave it as is. Frankly I don't really see the security implications of this. Sure you can delete important files, but you can do that on any mounted fs. Maybe someone could shed some light on this. I'm sure I'm missing something.
_________________
http://dkap.info
Back to top
View user's profile Send private message
dkaplowitz
Guru
Guru


Joined: 22 Nov 2003
Posts: 596
Location: Philadelphia, PA

PostPosted: Fri Dec 26, 2003 9:57 pm    Post subject: Reply with quote

dkaplowitz wrote:
edave wrote:
dkaplowitz and chipi:

That is most likely due to DMA being turned off. Try hdparm -d /dev/hda and see wether it is turned on or not. If not, you may turn it on by hdparm -d1 /dev/hda (assuming your chipset supports IDE DMA)


Thanks for the tip. It looks as though I will need to enable this in my kernel, since this is the result I got:

Code:

# hdparm -d1 /dev/hda

/dev/hda:
 setting using_dma to 1 (on)
 HDIO_SET_DMA failed: Operation not permitted
 using_dma    =  0 (off)


I'm gonna go look for the option in my kernel config. Hopefully it's relatively easy to find..


All I had to do was enable my VT82C5xxx chipset in my kernel config. DMA is on now, and this is my hdparm -Tt /dev/hda output:

Code:

# hdparm -Tt /dev/hda

/dev/hda:
 Timing buffer-cache reads:   1056 MB in  2.00 seconds = 527.21 MB/sec
 Timing buffered disk reads:  102 MB in  3.11 seconds =  32.82 MB/sec


Much better now. Thanks for the help.
_________________
http://dkap.info
Back to top
View user's profile Send private message
martinbishop
n00b
n00b


Joined: 16 Dec 2003
Posts: 66

PostPosted: Fri Dec 26, 2003 11:15 pm    Post subject: Reply with quote

I had the same problem trying to turn DMA on for my hdd, when it tells you it can't, even though you are root, it definatly means something is wrong with your kernel options.
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Sat Dec 27, 2003 4:44 am    Post subject: Re: Basic gentoo tips that worked for me Reply with quote

airflow wrote:
martinbishop wrote:
Two: /boot

when copying a new bzImage to your boot sector, MAKE SURE TO HAVE /BOOT MOUNTED.
doing cp arch/i386/boot/bzImage /boot will NOT give you errors since there is a /boot on your / directory.


I would generally suggest to mount the /boot-Partition permanently via an entry in fstab.


My first guess would be that you log in as root on every occasion.

Quote:
I don't know why the default-setting in gentoo is the non-permanent variant.


A few very simple reasons:

1. How often do you need access to the boot partition ?
Which basically means : how often do you recompile your kernel ?
If the answer is not "at least 3 times a day" then there is absolutely no reason to have /boot mounted in the normal course of running things.

2. Simple security at zero cost: if it's mounted, you can mess it up; if it's not, you can't. Simple as that.

Anyone with even a clue about security will tell you that you do not grant access unless it is necessary; you never do the opposite (deny access when needed). That's the M$ way - the highway to ruin.

Minor caveat: (2) is pointless if you habitually run the system as root; all one has to do is "dd if=/dev/urandom of=/dev/hda" and watch while your world crumbles before your eyes...;-)
Back to top
View user's profile Send private message
chipi
n00b
n00b


Joined: 05 Oct 2003
Posts: 62
Location: Israel

PostPosted: Sat Dec 27, 2003 10:49 am    Post subject: Reply with quote

Sorry, I don't know much about my chipset... How do I know which one do I have? what chipset is it? the hard-drive's or the motherboard's? I have one Maxtor hard-drive and the other one is Seagate... What else do I need to know?
Back to top
View user's profile Send private message
dkaplowitz
Guru
Guru


Joined: 22 Nov 2003
Posts: 596
Location: Philadelphia, PA

PostPosted: Sat Dec 27, 2003 1:51 pm    Post subject: Reply with quote

chipi wrote:
Sorry, I don't know much about my chipset... How do I know which one do I have? what chipset is it? the hard-drive's or the motherboard's? I have one Maxtor hard-drive and the other one is Seagate... What else do I need to know?


It should be your motherboard's. I went to my vendor's site to see what it said there. You can also do an "lspci" as root ---that's actually what helped me the most.

Good luck.
_________________
http://dkap.info
Back to top
View user's profile Send private message
airflow
Apprentice
Apprentice


Joined: 14 Dec 2003
Posts: 173
Location: Vienna, Austria

PostPosted: Sat Dec 27, 2003 3:25 pm    Post subject: Re: Basic gentoo tips that worked for me Reply with quote

adaptr wrote:
airflow wrote:
I don't know why the default-setting in gentoo is the non-permanent variant.

A few very simple reasons:

1. How often do you need access to the boot partition ?
Which basically means : how often do you recompile your kernel ?
If the answer is not "at least 3 times a day" then there is absolutely no reason to have /boot mounted in the normal course of running things.

2. Simple security at zero cost: if it's mounted, you can mess it up; if it's not, you can't. Simple as that.

Anyone with even a clue about security will tell you that you do not grant access unless it is necessary; you never do the opposite (deny access when needed). That's the M$ way - the highway to ruin.

Mmh, I think this is not the right way to go... To my mind, a user with root-right should know what he does, and he should also have the possibility to do so (without hassles). Instead, a normal user should not have to possibility to mess up the boot partition. Everyday work has to be done with such a normal user.

adaptr wrote:
Minor caveat: (2) is pointless if you habitually run the system as root; all one has to do is "dd if=/dev/urandom of=/dev/hda" and watch while your world crumbles before your eyes...;-)

There are easier ways to achieve this - what about "rm / -rf"? ;) This destroys your system too when issued as root - regardless of your /boot partition mounted or not...

regards,
airflow
Back to top
View user's profile Send private message
SubAtomic
Apprentice
Apprentice


Joined: 20 Dec 2003
Posts: 255
Location: Hobart, TAS, Australia

PostPosted: Wed Dec 31, 2003 3:45 am    Post subject: Reply with quote

If you want to know more about hdparm (and speedup your system by enabling dma etc.) there is a good tutorial and some nice tips here ...
http://linux.oreillynet.com/pub/a/linux/2000/06/29/hdparm.html?page=1
Back to top
View user's profile Send private message
Black
Tux's lil' helper
Tux's lil' helper


Joined: 10 Dec 2002
Posts: 124
Location: Province of Quebec, Canada

PostPosted: Wed Dec 31, 2003 4:03 am    Post subject: Re: Basic gentoo tips that worked for me Reply with quote

airflow wrote:
I don't know why the default-setting in gentoo is the non-permanent variant.


My understanding is that the original reason was that in the event of a system crash, all mounted partition might potentially become corrupted because the cached data doesn't get the chance to be written to disk.

If /boot isn't mounted, it can't become corrupted that way, allowing the computer to at least boot and allow you to make corrections. Assuming of course that the required drivers are built into the kernel, rather than as modules.
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Thu Jan 01, 2004 10:28 pm    Post subject: Re: Basic gentoo tips that worked for me Reply with quote

airflow wrote:
Mmh, I think this is not the right way to go... To my mind, a user with root-right should know what he does, and he should also have the possibility to do so (without hassles). Instead, a normal user should not have to possibility to mess up the boot partition. Everyday work has to be done with such a normal user.

Of course - totally agree there.
Small analogy:
You are an adult, you live alone, you own a gun - do you keep it loaded at all times ?
I wouldn't...
Point of view, probably.
airflow wrote:

adaptr wrote:
Minor caveat: (2) is pointless if you habitually run the system as root; all one has to do is "dd if=/dev/urandom of=/dev/hda" and watch while your world crumbles before your eyes...;-)

There are easier ways to achieve this - what about "rm / -rf"? ;)

This does not achieve the same at all - but never mind, because I b0rked up there - the line I gave will allow you to erase ANY partition - including those that are not mounted ;-)
Back to top
View user's profile Send private message
chipi
n00b
n00b


Joined: 05 Oct 2003
Posts: 62
Location: Israel

PostPosted: Fri Jan 02, 2004 11:51 am    Post subject: Reply with quote

I just wanted to say thanks one more time, after I configured my kernel properly I can sure notice the speed change. :lol:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum