Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell display drive driver drivers email error ethernet excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound trojan usb video virus vista windows windows xp wireless
UNIX/Linux
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > UNIX/Linux >
tweaking Hard Drive on old computer


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
Nester's Avatar
Senior Member with 162 posts.
 
Join Date: Mar 2002
26-Apr-2003, 10:49 PM #1
Question tweaking Hard Drive on old computer
Hi,

I have recently installed RedHat Linux 7.3 on an old computer and want to try and speed things up abit by tweaking my Hard Drive.

please remember I'm quite new to Linux and have only just started experimenting!

I have tested my Hard Drives current speeds, btw it's an IDE drive.

here are the results;

/dev/hda2
timing buffer-cache reads: 128 mb in 0.98 seconds =130.61 mb/sec

timing buffered disk reads: 64 mb in 5.24 seconds = 12.21 mb/sec

here is how the drive is currently being addressed;

/dev/hda2:
multcount = 0 (on)
I/0 support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 1 (on)
keepsettings = 0 (off)
nowerr = 0 (off)
readonly = 0 (off)
readahead = 8 (on)
busstate = 1 (on)

The first thing I think I need is 32-bit turned on for I/0 support but I have tried changing them from the shell logged in as root, in single user mode by using, # hdparm -c3 /dev/hda2
but all I get is;

/dev/hda2:
setting 32-bit I/0 support flag to 3
HDIO_SET_32BIT failed: invalid argument
I/0 support = 0 (default 16-bit)

Does any1 know what I'm doing wrong or know of a better way I could go about this?

Thank you very much in advance

Nester

ps: If i'm doing this totally wrong, please let me know!!
__________________
Where there's a will there's always a way!
codejockey's Avatar
Senior Member with 1,410 posts.
 
Join Date: Feb 2002
27-Apr-2003, 01:45 AM #2
You are not doing anything wrong, as far as I can tell. The problem may be that your drive chipset does not need the special sync sequence (and so rejects the request). Similarly, if your drive did not support 32-bit I/O, you might receive this type of error. Have you tried using -c 1 instead?

Also, note that 32-bit I/O refers only to the transfer between the controller and the PCI bus, not between the controller and the drive (which is always 16 bits).

Hope this helps.
__________________
The slowest component still sits at the keyboard.
Nester's Avatar
Senior Member with 162 posts.
 
Join Date: Mar 2002
27-Apr-2003, 10:50 AM #3
Hi codejockey,

Thanks for your reply, I have just tried setting the flag to 1 and have also tried 2 but I don't think it's having it!

I think I may have too many services running that I don't need but I don't know which ones are needed !??

OOPS - I just noticed in my last post where I typed; how the drive is currently being addressed, multcount = 0 (on) should be multcount = 1 (on) !!!

Thanks for your help, this site is great!

Nester
__________________
Where there's a will there's always a way!
codejockey's Avatar
Senior Member with 1,410 posts.
 
Join Date: Feb 2002
27-Apr-2003, 06:56 PM #4
Dawk! -- that's what I get for not reading carefully! When you use hdparm, you need to specify the entire disk device (i.e., /dev/hda, /dev/hdb, etc.) rather than a specific partition (which, when you think about it, makes perfect sense -- you can't set disk characteristics for a partition). Anyhow, try using /dev/hda instead of /dev/hda2 and see what happens (e.g., hdparm -c 3 /dev/hda) ...

Sorry for the oversight ...

Hope this helps.
__________________
The slowest component still sits at the keyboard.
lynch's Avatar
Senior Member with 1,962 posts.
 
Join Date: Aug 2002
Location: Back East,Way Back East
28-Apr-2003, 05:43 AM #5
This is so weird
I replied to this post yesterday but I must have left it in preview without submitting it:
Codejockey is right:hdparm -c3 /dev/hda2 wont work.The 2 in hda2 is the invalid argument noted in the error message.It should read:
hdparm -c3 /dev/hda
lynch
__________________
seldom right,but never in doubt...
Here's a few links I find helpful:
Intro to Linux:A Hands-on Guide
USALUG
A little Linux help
OpenSUSE help+
Bash Commands
Nester's Avatar
Senior Member with 162 posts.
 
Join Date: Mar 2002
29-Apr-2003, 08:50 PM #6
Hey guys, it worked!!

Thanx so much for your help, the only problem I have is keeping the settings because when I rebooted and tested the drive it was back to 16-bit.

How about #hdparm -k /dev/hda (keep settings over reset flag) Would that be safe to use? or would I have to write to a configuration file to keep the settings?

Also about the -k there is another one, but in upper case. I'm not sure which one it should be if any?

I'm really sorry about my late posts but I have been really busy lately, but all is calm for now!

There is one other problem I haven't been able to solve and that's Linux will sometimes go really slow and constantly thrash my Hard Drive to the point where I get fed up of not being able to do anything and end up just rebooting!

I think it could be that I have too many services running but I don't know which one's should run at startup and which one's are ok to shut down untill I need them, could you tell me the minimum amount of services I need?

Thanks again for all your help, It is a great challenge learning this new OS, it's like being born again!!! I won't knock Windows though as I've used it too long now but must admit I'm using Linux much more, you can do more!

Nester
__________________
Where there's a will there's always a way!
codejockey's Avatar
Senior Member with 1,410 posts.
 
Join Date: Feb 2002
30-Apr-2003, 02:15 AM #7
OK -- just want to make sure you understand what's going on ... so apologies if this is old news ...

When you use the -c option (e.g., -c 3 or -c 1), you are NOT modifying the transfer characteristics between the hard drive and the motherboard. This transfer is always 16-bit. Instead, you are modifying the transfer characteristics between the PCI bus and the controller card (or motherboard header). Did you actually notice any significant change when you set this? If you did, fine -- but don't confuse this with 32-bit I/O between the drive and the motherboard.

The -c setting cannot be "permanently" set using hdparm (so the answer to your question about whether to use -k or -K is "neither"). However, you can add a line to /etc/rc.d/rc.local to configure your disk as you like; you might add a line such as:

/usr/sbin/hdparm -c3 /dev/hda

which will automatically set 32-bit mode on each boot. Note that the same approach could be used to specify multi-sector read (aka block mode) and other performance features.

Re: slow performance, hard drive thrashing: more later.

Hope this helps.
__________________
The slowest component still sits at the keyboard.
lynch's Avatar
Senior Member with 1,962 posts.
 
Join Date: Aug 2002
Location: Back East,Way Back East
30-Apr-2003, 05:33 AM #8
The hard drive thrashing:
To see what's doing all the thrashing, open a terminal and type:
top
That'll show you all open and running processes(plus some other nifty info) in real time.
HTH
lynch
Nester's Avatar
Senior Member with 162 posts.
 
Join Date: Mar 2002
30-Apr-2003, 07:23 PM #9
Hi Codejockey, Lynch

Thankyou for the top commmand I have 56 processes: 54 sleeping: 2 running: o zombie: 0 stopped:

When I startup I get alot of processes starting that I'm not sure that I need, sush as sendmail, sshd, ap daemon and crond, also Kalarm and Korganizer will put itself in the taskbar, how do I stop those from starting?

I have redone the 32-bit I/0 and unmaskirq then tested the drives speed but it seemed to be a bit lower than before!?

About the processes that are running, even though it say's there are only 2 running I have 56 processes. Are they taking up memory?

Oh, when I tried to open /ect/rc.d/rc.local to be able to edit it from Konqueror I get no such directory, I was logged in as root, I have also tried from a shell by typing #vi rc.local but it opens it as a new document? I think I will have to learn how to use vi !! The same happens when I try from emacs.

I am sorry for being such a pain but I'm determined to be a Linux guru one day!! I want to learn everything, even if it takes me forever!!

Thank you both for all your advice, how long have you been using Linux?

thanks again

Nester
__________________
Where there's a will there's always a way!
codejockey's Avatar
Senior Member with 1,410 posts.
 
Join Date: Feb 2002
01-May-2003, 01:23 AM #10
You're more than welcome for any advice I contribute. Glad to be of help.

Performance issue: You might check your cron jobs (especially any default ones that are set up for root when the system is installed). To display your current cron jobs, use the command: crontab -l as root and review the output. You may have to do some detective work to understand what each job is doing. For example, on my system, root's crontab includes the following command:

# Run daily cron jobs at 4:40 every day:
40 4 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null

which doesn't tell you a whole lot on the face of it. But a little investigation reveals that /etc/cron.daily is a directory that contains two shell scripts (logrotate and slocate) and these will be executed at 4:40 every day. Logrotate is a utility that manages logfiles generated on the system; processing large logfiles might degrade performance depending on what else was going on, memory, etc. Slocate is a utility that indexes files so that they can be found faster; on a system with many files and low memory, this process also might degrade performance. I don't know how likely it is that one or more cron jobs are degrading performance, but it's at least worth checking out (note that if you start keeping a list of when you experience performance problems, you may see a pattern).

Now, rc.local: I should have been clearer. You will not necessarily have this file on your system. You may have an equivalent file with a different name, or you may not have anything similar. Since I don't run RedHat, I can't compare your results with mine. However, see if you have a directory /etc/rc.d. In this directory you should find a number of scripts that control which processes are started and stopped when the system changes states (boot->multi-user, multi-user->single-user, multi-user->reboot, etc.). Try the command: grep "rc.local" /etc/rc.d/* and review the output. For example, on my system, rc.M contatins a reference to rc.local. When I look at rc.M in an editor, I find:

# Start the local setup procedure.
if [ -x /etc/rc.d/rc.local ]; then
. /etc/rc.d/rc.local
fi

which basically says, "If there is an executable program named rc.local in the /etc/rc.d directory, read and execute it." So, if rc.local doesn't exist, no harm done. The idea here is to identify the name of a file that contains local commands to be executed when the system changes states.

Services running: more later. Bottom line: less is more (more efficiency, more security, more performance, etc.).

Hope this helps.




The point is that most wouldn't even know to look for these default cron jobs.
__________________
The slowest component still sits at the keyboard.
Nester's Avatar
Senior Member with 162 posts.
 
Join Date: Mar 2002
02-May-2003, 06:55 PM #11
Hi codejockey,

I have tried the, crontab -l logged in as root but all I got was, no crontab for root, I got the same when I tried as a normal user.

I do have a directory called, /etc/rc.d which contains more dirs, and some shell scripts, these are;

rc
rc.local
rc.sysinit

#rc
This file is responsible for starting/stopping services when the runlevel changes. It is also responsible for the very basic things, such as setting the hostname.

#rc.local
This script will be executed *after* all the other init scripts. You can put your own initalization stuff in here if you don't want to do the full sys v style init stuff.

the rc.sysinit just say's it runs at boot time, but I have found something interesting in it.

#Turn on harddisk optimization
#There is only one file /etc/sysconfig/harddisks for all disks
#after installing the hdparm-RPM. If you need different hdparm #parameters for each of your disks, copy /etc/sysconfig/harddisks
#to /etc/sysconfig/harddiskhda (hdb, hdc...) and modify it.
#each disk which has no special parameters will use the defaults.
#Each non-disk which has no special parameters will be ignored.

I have looked in /etc/sysconfig/harddisks but I have no /etc/sysconfig/harddiskhda or does this mean I would have to create it. I also found in /etc/sysconfig/harddisks at the bottom
EXTRA_PARAMS=
So maybe that would be the right place to add the changes??

I am getting a bit confused!! but I'm learning!

Thanks for your help, I shall wait and see what you make of all the above before I try and do anything and most probably wreck the whole computer!

I shall definately write down the times of when I get the performance lags but since I have turned off Kalarm and Korganizer it doesn't seem to be doing it so much, but how do I stop them from starting up?

nester
__________________
Where there's a will there's always a way!
lynch's Avatar
Senior Member with 1,962 posts.
 
Join Date: Aug 2002
Location: Back East,Way Back East
02-May-2003, 10:54 PM #12
That's the file codejockey was talking about-put the parameters for hda there after the

" This script will be executed *after* all the other init scripts. You can put your own initalization stuff in here if you don't want to do the full sys v style init stuff."line.

If you only have one hard drive there isnt much point in using the sysconfig.harddisks file.
You cannot edit files with konqueror;it's a file manager/web browser not a text editor.Open a terminal and su to root,then type:
vi /etc/rc.d/rc.local (be sure to leave a space after vi)
When the file appears hit i to get in edit mode.
Hit j to move down to the above mentioned line and then hit o to open a new line.
Type in the hdparm parameters you want to use.Read them over to be sure everything is correct and then hit esc.
Then type ZZ to save the file and close vi.

HTH
lynch
__________________
seldom right,but never in doubt...
Here's a few links I find helpful:
Intro to Linux:A Hands-on Guide
USALUG
A little Linux help
OpenSUSE help+
Bash Commands
Nester's Avatar
Senior Member with 162 posts.
 
Join Date: Mar 2002
03-May-2003, 03:25 PM #13
Hi lynch,

I have added the line to the rc.local script using vi, so now it looks like this;
------------------------------------------------------------------------------------
#!/bin/sh
#
#This script will be executed *after* all other init scripts.
#You can put your own initalization stuff in here if you don't
#want to do the full sys v style init stuff.
/usr/sbin/hdparm -c3 /dev/hda

touch /var/lock/subsys/local
------------------------------------------------------------------------------------
The above is exactly how the script looks with the line I have just added, I don't know what the, touch /var/lock/subsys/local is though?

I then saved it as you said then rebooted but when I looked using hdparm again, I/0 support still said (default 16-bit)

I have checked the file again in Konqueror to check if vi saved it and it did so I don't know why it hasn't executed the line I added?

Thanks again for your help, and patience!

Nester
__________________
Where there's a will there's always a way!
lynch's Avatar
Senior Member with 1,962 posts.
 
Join Date: Aug 2002
Location: Back East,Way Back East
03-May-2003, 05:55 PM #14
The last version of RH I used was 7.3:it kept turning off DMA on my hard drive and spitting bad crc errors about it.
Take a look in /var/log/warn,/var/log/boot.msg and /var/log/messages for anything pertaining to /dev/hda.
Try the same line but just type:
hdparm -c3 /dev/hda
without the /usr/bin/.
The /var/lock/subsys/ file is there for the startup script(rc.local) to make sure that a process isnt already running.
Here's a thread I found about it.
lynch
__________________
seldom right,but never in doubt...
Here's a few links I find helpful:
Intro to Linux:A Hands-on Guide
USALUG
A little Linux help
OpenSUSE help+
Bash Commands
codejockey's Avatar
Senior Member with 1,410 posts.
 
Join Date: Feb 2002
04-May-2003, 01:23 AM #15
You might also check the permissions on the rc.local file; it should be set to 755 (rwx-r-xr-x). If it is not executable, it (typically) will not be run. The touch command updates the access time in the specified file (assuming you have permission to access the file) or creates the file (zero-length) if it does not exist.

Hope this helps.
__________________
The slowest component still sits at the keyboard.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:42 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.