# Increasing hard disk write speed

## jerome187

I think my system is bottlenecking cause of slow hard disk write speed, i can only rip dvd to my hard drive at 2-4x speed (its a 16x dvd rom drive).  is there any way to increase speed without replacing the mobo or hard drive?  i just bought them so i dont want to get new ones.  its a regular 120Gig 7200RPM IDE hard drive and a cheapo biostar board.

----------

## Braempje

Install hdparm, that should speed up everything!

```
emerge -u hdparm
```

----------

## GuidoJ

Of course you should also set the correct parameters in /etc/conf.d/hdparm:

-d1 to enable DMA

-c[1|2|3] to enable 32 bit transfers

-X66 to enable UDMA4

Test with

hdparm -tT /dev/hda

Read the manual and help files for more options.

----------

## paranode

Also, some DVD ROM manufacturers claim that they have 16x drives but purposefully slow the drive down to the 2x range when it's reading CSS-encrypted DVDs.  I threw out my old Toshiba and got a Lite-on because of this.

----------

## jerome187

it reads at 2x-x4 on both my dvd-rom (its a cheapo one) and my sony dvd-/+/r/rw, so i dont think its that.

heres what i get on hdparm for my root partion (hdb5):

```
bash-2.05b# hdparm -tT /dev/hdb5

/dev/hdb5:

 Timing buffer-cache reads:   128 MB in  0.61 seconds =209.84 MB/sec

 Timing buffered disk reads:  64 MB in 18.14 seconds =  3.53 MB/sec

bash-2.05b#
```

is that normal?

----------

## zakl

What brand is your 120GB?

hdparm -Tt /dev/hdc

/dev/hdc:

 Timing buffer-cache reads:   128 MB in  0.44 seconds =290.91 MB/sec

 Timing buffered disk reads:  64 MB in  1.38 seconds = 46.38 MB/sec

That is my output.  I am using a WD 120GB standard drive.  I don't know what your hdparm settings are, but from the output you posted above, your bottleneck seems to be your hard drive and not your DVD drive. 

Try typing 

hdparm -d /dev/hdx (x being the particular drive you want to see)

if it says 

using_dma    =  1 (on)

then your fine, 

using_dma    =  0 (off) 

then that *could* be your problem.

Anyway, let me know.

Zak

----------

## jerome187

yep, DMA is OFF.  its a maxtor too.  i'll try to follow GuidoJ's instructions to turn it on

----------

## jerome187

my /etc/conf.d/hdparm file looks likt this:

all_args="-d1"

disk0_args="-dl -c[1][2][3] -X66"

hdparm -d /dev/hdb5 still says DMA is off after i edited the file and rebooted.

if my hard drive is a slave drive do i need to replace disk0 with something else?

----------

## fryfrog

```

rc-update add hdparm default

```

btw, thanks for this thread.  i was able to use the info found here to get hdparm working at boot up w/o putting stuff in local.start :)

----------

## jerome187

sweet, i think the rc-update fixed it  :Smile: 

```
/dev/hdb5:

 Timing buffer-cache reads:   128 MB in  0.64 seconds =200.00 MB/sec

 Timing buffered disk reads:  64 MB in  1.48 seconds = 43.24 MB/sec

bash-2.05b#
```

muuuuuuuch better  :Smile: 

----------

## Narada

/etc/conf.d/hdparm

```
all_args="-c1 -d1 -k1 -m16 -u1 -Z"
```

hdparm -Tt /dev/hda

```
/dev/hda:

 Timing buffer-cache reads:   128 MB in  0.18 seconds =711.11 MB/sec

 Timing buffered disk reads:  64 MB in  1.57 seconds = 40.63 MB/sec

```

hdparm -i /dev/hda

```
/dev/hda:

 Model=ST3120023A, FwRev=3.33, SerialNo=3KA0YV1V

 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4

 BuffType=unknown, BuffSize=2048kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=234441648

 IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4 

 DMA modes:  mdma0 mdma1 mdma2 

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 

 AdvancedPM=no WriteCache=enabled

 Drive conforms to: ATA/ATAPI-6 T13 1410D revision 2:  1 2 3 4 5 6
```

hdparm /dev/hda

```
/dev/hda:

 multcount    = 16 (on)

 IO_support   =  1 (32-bit)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 keepsettings =  1 (on)

 readonly     =  0 (off)

 readahead    =  8 (on)

 geometry     = 14593/255/63, sectors = 234441648, start = 0
```

----------

## jerome187

holy crap dude!  how did you get it up to 711MB/s?  SCSI?  Raid?

----------

## Narada

Initially, I was also very surprised at it.  The usual figure of my system is 752MB/s but today it is a little lower.  I am not using raid or scsi.  The machine is a top of the range Dell Dimension 8250 however which came with a 120GB Seagate ST3120023A.  My detailed hard drive information is given in my previous post.

----------

## jerome187

maybe its ATA133 or something like that

----------

## syadnom

right now im running some bittorrent seeds with the following total stats:

103K Download

30k Upload

and i test this same drive that this is downloading to

/dev/hda:

 Timing buffer-cache reads:   128 MB in  0.51 seconds =250.98 MB/sec

 Timing buffered disk reads:  64 MB in  2.72 seconds = 23.53 MB/sec

(30Gb Maxtor)

Model=Maxtor 53073H4, FwRev=JAC61HU0, SerialNo=F40FESPC

 Config={ Fixed }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=57

 BuffType=DualPortCache, BuffSize=2048kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=60030432

 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4

 DMA modes:  mdma0 mdma1 mdma2

 UDMA modes: udma0 udma1 *udma2 udma3 udma4 udma5

 AdvancedPM=yes: disabled (255) WriteCache=enabled

 Drive conforms to: ATA/ATAPI-6 T13 1410D revision 0:  1 2 3 4 5 6

/dev/hda:

 multcount    = 16 (on)

 IO_support   =  3 (32-bit w/sync)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    =  8 (on)

 geometry     = 3736/255/63, sectors = 60030432, start = 0

---

you can see im running faster than you with an older slower drive, with significant usage.  maybee you should look at some other things, like if your cable is good, maybee its bent or damaged in some way.  also check to see if your using generic IDE drivers or if you have support for your  interface in the kernel.

----------

## jerome187

i'm using brand new round cables, so i'm pretty sure its not them.  i'm not sure what you mean by adding support for my interface.  i see a VIA82CXXX chipset support in my kenel config thats not checked.  my mobo uses via for sound and lan, so maybe thats what i need to add?  its under IDE, ATA and ATAPI Block devices.  is that were i shoud be looking?

----------

## tisonlyi2

[url=http://www.compgeeks.com/details.asp?invtid=MK3018GAS-N]This is My Hard drive[/url]

Apparently it has a 2MB buffer, unused at present it seems...

hdparm -i /dev/hda

gives me this:

 [quote]Model=TOSHIBA MK3018GAS, FwRev=Q3.03 E, SerialNo=X25I6493T

 Config={ Fixed }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=46

 BuffType=unknown, BuffSize=0kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=58605120

 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4

 DMA modes:  sdma0 sdma1 sdma2 mdma0 mdma1 mdma2

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5

 AdvancedPM=yes: unknown setting WriteCache=enabled

 Drive conforms to: device does not report version:  1 2 3 4 5[/quote]

hdparm -tT /dev/hda

gives this:

 [quote]Timing buffer-cache reads:   128 MB in  0.35 seconds =365.71 MB/sec

 Timing buffered disk reads:  64 MB in  3.08 seconds = 20.78 MB/sec[/quote]

and this is my /etc/conf.d/hdparm:

[quote]

all_args="-c1 -d1 -k1 -m16 -u1 -Z"

[/quote]

(the only un-#-ed line)

any ideas on how i can bump that speed up?  how i can get the buffer that's there to function?

I'm an industrial suppier of goldfish.  You can have as many scales as you like if you help.    :Laughing: 

PS.  If anyone could tell me what i'm doing wrong with the formatting...  :p

----------

## CDLM

so yeah, when I do hdparm -Tt hda(and hdb) i get approx:

Timing buffer-cache reads: 128 MB in  1.38 seconds = 92.75 MB/sec

Timing buffered disk reads: 64 MB in  2.10 seconds = 30.48 MB/sec

they're quantum 40gig (bought a maxtor, they gave me a quantum ... damn merger) and a western digital 80gig (a gift from the parents)

Is the 92.75 good? They're ATA-100 drives so I'm not sure if this is way low or right on par... They're not exceptional drives, but I just want to make sure my speeds are about where they should be...  :Very Happy: 

- Dave -

----------

