# very poor hdd performance from within initramfs (tinygentoo)

## korban

Hi!

I created my own initramfs according to the Tinygentoo documentation (http://en.gentoo-wiki.com/wiki/Tiny_Gentoo) to use it as a very minimalistic gentoo setup.

Everything is working so far except for proper hdd performance:

```
$ hdparm -tT /dev/sda

/dev/sda:

Timing buffer-cache reads:   680 MB in 0.50 seconds = 1365721 kB/s

Timing buffered disk reads:  370 MB in 3.00 seconds = 126282 kB/s
```

Booting from LiveCD gives me excellent hdd performance:

```
hdparm -tT /dev/sda

/dev/sda:

 Timing cached reads:   12704 MB in  2.00 seconds = 6359.99 MB/sec

 Timing buffered disk reads:  270 MB in  3.00 seconds =  89.88 MB/sec
```

already tried:

- several kernels (2.6.28, 2.6.32, 2.6.34, vanilla-sources, gentoo-sources, hardened-sources)

- kernel settings (libata/old support for sata)

- different hardware (ich7, ich9)

- activate/deactivate ahci in bios

- tweaking via hdparm

- initramfs based on Tinygentoo (uclibc) / initramfs according to http://en.gentoo-wiki.com/wiki/Initramfs

...no luck so far

this may be a hint:

```
$ hdparm /dev/sda

/dev/sda:

hdparm: HDIO_GET_MULTCOUNT: Inappropriate ioctl for device

 IO_support     =134580481 (???)

hdparm: HDIO_GET_UNMASKINTR: Inappropriate ioctl for device

hdparm: HDIO_GET_DMA: Inappropriate ioctl for device

hdparm: HDIO_GET_KEEPSETTINGS: Inappropriate ioctl for device

 readonly       =  0 (off)

 readahead      = 256 (on)

 geometry       = 51329/255/63, sectors = -1364690128, start = 0

```

more infos:

```
$ hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media

        Model Number:                                   

        Serial Number:                  XXXXXXXXXX

        Firmware Revision:      

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: 2930277168

        device size with M = 1024*1024:     1430799 MBytes

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

Capabilities:

        LBA, IORDY(can be disabled)

        Queue depth: 32

        Standby timer values: spec'd by standard, no device specific minimum

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

        Recommended acoustic management value: 254, 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:

           *    READ BUFFER cmd

           *    WRITE BUFFER cmd

           *    Host Protected Area feature set

           *    Look-ahead

           *    Write cache

           *    Power Management feature set

                Security Mode feature set

           *    SMART feature set

           *    FLUSH CACHE EXT cmd

           *    Mandatory FLUSH CACHE cmd 

           *    Device Configuration Overlay feature set 

           *    48-bit Address feature set 

                SET MAX security extension

           *    DOWNLOAD MICROCODE cmd

           *    General Purpose Logging feature set

           *    SMART self-test 

           *    SMART error logging 

Security:

        Master password revision code = 65534

                supported

        not     enabled

        not     locked

        not     frozen

        not     expired: security count

                supported: enhanced erase

        254min for SECURITY ERASE UNIT. 254min for ENHANCED SECURITY ERASE UNIT. 

Checksum: correct
```

So what do I miss here?

Is there some setting to be done in initramfs to get full hdd performance?

Anyone some ideas?

Thanks in advance!

Korban

----------

## eccerr0r

 *korban wrote:*   

> 
> 
> ```
> $ hdparm -tT /dev/sda
> 
> ...

 

I don't see any serious problems here? are you talking about buffer cache reads?  Are the two hdparm versions the same (run hdparm -V)?

The actual hard disk buffered read rates seems higher on the first one, 126282kB/s = 126.282MB/sec which is larger than 89.88MB/sec.

----------

## korban

 *eccerr0r wrote:*   

>  *korban wrote:*   
> 
> ```
> $ hdparm -tT /dev/sda
> 
> ...

 

Sorry   :Embarassed:  , of course you are right, HDD performance is indeed ok.

first hdparm output is with hdparm from busybox (1.15.3), which does not support "-V" parameter and obviously uses different units to show transfer rate.

Anyway I use rsync over ssh (with dropbear server on initramfs setup) to tranfer data, which seems very slow (in LAN), but I will figure it out...

Thank you for giving me the hint.

----------

