# [SOLVED] HDD performance

## Boris Kavod

Hello,

On my last Gentoo system installation, I have very high performance problem. For example, during each compilation (via emerge or make), which I feel be anomaly slow, the whole system becomes slow.

If I run top command during these compilations, CPU is not totaly loaded (8% maximum).

So, I think the problem is from HDD access speed.

I ran hdparm:

```
cid ~ # hdparm -tT /dev/sda

/dev/sda:

 Timing cached reads: 6604 MB in 2.00 seconds = 3304.41MB/sec

 Timing buffered disk reads: 200 MB in 3.02 seconds = 92.76 MB/sec
```

Then, I ran a dd test:

```
cid ~ # dd if=/dev/zero of=/tmp/output.img bs=8k count=256k

262144+0 data read

262144+0 data wroten

2147483648 bytes (2,1 GB) copied, 204,389 s, 10,5 MB/s
```

Here, information about my system:

```
cid ~ # hdparm -I /dev/sda 

/dev/sda:

ATA device, with non-removable media

        Model Number:       WDC WD10EARS-00Z5B1                     

        Serial Number:      WD-WMAVU1895188

        Firmware Revision:  80.00A80

        Transport:          Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6

Standards:

        Supported: 8 7 6 5 

        Likely used: 8

Configuration:

        Logical         max     current

        cylinders       16383   16383

        heads           16      16

        sectors/track   63      63

        --

        CHS current addressable sectors:   16514064

        LBA    user addressable sectors:  268435455

        LBA48  user addressable sectors: 1953525168

        Logical/Physical Sector size:           512 bytes

        device size with M = 1024*1024:      953869 MBytes

        device size with M = 1000*1000:     1000204 MBytes (1000 GB)

        cache/buffer size  = unknown

Capabilities:

        LBA, IORDY(can be disabled)

        Queue depth: 32

        Standby timer values: spec'd by Standard, with device specific minimum

        R/W multiple sector transfer: Max = 16  Current = 1

        Recommended acoustic management value: 128, current value: 254

        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 

             Cycle time: min=120ns recommended=120ns

        PIO: pio0 pio1 pio2 pio3 pio4 

             Cycle time: no flow control=120ns  IORDY flow control=120ns

Commands/features:

        Enabled Supported:

           *    SMART feature set

                Security Mode feature set

           *    Power Management feature set

           *    Write cache

           *    Look-ahead

           *    Host Protected Area feature set

           *    WRITE_BUFFER command

           *    READ_BUFFER command

           *    NOP cmd

           *    DOWNLOAD_MICROCODE

                Power-Up In Standby feature set

           *    SET_FEATURES required to spinup after power up

                SET_MAX security extension

                Automatic Acoustic Management feature set

           *    48-bit Address feature set

           *    Device Configuration Overlay feature set

           *    Mandatory FLUSH_CACHE

           *    FLUSH_CACHE_EXT

           *    SMART error logging

           *    SMART self-test

           *    General Purpose Logging feature set

           *    64-bit World wide name

           *    {READ,WRITE}_DMA_EXT_GPL commands

           *    Segmented DOWNLOAD_MICROCODE

           *    Gen1 signaling speed (1.5Gb/s)

           *    Gen2 signaling speed (3.0Gb/s)

           *    Native Command Queueing (NCQ)

           *    Host-initiated interface power management

           *    Phy event counters

           *    NCQ priority information

                DMA Setup Auto-Activate optimization

           *    Software settings preservation

           *    SMART Command Transport (SCT) feature set

           *    SCT Features Control (AC4)

           *    SCT Data Tables (AC5)

                unknown 206[12] (vendor specific)

                unknown 206[13] (vendor specific)

Security: 

        Master password revision code = 65534

                supported

        not     enabled

        not     locked

                frozen

        not     expired: security count

                supported: enhanced erase

        280min for SECURITY ERASE UNIT. 280min for ENHANCED SECURITY ERASE UNIT.

Logical Unit WWN Device Identifier: 50014ee0aca7bc1a

        NAA             : 5

        IEEE OUI        : 0014ee

        Unique ID       : 0aca7bc1a

Checksum: correct

cid ~ # lspci

00:00.0 Host bridge: nVidia Corporation C55 Host Bridge (rev a2)

00:00.1 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:00.2 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:00.3 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:00.4 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:00.5 RAM memory: nVidia Corporation C55 Memory Controller (rev a2)

00:00.6 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:00.7 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.0 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.1 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.2 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.3 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.4 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.5 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.6 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:02.0 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:02.1 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:02.2 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:03.0 PCI bridge: nVidia Corporation C55 PCI Express bridge (rev a1)

00:09.0 RAM memory: nVidia Corporation MCP51 Host Bridge (rev a2)

00:0a.0 ISA bridge: nVidia Corporation MCP51 LPC Bridge (rev a3)

00:0a.1 SMBus: nVidia Corporation MCP51 SMBus (rev a3)

00:0a.2 RAM memory: nVidia Corporation MCP51 Memory Controller 0 (rev a3)

00:0b.0 USB Controller: nVidia Corporation MCP51 USB Controller (rev a3)

00:0b.1 USB Controller: nVidia Corporation MCP51 USB Controller (rev a3)

00:0d.0 IDE interface: nVidia Corporation MCP51 IDE (rev a1)

00:0e.0 IDE interface: nVidia Corporation MCP51 Serial ATA Controller (rev a1)

00:0f.0 IDE interface: nVidia Corporation MCP51 Serial ATA Controller (rev a1)

00:10.0 PCI bridge: nVidia Corporation MCP51 PCI Bridge (rev a2)

00:10.1 Audio device: nVidia Corporation MCP51 High Definition Audio (rev a2)

00:14.0 Bridge: nVidia Corporation MCP51 Ethernet Controller (rev a3)

01:00.0 PCI bridge: nVidia Corporation Device 05bf (rev a2)

02:00.0 PCI bridge: nVidia Corporation Device 05bf (rev a2)

02:01.0 PCI bridge: nVidia Corporation Device 05bf (rev a2)

02:02.0 PCI bridge: nVidia Corporation Device 05bf (rev a2)

02:03.0 PCI bridge: nVidia Corporation Device 05bf (rev a2)

03:00.0 VGA compatible controller: ATI Technologies Inc RV620 LE [Radeon HD 3450]

03:00.1 Audio device: ATI Technologies Inc RV620 Audio device [Radeon HD 34xx Series]

07:08.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6306 Fire II IEEE 1394 OHCI Link Layer Controller (rev c0)

```

In kernel, I built following option:

```
Device Drivers  --->

<*> Serial ATA and Parallel ATA drivers  --->

[*]   ATA SFF support

<*>     NVIDIA SATA support

```

Can someone tell me if:

- the benchmark results are normal for my hardware?

- if yes: which other problem can explain my low performance?

- if no: how can I improve performance of my HDD access?

Thanks you for your help.Last edited by Boris Kavod on Mon Jul 19, 2010 9:45 pm; edited 1 time in total

----------

## krinn

perf are ok, but the slow copy has been report by many users with green hdd, and also about the drive lie to the OS about its sector size.

check out this http://community.wdc.com/t5/Desktop/Problem-with-WD-Advanced-Format-drive-in-LINUX-WD15EARS/td-p/6395

----------

## Boris Kavod

OK, I'm doing backup before try a parted as described. Hoping it can help.

But I don't understand one thing: you say "perf are ok" ? Does it means hdparm and/or dd give wrong resultat or must I expect better results after correction?

Thanks you!

----------

## krinn

yeah sorry, i mean that 92mb/s is a good result, you can goes to 120/130mb with ahci and sata2 drive & controller, but 92mb is really an acceptable, hence my "ok".

the dd part is really not that nice, but as dd do writes, i suppose the misalign partition show its bad effect

i suppose you could expect a 30mb but i'm not sure, green hdd "should" by design work slowly than "classic" (kinda like hdd for notebook that were design to save energy, and so with slower access time because of a lower disk rotation).

here's the same from my hdd, a MAXTOR STM380215 

```
/dev/sda:

 Timing cached reads:   3278 MB in  2.00 seconds = 1638.99 MB/sec

 Timing buffered disk reads:  226 MB in  3.01 seconds =  75.07 MB/sec

dd if=/dev/zero of=/tmp/output.tst bs=8k count=25k (lol sorry i'm not as patient as you)

25600+0 enregistrements lus

25600+0 enregistrements écrits

209715200 octets (210 MB) copiés, 8,62381 s, 24,3 MB/s

```

----------

## Boris Kavod

That'll teach me to want be "green"  :Surprised: )

I've just restored my system... but now my kernel panic  :Sad:  And it's exactly the same than before opration.

I think system does not recognized my partition table, because the error message is :

```

(...)

ata4: SATA link down (SStatus 0 SControl 300)

List of all partitions:

0800      976762584 sda driver: sd

  0801       976762583 sda1

No filesystem could mount root, tried: ext3 ext2 ext4 fuseblk jfs xfs

Kernel panic - not syncing: VFS: Unable to mount root fs on unknwon-block(8,1)

(...)

```

I say that because only sda1 is listed above even though my hdd have 4 partitions:

/dev/sda1 ext3 (for /boot)

/dev/sda2 ext3 (for / )

/dev/sda3 swap

/dev/sda4 ext3 (for /home)

Is it possible it is caused by using parted and GPT partition table (instead of cfdisk like I used to)?

Using liveCD, I can mount without problem my system and chroot on it.

my grub.conf:

```

root (hd0,0)

kernel /boot/kernel-2.6.34-gentoo-r2 root=/dev/sda2 raid=nodetect
```

Of course, ext3 and SATA_NV are built directly in kernel (not by modules)

Thanks you to help me leaving this HDD green nightmare  :Smile: 

----------

## krinn

fdisk -l /dev/sda and check they are 83 (linux)...

i don't know gparted, i think it should do its work, but i prefer fdisk (maybe because i use so few that i don't even took time to look at gparted)

----------

## Boris Kavod

Yes, partitions are linux (ext3 in parted). Actually, it seems GPT is not native compatible with GRUB (http://www.wensley.org.uk/gpt).

I'm not familiar with parted too, but the howto on WD forum used this tool. I think I will have to recreate partitions with fdisk. I tried this morning just before going work, but I had errors like "Partition 1 does not end on cylinder boundary".

I'll study the situation this evening. Thanks for your help.

----------

## Boris Kavod

```
cid .ssh # dd if=/dev/zero of=/home/boris/output.img bs=8k count=256k 

262144+0 enregistrements lus

262144+0 enregistrements écrits

2147483648 octets (2,1 GB) copiés, 36,1427 s, 59,4 MB/s
```

I think I can say... Yeaaaaaaaaaaah !  :Wink: 

For information, if it can help someone, I used again parted with :

```
 (parted) mklabel msdos
```

to use again fdisk without the warning.

Then I had to create partitions considering cylindre size (each part must have a size in cylindres divisible by cylindre size).

```

cid .ssh # fdisk /dev/sda

Commande (m pour l'aide): u

Changing display/entry units to cylinders (DEPRECATED!)

Commande (m pour l'aide): p

Disque /dev/sda: 1000.2 Go, 1000204886016 octets

224 têtes, 56 secteurs/piste, 155733 cylindres

Unités = cylindres de 12544 * 512 = 6422528 octets <================= here

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Identifiant de disque : 0x000c4fb6

Périphérique Amorce  Début        Fin      Blocs     Id  Système

/dev/sda1   *           1          40      250848   83  Linux

/dev/sda2              41       16000   100101120   83  Linux

/dev/sda3           16001       16638     4001536   82  Linux swap / Solaris

/dev/sda4           16639      155734   872409048   83  Linux

Commande (m pour l'aide):
```

(sorry, I'm tactless enough to use French language  :Wink:  )

Next I restored a stage 4 ( https://forums.gentoo.org/viewtopic-t-312817.html ) etc.. etc...

Thanks a lot for your help krinn

----------

## krinn

ah les forums internationaux, j'avais pas vue ta localisation  :Smile: 

You're welcome

----------

