# Hdparm, devfs and scsiemulated idedevices

## dostro

How do I for an example set dma on these? When I did not use devfs, I could  use /dev/hdc to set dma=on etc, but how do I do now?

----------

## Nitro

Might want to browse through: https://forums.gentoo.org/viewtopic.php?t=51

----------

## sven

You should check what chipset your motherboard's using and compile this chipset support into the kernel. Then DMA should be automaticly set by the kernel to all drives supporting it. I think this is a safer way instead of using hdparm.

----------

## Cr0t

HDPARM can be really dangerous... watch out what u are doing. start a research first then use HDPARM!

----------

## dostro

Well, the problem is not how to set dma, it is how to set dma on scsiemulated devices, though hdparm does not like these...

$ hdparm -c1d1 /dev/cdroms/cdrom0

/dev/cdroms/cdrom0 not supported by hdparm

----------

## dostro

In slackware ( not using devfs ) I solved it by setting hdparm to /dev/hdc instread, which worked fine. Now I don't know what to do...

----------

## kerframil

You've touched upon a very interesting problem here! Well I had a look through Google Groups and many other people seem to be asking the same question. It does only seem to be a problem with devfs (perhaps Richard Gooch should be informed, and the developer of hdparm?). Anyway, I gather that it is still possible to manipulate the IDE paramaters by outputting to the /proc interface. For example, to turn on DMA for /dev/hdc try this:

 :Arrow:  echo "using_dma:1" > /proc/ide/hdc/settings

You can get a list of all the possible settings (and their current values) by typing:

 :Arrow:  cat /proc/ide/hdc/settings

Here are a few handy ones, plus the equivalent hdparm switch:

-u  ->  unmaskirq

-X  ->  current_speed

-d  ->  using_dma

-c  ->  io_32bit

Bear in mind, that I have not tested this so please let me know what happens!

----------

## dostro

Thanks for the response!

I tried your solution, no success.

I found this though...

http://www.geocrawler.com/archives/3/35/2001/2/0/5251986/

The problem is, I do not know in which file to load ide-cd, set dma and the rmmod ide-cd ...Any advice?

----------

## kerframil

This is strange, because it works for me ... you did try it when logged in 

as root rather than an ordinary user? You'll get a permission denied error message otherwise. And you have full proc filesystem support compiled into your kernel? Try putting the line in /etc/rc.d/local (in a similar manner to the other stuff below ...)

I can see that the other (messy) technique referred to in the link should work, but I'm not able to test it at the moment (my kernel isn't set up suitably). The last time I used SCSI emulation in Linux, it was specified as a kernel boot time option in the bootloader (LILO or Grub), which could be problematic. I guess if ide-scsi is used in the context of a loadable module, then this way is OK. I would be inclined to do it this way:

1) Ensure none of the SCSI modules are autoloading

2) Add an hdparm line (in /etc/rc.d/local in the start() section)

3) Add a modprobe ide-scsi (in the same section)

It should be possible to pass a parameter on the modprobe line to tell the ide-scsi module only to use /dev/hdc so it doesn't take over your hard disk as well (unless that's what you want).

Sorry this is all a bit theoretical, if I actually get this working I'll be sure to post ...[/quote]

----------

## dostro

I made the changes to /proc/ide/hdc/settings as root. I also have /procfilesystem compiled into the kernel.

To get the scsiemulation to work, I have compiled  Scsi generic support, Scsi Cdromsupport and Scsi-emulationsupport into the kernel, so to use the ide-cd module I have to modprobe this in an early bootup stage, but that's all i know.

----------

## smtanner

Hey kerframil,

Your solution worked great for me.  My dvd was using scsi emulation so I could copy on the fly, but dvd playback was terrible.  Switching on dma using your technique did the trick.  Any suggestion on what file I could put this in so it gets done at startup.

thanks

----------

## kerframil

 *Quote:*   

> Any suggestion on what file I could put this in so it gets done at startup.

 

I would put it in your /etc/conf.d/local.start file. Note that there is a corresponding local.stop file, which is nice if you need to close or undo certain things upon shutdown - obviously that isn't relevant here.

Hey dostro, did you ever find a solution for your predicament?

----------

## rommel

sorry to crash your thread but i was checking out my system and when i cat /proc/ide/hdc/settings i see that dma is set to 1 which is on yes?...but hdparm doesnt recognize it as it is set to scsi since it is a burner...but that would be normal right?

oh and btw kerframil....freebsd is pretty cool...kinda like the father of gentoo in a way...i was able to bumble my way through the install and then a make  build and install of world  after cvsup'ing the src... have ports installed and updated....built and installed a custom kernel....X is compiled and i am waiting for gnome 2 for the desktop environment since i have kde3 on gentoo...anyway just thought i would blab...lol

uh one other question if i might...i just ran hdparm on my dvd player /dev/hda and it is set to udma4 but gives only 2.90mb/s read transfer rates...my hard drives /dev/md0 are getting 81mb/s.....shouldnt the dvd player be alot higher then it is....it does work though..like in ogle

ciao

----------

