View previous topic :: View next topic |
Author |
Message |
TheWart Guru
Joined: 10 May 2002 Posts: 432 Location: Nashville,TN - USA
|
Posted: Tue May 21, 2002 1:10 am Post subject: Speeding up the HD and some misc Perl Tips |
|
|
Well, one part of the gentoo manual that I think needs some fixing is the post-installation section. I think one of the most often missed Linux 'tweaks' are those that have to do with hdparm.
To test your drive speed (good to do after every change to see how it affects you)
Code: | hdparm -Tt /dev/xxx |
To turn on 32bit accessing (c) and DMA (d) and multiple sector count (m)
[code]hdparm -c 1 -d 1 -m 16 /dev/xxx
now, one other big option is the enabling of UDMA 33/66/100. Add the -X option, and then this number i.e. (-X 69)
-X 33 ====> Multiword DMA
-X 66 ====> ATA-33 (UDMA2)
-X 68 ====> ATA-66 (UDMA4)
-X 69 ====> ATA-100 (UDMA 5)
Now, put the -k 1 option, and add the whole line to your /etc/rc.local/local.start or the similar one to have these go on bootup. Happy tweaking!
Secondly, here is a cool perl tip I saw a while back.
That will convert DOS text files to UNIX
Hope you guys and gals enjoy these! _________________ Face it, we are all noobs.
On the box it said it was designed for Win XP or better, so why won't it work with Linux? |
|
Back to top |
|
|
JefP@@ Apprentice
Joined: 09 May 2002 Posts: 179 Location: Belgium
|
Posted: Fri May 24, 2002 12:20 pm Post subject: |
|
|
thx for the info, but it seemed everything was already at max performance
Grtz |
|
Back to top |
|
|
TheWart Guru
Joined: 10 May 2002 Posts: 432 Location: Nashville,TN - USA
|
Posted: Fri May 24, 2002 7:52 pm Post subject: |
|
|
Well, thats a nice problem to have _________________ Face it, we are all noobs.
On the box it said it was designed for Win XP or better, so why won't it work with Linux? |
|
Back to top |
|
|
JefP@@ Apprentice
Joined: 09 May 2002 Posts: 179 Location: Belgium
|
Posted: Wed May 29, 2002 4:39 pm Post subject: |
|
|
lol
I guess it is ... if it were the case with everything ... |
|
Back to top |
|
|
jeropa n00b
Joined: 10 May 2002 Posts: 12 Location: Winnipeg
|
Posted: Sat Jun 01, 2002 8:02 pm Post subject: WOW... |
|
|
Before:
Code: | /dev/hdb:
Timing buffer-cache reads: 128 MB in 0.69 seconds =185.51 MB/sec
Timing buffered disk reads: 64 MB in 35.84 seconds = 1.79 MB/sec |
After:
Code: | /dev/hdb:
Timing buffer-cache reads: 128 MB in 0.75 seconds =170.67 MB/sec
Timing buffered disk reads: 64 MB in 2.49 seconds = 25.70 MB/sec |
Nice... I'm using: /sbin/hdparm -c1 -d1 -m16 -X68 -k _________________ - Jeropa |
|
Back to top |
|
|
slonocode Apprentice
Joined: 03 Jun 2002 Posts: 273
|
Posted: Mon Jun 03, 2002 5:29 am Post subject: Won't let me enable dma |
|
|
when trying to add dma with
hdparm -d 1 /dev/hda
i get an error not permitted.
It is a WD 40 gig 7200 ata 100 disk. |
|
Back to top |
|
|
principito n00b
Joined: 26 May 2002 Posts: 19 Location: Providence, RI
|
Posted: Mon Jun 03, 2002 9:58 pm Post subject: |
|
|
I've been using hdparm for a while to optimize my HD and it works great. However one thing you must be careful of is that if your BIOS is set to use UDMA-4 then you _MUST_ set hdparm to UDMA-4. If you set them mismatched, then you may get datacorruption. Just a word of warning. |
|
Back to top |
|
|
pavera Tux's lil' helper
Joined: 27 May 2002 Posts: 84
|
Posted: Mon Jun 03, 2002 10:04 pm Post subject: errors... |
|
|
does your IDE controller support dma?
furthermore, is the controller driver compiled into the kernel?
I had some problems with hdparm because I just took the default IDE/ATA settings in the kernel config, and it didn't have my specific controller compiled in, so all the special stuff the controller can do, it couldn't cause it was running on a generic driver.
(IE its an ata udma 66 controller, but it would only do 33, if I turned it up to 66 it would hang the machine).
upon compiling the driver for the controller in, I can crank it up to 66, and get 30+MBps of throughput.. |
|
Back to top |
|
|
Roderik n00b
Joined: 06 Jun 2002 Posts: 55 Location: Belgium
|
Posted: Sun Jun 09, 2002 12:10 pm Post subject: |
|
|
since i get
Code: |
bash-2.05a# hdparm -Tt /dev/hda
/dev/hda:
Timing buffer-cache reads: 128 MB in 0.82 seconds =156.67 MB/sec
Timing buffered disk reads: 64 MB in 1.68 seconds = 38.12 MB/sec
|
i guess i don't need to hdparm my disk |
|
Back to top |
|
|
rukhoven n00b
Joined: 18 Apr 2002 Posts: 54 Location: The flat lands of nether elevation
|
Posted: Thu Jun 13, 2002 5:39 pm Post subject: |
|
|
On the hdparm settings:
I addidtionally use -u1 which is apperently for Interrupt unmasking and should (according to diverse sources I once Googled up) help considerably in a desktop system.
thus: hdparm -u1 -d1 -c1 -a1 -m16 /dev/hd??
it is for me. Funnily, Gentoo and the kernel I made for it, detect all those thing automagically for me and my athlon system. So all's set "out of the box" _________________ *****************************
AMDXp 2000 per sis745 con 60 GB HD
......Is what I'd like to have....... |
|
Back to top |
|
|
bidz n00b
Joined: 08 Jun 2002 Posts: 54 Location: Norway
|
Posted: Fri Jun 14, 2002 4:04 pm Post subject: |
|
|
Roderik wrote: | since i get
Code: |
bash-2.05a# hdparm -Tt /dev/hda
/dev/hda:
Timing buffer-cache reads: 128 MB in 0.82 seconds =156.67 MB/sec
Timing buffered disk reads: 64 MB in 1.68 seconds = 38.12 MB/sec
|
i guess i don't need to hdparm my disk |
nice
Code: |
root@spitfire / # /sbin/hdparm -Tt /dev/hda
/dev/hda:
Timing buffer-cache reads: 128 MB in 0.57 seconds =223.80 MB/sec
Timing buffered disk reads: 64 MB in 1.61 seconds = 39.69 MB/sec
|
me neither i guess _________________ bidz @ efnet |
|
Back to top |
|
|
TheWart Guru
Joined: 10 May 2002 Posts: 432 Location: Nashville,TN - USA
|
Posted: Wed Jun 19, 2002 1:42 am Post subject: |
|
|
hmm, i think that the newer ide cards/drivers can get automatically adjusted by gentoo to reach their maximum performance, but not some of the older ide controllers _________________ Face it, we are all noobs.
On the box it said it was designed for Win XP or better, so why won't it work with Linux? |
|
Back to top |
|
|
Marauder n00b
Joined: 18 Apr 2002 Posts: 3 Location: Au
|
Posted: Wed Jun 19, 2002 2:44 am Post subject: |
|
|
Looks like it's automagically set for me too....
bash-2.05a# /sbin/hdparm -Tt /dev/hda
/dev/hda:
Timing buffer-cache reads: 128 MB in 0.44 seconds =292.91 MB/sec
Timing buffered disk reads: 64 MB in 1.66 seconds = 38.65 MB/sec
bash-2.05a# /sbin/hdparm -Tt /dev/hdb
/dev/hdb:
Timing buffer-cache reads: 128 MB in 0.44 seconds =292.24 MB/sec
Timing buffered disk reads: 64 MB in 2.52 seconds = 25.43 MB/sec
Fear my speed demons |
|
Back to top |
|
|
strife n00b
Joined: 14 Jun 2002 Posts: 22
|
Posted: Tue Jul 02, 2002 11:30 pm Post subject: Known issue? Ideas? |
|
|
When I do hdparm -d 1 /dev/hda and try to do the test, total system lockup. No keyboard/network/anything.
DMA is turned on in the kernel.
Now, under Mandrake this did not happen, the other strange thing is that when I try to turn DMA on on the DVD drive or CD-ROM the DMA setting resets to off after I do the test. Even when -k 1 is used. |
|
Back to top |
|
|
alan n00b
Joined: 24 Jun 2002 Posts: 8
|
Posted: Wed Jul 10, 2002 2:01 am Post subject: Re: Known issue? Ideas? |
|
|
strife wrote: | When I do hdparm -d 1 /dev/hda and try to do the test, total system lockup. No keyboard/network/anything.
DMA is turned on in the kernel.
Now, under Mandrake this did not happen, the other strange thing is that when I try to turn DMA on on the DVD drive or CD-ROM the DMA setting resets to off after I do the test. Even when -k 1 is used. |
It might due to some defective firmware in your controller card, or defective BIOS. Let me tell you my case.
I tried to install gentoo on an old computer which has A7V 133 mother with Promise ATA100 controller card built in, but the gentoo was frozen after certain period of time. I tried to recompile the kernel with different options in vain.
Then I suspected that this hasdsomething to do with the stability of the bios, because there's no hanging when I only use the ATA33 harddisk.
I headed to Asus offical site, got aflash.exe and 1800.bin then updated the bios - VOLA everything works fine - NO HANG UP anymore!
There's always a way to flash the fireware and bios. Just a random suggestions for you. |
|
Back to top |
|
|
KiTaSuMbA Guru
Joined: 28 Jun 2002 Posts: 430 Location: Naples Italy
|
Posted: Wed Jul 10, 2002 3:27 pm Post subject: |
|
|
Funny: hda was DMA on from the very begining (I checked it when I first got gentoo installed) so I did not bother checking the rest of hdparam stuff. Reading this post gave me another push to go check in detail and - guess what? - hdb was off.
You might also try the -u 1 option (turn unmasking on), I've found it very helpful on heavy disk IOs when a bunch of different progs all try to write and read from the very same disk.
Also a tip:
to turn DMA on, you must compile support for your MoBo's chipset in your kernel, not just the generic "use DMA when available" option.
and a big
WARNING:
the -X option to specifically define a DMA mode can get you in trouble: if you push harder the disk than its actual DMA capability you might corrupt it. Be sure you *know* what the DMA mode of both the disk and your mobo is - don't suppose. Another point can be made that by testing a couple of DMA 66 disks on a friend's computer produced better results by just -d1 (the system drives the disk at the speed the disk determines) instead of determining specific DMA mode by the -X option. _________________ Need to flame people LIVE on IRC? Join #gentoo-otw on freenode! |
|
Back to top |
|
|
arkane l33t
Joined: 30 Apr 2002 Posts: 918 Location: Phoenix, AZ
|
Posted: Fri Jul 12, 2002 12:46 am Post subject: |
|
|
I use a full line of stuff in mine, just to make sure everything is setup. (it wasn't originally..)
/sbin/hdparm -q -m 16 -q -a 1 -q -c 1 -q -u 1 -q -d 1 -X69 /dev/hda
I have a Western Digital WD1200JB (120gig 8mb cache EIDE Udma-100)
/dev/hda:
Timing buffer-cache reads: 128 MB in 0.55 seconds =232.73 MB/sec
Timing buffered disk reads: 64 MB in 1.44 seconds = 44.44 MB/sec |
|
Back to top |
|
|
J0rd n00b
Joined: 09 Jul 2002 Posts: 19 Location: @home
|
Posted: Fri Jul 26, 2002 2:40 am Post subject: |
|
|
with all the tweaks i managed to squeeze another 1MB/sec outa my HD!
pfft =)
but this is really important for people who dont have DMA enabled by default.
Here are my times on one of them new Maxtor 40GB ATA-133@ -X 69
j0rd root # hdparm -Tt /dev/hde
/dev/hde:
Timing buffer-cache reads: 128 MB in 0.64 seconds =200.00 MB/sec
Timing buffered disk reads: 64 MB in 1.60 seconds = 40.00 MB/sec
look at them nice round numbers. You would think that i have an imac HardDrive or something =)
post speed and flags, im looking for a new harddrive to buy. i wanna see some RAID / SCSI speeds too, so i can see if its worth Upgrading. _________________ /me out |
|
Back to top |
|
|
J0rd n00b
Joined: 09 Jul 2002 Posts: 19 Location: @home
|
Posted: Fri Jul 26, 2002 2:43 am Post subject: |
|
|
Marauder wrote: | Looks like it's automagically set for me too....
bash-2.05a# /sbin/hdparm -Tt /dev/hda
/dev/hda:
Timing buffer-cache reads: 128 MB in 0.44 seconds =292.91 MB/sec
Timing buffered disk reads: 64 MB in 1.66 seconds = 38.65 MB/sec
bash-2.05a# /sbin/hdparm -Tt /dev/hdb
/dev/hdb:
Timing buffer-cache reads: 128 MB in 0.44 seconds =292.24 MB/sec
Timing buffered disk reads: 64 MB in 2.52 seconds = 25.43 MB/sec
Fear my speed demons |
hey marauder, what kind of drives are those? you got some nice cache speeds _________________ /me out |
|
Back to top |
|
|
ledents n00b
Joined: 15 Jul 2002 Posts: 7
|
Posted: Fri Jul 26, 2002 4:41 am Post subject: Dos <=> Unix |
|
|
For dos to Unix conversion I think the tr command is simpler:
Code: |
cat <dosfile> | tr -d '\r' > <unixfile>
|
The Unix to Dos is a slightly more tricky as we have to add the carriage return ('\r') but nevertheless:
Code: |
cat <unixfile> |sed -e 's/$/{CTRL+V}{CTRL+M}/' > <dosfile>
|
|
|
Back to top |
|
|
mikki n00b
Joined: 14 Jul 2002 Posts: 51 Location: On Top
|
Posted: Fri Jul 26, 2002 5:27 am Post subject: |
|
|
Code: | % emerge fixdos
% crlf <dosfile>
|
RedHat has 'dos2unix' and 'unix2dos'. Don't know where they come from tho... _________________ Mikki |
|
Back to top |
|
|
delta407 Bodhisattva
Joined: 23 Apr 2002 Posts: 2876 Location: Chicago, IL
|
Posted: Fri Jul 26, 2002 5:47 am Post subject: |
|
|
Code: | $ emerge -s dos
...
* app-misc/fixdos
Latest version Available: 1.3.1
Latest version Installed: [ Not Installed ]
Homepage: http://e.co.za/marius/
Description: Set of utilities such as crlf which converts files between
UNIX and DOS newlines. |
crlf is a similar utility. "crlf -d" is DOS->UNIX, "crlf u" is UNIX->DOS. I know of those programs (and I had them once...) but this is a solution... _________________ I don't believe in witty sigs. |
|
Back to top |
|
|
mikki n00b
Joined: 14 Jul 2002 Posts: 51 Location: On Top
|
Posted: Fri Jul 26, 2002 5:58 am Post subject: |
|
|
Jinx, owe me a Coke! _________________ Mikki |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Fri Jul 26, 2002 7:49 am Post subject: |
|
|
I use Code: | $ perl -pe "s/\r\n/\r/; s/\r/\n/" -i |
...which has the additional benefit of working on MacOS files as well as DOS. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
Shak n00b
Joined: 13 Jul 2002 Posts: 34 Location: Huddersfield UK
|
Posted: Fri Jul 26, 2002 5:46 pm Post subject: |
|
|
After I applied those tweaks:
Code: |
/dev/hda:
Timing buffer-cache reads: 128 MB in 0.48 seconds =263.92 MB/sec
Timing buffered disk reads: 64 MB in 1.64 seconds = 39.10 MB/sec
|
Thanks |
|
Back to top |
|
|
|