# sdparm howto

## MaximeG

Hi,

I wanted to know if there is something similar to the hdparm howto (this  :Smile: 

http://gentoo-wiki.com/HOWTO_Use_hdparm_to_improve_IDE_device_performance

but for sdparm ? (Since I have a sata disk)

Thanks !

Maxime

----------

## d2_racing

Hi, I don't think that we can tweak anything inside for a SATA HDD.

----------

## MaximeG

 *d2_racing wrote:*   

> Hi, I don't think that we can tweak anything inside for a SATA HDD.

 

But sdparm exists, so I take it that it has a use, hasn't it ?

----------

## d2_racing

http://linux.die.net/man/8/sdparm

For my concern, hdparm is use to see if the dma is enable and I know also that we can tweak some parameters with a ide hdd, but as you can see inside the man, the purpose of sdparm is for a SCSI driver I think.

----------

## MaximeG

Yes,

I'm not a specialist, but I think sata drives use scsi, don't they ? The device is like /dev/sd* for my sata drives.

Thanks

----------

## eccerr0r

sdparm is mostly to set disk parameters, if there are any that are user tunable (mostly they do not affect performance).  You will likely not get any performance boost tweaking with it like with hdparm for ide disk controllers as well as disks.

Despite their similar-sounding names, the parameters they change are fairly disjoint.  One thing that is common to both tools is that you can force spindown for drives...

sata uses a scsi communication layer, but still has its ata roots and hdparm works fine for it too.

----------

## kernelOfTruth

 *MaximeG wrote:*   

> Yes,
> 
> I'm not a specialist, but I think sata drives use scsi, don't they ? The device is like /dev/sd* for my sata drives.
> 
> Thanks

 

I'm using sdparm for sending my drives to sleep & syncing data (and waking them up again), there's not THAT much to do ...

----------

## d2_racing

Thanks KernelOfTruth, it confirm that we cannot tweak the performance of a SATA drive.

----------

## kernelOfTruth

 *d2_racing wrote:*   

> Thanks KernelOfTruth, it confirm that we cannot tweak the performance of a SATA drive.

 

don't say that, d2_racing, there's still the settings in /sys/block/sda/queue/   :Mr. Green: 

```
for i in /sys/block/sd*; do

         /bin/echo "256" >  $i/queue/read_ahead_kb

done

for i in /sys/block/sd*; do

         /bin/echo "256" >  $i/queue/max_sectors_kb

done
```

might, for ex., be some tweaking but without sdparm of course   :Smile: 

----------

## MaximeG

Hi,

Well, what do you mean by "hdparm works fine too for sata" ?

 *eccerr0r wrote:*   

> sata uses a scsi communication layer, but still has its ata roots and hdparm works fine for it too.

 

When I try to change settings, for example : 

```
hdparm -c3 -d1 -u1 /dev/sda
```

I got the following errors :

```

/dev/sda:

 setting 32-bit IO_support flag to 3

 HDIO_SET_32BIT failed: Invalid argument

 setting unmaskirq to 1 (on)

 HDIO_SET_UNMASKINTR failed: Inappropriate ioctl for device

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Inappropriate ioctl for device

 IO_support    =  0 (default 16-bit)
```

----------

