# I cannot turn DMA on in my harddrive

## niben_s

Hi,

I am having problem with turning on DMA on my harddrive. I tried explictly setting it on using hdparm and it does not work.

I have AMD k6-2 533 MHz processor and  VIA (VT8501??) chipset . I have the following configuration in kernel config settings:

 *Quote:*   

> 
> 
> ATA/IDE/MFM/RLL Support --->
> 
>   IDE,ATA and ATAPI Block Devices --->
> ...

 

When I try to hdpram  i get following:

```

# hdparm -d1 /dev/hda3

      /dev/hda3:

      Setting Using_dma to 1 (on)

       HDIO_SET_DMA failed: Invalid Argument

       Using_dma = 0 (Off)

# hdparm -i /dev/hda3

    

     /dev/hda3:

     HDIO_GET_IDENTITY failed: Invalid Argument

```

Currently my hard drive speed on /dev/hda1 is 2.19 Mb/set and /dev/hda3 is 4.34.Mb/set which is very slow indeed.

After looking into the bulletin board i see that some people are saying to turn on the kernel option "automatically have your drives use DMA", but I never saw the option.

Please let me know if i needed to do anything.

----------

## Unne

After googling a bit, the answer I found is "hdparm is for drives, not partitions".  Try using /dev/hda instead of /dev/hda3.  I get the same errors as you if I try to hdparm a partition instead of a drive.

----------

## pYrania

in addition to the false execution of hdparm, it needs to be said, that not all harddisk support it.

you may check this with

$ cat /proc/ide/hda/settings

----------

## niben_s

 *Unne wrote:*   

> After googling a bit, the answer I found is "hdparm is for drives, not partitions".  Try using /dev/hda instead of /dev/hda3.  I get the same errors as you if I try to hdparm a partition instead of a drive.

 

You just made me sound like a dumb ass. That was too easy.

Thanks mate!

ps: How can i auto enable DMA after rebooting?

----------

## Unne

I don't know the best way to do it, but I added a line to the end of /etc/conf.d/local.start .  If there's a better way to do it, I'd love to know too.

----------

## lazarusrat

rc-update add hdparm boot

I think it only turns on DMA, so if there are other hdparm settings you want, just edit the /etc/init.d/hdparm script.

----------

## Unne

Oh, nice.  Can't believe I missed that.

----------

## niben_s

 *lazarusrat wrote:*   

> rc-update add hdparm boot
> 
> I think it only turns on DMA, so if there are other hdparm settings you want, just edit the /etc/init.d/hdparm script.

 

Thanks lazarusrat! I just tried that and it works. I also checked /etc/init.d/hdparm script and set dma to turn on for all drives.

The problem now is I still get the error message when i reboot the system saying ....cannot set DMA to on....fsck process will be delayed....something like that. Is there a way to get rid of that message?

Thanks

----------

## pYrania

i think you cannot. it's way before init parses your startup scripts

hm. you could modify /sbin/rc, but there's no need to do so  :Smile: 

----------

## lazarusrat

I think that would be the checkroot and/or checkfs scripts running before the hdparm script.

I've been wondering about that one myself.  :Smile: 

You can't just rc-update del checkroot/checkfs, because they're depended on by other scripts. So possibly remove them from the "depend()" section of the scripts that depend on them (I think localmount is one)? This assumes you're okay not having fsck run on boot at all.

Or possibly add "need hdparm" to the "depends()" section of checkroot/checkfs?

I'm not really sure how well either of these solutions will work. I haven't had the chance to try either of them myself yet, because it's not an issue on my box (my chipset has automatic DMA support), but it is on my roomie's.

----------

## lazarusrat

Oh, also there is apparently a /etc/conf.d/hdparm now? I don't think there was such an animal last time I messed with this stuff, so that's probably a better place to do the configuring.

I kind of skimmed over your kernel settings before. There's a setting in there somewhere for Enable DMA by default (or something like that). Have you got that compiled in? If not, give that a try, and if it works the whole init script thing won't be an issue anymore.

----------

## niben_s

 *Quote:*   

> 
> 
>  I kind of skimmed over your kernel settings before. There's a setting in there somewhere for Enable DMA by default (or something like that). Have you got that compiled in? If not, give that a try, and if it works the whole init script thing won't be an issue anymore.
> 
> 

 

I was looking for that option....could not find it.

----------

## lazarusrat

Sixth or so post in this thread: https://forums.gentoo.org/viewtopic.php?t=59619&highlight=hdparm+fsck

----------

## niben_s

 *lazarusrat wrote:*   

> Sixth or so post in this thread: https://forums.gentoo.org/viewtopic.php?t=59619&highlight=hdparm+fsck

 

I am on the same as the guy in the thread. I do have those options enabled and compiled but still DMA is not set to on before fsck.

----------

## lazarusrat

Hm.

My only other suggestion (besides fiddling with the init script dependencies which may or may not be a good idea) would be to pass hdparm the -k1 option. I think that's the right one. man hdparm, it's the "keep" flag that's supposed to tell your drive to keep settings across power cycles.

After this, it's basically EOF on my knowledge of the situation.  :Smile: 

----------

## marrs

After adding support for the correct chipset on my motherboard in the same area of the kernel's menuconfig, DMA was finally turned on automatically.

----------

## niben_s

 *marrs wrote:*   

> After adding support for the correct chipset on my motherboard in the same area of the kernel's menuconfig, DMA was finally turned on automatically.

 

What chipset do you  have and what option did you select for your chipset??

I have VIAxxxxxx and I was hoping setting VIA82CXXX Chipset support would resolve the issue.

----------

## puggy

Moving to Hardware & Laptops

Puggy

----------

