# Help needed Sata/Samsung

## Morimando

```
 hdparm -I /dev/sda 

/dev/sda:

 HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
```

What is hdparm trying to tell me and how can i fix it?

SATA controller=onboard Silicon Image 3112A Hard Drive= Samsung SpinPoint SP1614C

Did i miss something in kernel?

Ah well, kernel running is a 2.6.11-nitro0

----------

## yottabit

Since your drive is enumerated as /dev/sda I suppose you're using the libsata driver in the kernel, which is good.

I have heard many reports that hdparm doesn't always work as expected (or at all) with SATA. And of course SATA does a good job at auto-negotiating its highest performance without you having to tell it what to do with hdparm like old IDE/ATA. But you're just trying to get info, not tweak...

When my benchmark is finished I'll try -I on my two different Hitachi SATA models.

----------

## yottabit

Yep, -I failed on my drives just like you reported. I think libsata is actually not passing the command correctly since the error reports something specific about ioctl.

dmesg might give you the info you need?

J

----------

## lbrtuk

hdparm does not work on scsi.

----------

## Morimando

can't see what speed it's running on by dmesg | grep scsi ... also: does anyone know how to get an exact overview on how much disc space is used/free per partition?

----------

## yottabit

I guess just trust that SATA is doing its job and the interface is running at its best.  :Smile: 

Once mounted, you can df -h to see usage...

J

----------

## Morimando

```
Filesystem            Size  Used Avail Use% Mounted on

/dev/hda2             3.6G  470M  3.1G  13% /

none                  252M     0  252M   0% /dev/shm

/dev/hda1              76M   15M   58M  21% /boot

/dev/hda5             5.4G  209M  5.2G   4% /var

/dev/hda6             8.9G  3.6G  5.4G  40% /usr

/dev/hda8              51G  1.2G   50G   3% /home

/dev/sda9             112G   65G   47G  59% /media

/dev/hdc              4.4G  4.4G     0 100% /media/cdrecorder1

/dev/sdb               57M  760K   57M   2% /media/usb
```

Looks okay, i think.. although it seems i oversized my root partition (and /var also) /usr is okay i think..

----------

## Morimando

Ah i forgot: i don't trust my sata-controller as i had a hard time getting it to run (Silicon Image 3112A).. but works okay since kernel 2.6.10 maybe it's because i learned how to configure my kernel properly..

----------

## yottabit

I only saw two SCSI/SATA devices there...  one for a 120 GB drive and one for USB flash...

Are you using libsata or the old sata driver in the kernel? (i.e. the new libsata is under SCSI low-level drivers category)

Why on Earth do you have so many partions on /dev/hda???? Wouldn't it be much simpler on yourself to use one partition (or maybe two in the case of swap partition instead of swap file)?

J

----------

## yottabit

Out of curiosity could you post your 'dmesg' output?

----------

## lbrtuk

That looks to be working fine in my eyes. His /media top level directory is his sata drive using libata.

There are many reasons to split all of your major top level directories across partitions. For instance it means that one having a lot of data put into it won't affect the other partitions. You won't have to worry about logs accidentally spilling over and filling your entire root partition. Also it lets you mount each directory with different options. ie- mount /usr readonly for security except when you need to update something. Oh, and a corrupt filesystem won't take out your whole system, including user data.

----------

## yottabit

All good points, just a pain to manage on a desktop... IMHO.  :Smile: 

----------

## Morimando

```
dmesg | grep scsi 

scsi0 : sata_sil

scsi1 : sata_sil

Attached scsi disk sda at scsi0, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0

scsi2 : SCSI emulation for USB Mass Storage devices

```

```
dmesg | grep sda

SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB)

SCSI device sda: drive cache: write back

SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB)

SCSI device sda: drive cache: write back

 sda: sda1 sda2 < sda5 sda6 sda7 sda8 sda9 >

Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
```

To satisfy the curiosity

----------

## lbrtuk

 *yottabit wrote:*   

> All good points, just a pain to manage on a desktop... IMHO. 

 

Yeah, probably. It's mainly a server admin's fetish.

Morimando: all libata drivers set themselves to the best settings automatically, so you should be fine there. I think hdparm -Tt (the benchmarking) works with scsi disks. So you can use that to see what sort of speeds you're getting.

```
hdparm -Tt /dev/sda
```

----------

## Morimando

The output doesn't look very reliable but well  :Wink:  you think that's good?

```
/dev/sda:

 Timing cached reads:   1168 MB in  2.00 seconds = 583.21 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

 Timing buffered disk reads:  130 MB in  3.03 seconds =  42.95 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device
```

```
/dev/hda:

 Timing cached reads:   1168 MB in  2.00 seconds = 583.51 MB/sec

 Timing buffered disk reads:  176 MB in  3.03 seconds =  58.17 MB/sec
```

Actually i'm somewhat surprised because i thought my sata would be faster than the ide disc..

also the sata disc doesn't seem too sure on it's speed:

```
/dev/sda:

 Timing cached reads:   1260 MB in  2.01 seconds = 628.21 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

 Timing buffered disk reads:  136 MB in  3.01 seconds =  45.17 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device
```

(2nd run) 

ah but well at least it looks okay, doesn't it?

----------

## yottabit

Drive makes and models?

----------

## Morimando

Samsung SP0802N => IDE (Firmware rev. TK100-24)

Samsung SP1614C => SATA (can't read any further info with hdparm, but i didn't change the firmware or such)

----------

## yottabit

Okay, don't know much about Samsung drives since 5-6 years ago.

----------

## Morimando

I revived this topic to ask one more thing:

Why the f**k is my Sata-drive slower than my IDE? If i transfer files from SATA-to IDE it takes much to long, for instance i copied 4 gig yesterday and it took 2minutes, which IMHO is too slow, way too slow.

----------

## yottabit

Just keep in mind that newer disks are almost ALWAYS faster than the older disks, and that disk speed can vary greatly from disk brand to disk brand...

----------

## lbrtuk

 *Morimando wrote:*   

> for instance i copied 4 gig yesterday and it took 2minutes, which IMHO is too slow, way too slow.

 

I don't see much wrong with that. According to my calculations you must have been getting approx 266 Mbit/s, roughly 33 MB/s. That's not bad considering the data has to be both read and written across the same southbridge. And then of course it has to be extracted from a filesystem and written to a new filesystem which takes cpu time.

----------

