LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 11-19-2003, 04:48 AM   #1
reyemarr
Member
 
Registered: Nov 2003
Location: Darwin, Australia
Distribution: Debian,Mandrake
Posts: 33

Rep: Reputation: 15
Question How to enable DMA at boot-up time


Hi,
I installed hdparm in an attempt to set up DMA support. I manually enabled it on my hard drive, cdrom, and cdwriter without problems. But the way I have it now, I have to do it every time I shutdown/restart my system. Is there any way to enable DMA support at boot time automatically?

Thanks in advance
 
Old 11-19-2003, 05:05 AM   #2
Quis
Member
 
Registered: May 2001
Location: Germany, Sd-Baden
Distribution: Gentoo
Posts: 139

Rep: Reputation: 15
you can write a simple script like:

#!/bin/bash
hdparm -d /dev/hdX

and copy it to your init.d folder (as root),
don't forget to make it executeable,
and make a link in your rc3.d and/or rc5.d folder
ln -s /etc/init.d/[your_hdparm_script] /etc/rc5.d/SXXhdparm
 
Old 11-19-2003, 05:36 AM   #3
reyemarr
Member
 
Registered: Nov 2003
Location: Darwin, Australia
Distribution: Debian,Mandrake
Posts: 33

Original Poster
Rep: Reputation: 15
Quis

Thanks for your quick response. But please keep in mind that I am a newbie. I do understand (kind off) what you said about making an executable script to run hdparm, but you totally lost me with the rc3.d and rc5.d thing. Could you please elaborate about those directories you mentioned??

PS. The symbolic link thing I do understand, so don't bother explaining that part.

Thanks a lot
 
Old 11-19-2003, 10:21 AM   #4
Quis
Member
 
Registered: May 2001
Location: Germany, Sd-Baden
Distribution: Gentoo
Posts: 139

Rep: Reputation: 15
the rcX.d folders include symlinks to the init.d folder.

each X representate a runlevel (most interesting runlevels are
1(single-user, no-networking, ..),
3(networking, text-based) and
5(X-server);
0 for halt and 6 for reboot (or vise versa, i am not sure).

the rcX.d-(runlevel)-folders are located in /etc/init.d, or maybe /etc.
this links have formats like SXX[name] and KXX[name]; S = start, K=kill;
the XX-number are for the execution-succession of the processes.

init.d contains all system-related deamons. they will be executed by the symlinks in the rcX.d-folders

you can create this script with an editor, then store it to [filename]
after this you set it to executeable with:
chmod -c 755 [filename]
 
Old 11-19-2003, 01:08 PM   #5
seneca
Member
 
Registered: Feb 2003
Location: Europe
Distribution: Debian
Posts: 45

Rep: Reputation: 15
Sorry to interrupt, Quis, but its much simplier to do
Code:
apt-get install hwtools
and then edit /etc/init.d/hwtools which is a prepared script. There's already a part called "hdparm optimization". You copy your usual hdparm commands in there, save, and then you're done.

Last edited by seneca; 11-19-2003 at 01:14 PM.
 
Old 11-19-2003, 05:03 PM   #6
reyemarr
Member
 
Registered: Nov 2003
Location: Darwin, Australia
Distribution: Debian,Mandrake
Posts: 33

Original Poster
Rep: Reputation: 15
Thanks guys
 
Old 11-20-2003, 04:02 PM   #7
Tramontane
Member
 
Registered: Oct 2003
Distribution: Debian
Posts: 39

Rep: Reputation: 15
Quote:
Originally posted by seneca
Sorry to interrupt, Quis, but its much simplier to do
Code:
apt-get install hwtools
and then edit /etc/init.d/hwtools which is a prepared script. There's already a part called "hdparm optimization". You copy your usual hdparm commands in there, save, and then you're done.
this is from the Deb package documentation:
Code:
hwtools - Collection of tools for low-level hardware management

This package is a collection of tools useful for hardware troubleshooting
and optimization (for ix86 machines):

 irqtune: adjusts priority of interrupts (improves serial performance),
 scanport: scans for hardware not already handled by Linux drivers,
 memmxtest: a real mode memory test, with MMX support.  You may want
to look at package memtest86 as well.

Be aware that these tools require some knowledge of what are they doing to be used properly, not causing damage to your system.

Some programs that were previously part of this package have been moved to their own packages (hdparm, scsitools, memtest86)
That is from the current stable package(version 0.8-0.1). The "hdparm" package is suggested by "hwtools", though. I think he'll still need to get the "hdparm" package to do what you're saying. If he can accomplish what he wants to do by using a simple script, why should he go through the trouble of installing an unnecessary package(hwtools)?
 
Old 11-20-2003, 05:02 PM   #8
llamakc
Member
 
Registered: Nov 2003
Distribution: Debian & Ubuntu
Posts: 402

Rep: Reputation: 31
If you install hdparm via apt-get and check WHICH files that package includes via

dpkg -L hdparm

You'll see there's a script IN /etc/init.d already. After I installed the package, my hd maintained the optimized settings with subsequent boots.

HTH,

(PS: this is on Unstable)
 
Old 11-21-2003, 11:53 AM   #9
reyemarr
Member
 
Registered: Nov 2003
Location: Darwin, Australia
Distribution: Debian,Mandrake
Posts: 33

Original Poster
Rep: Reputation: 15
Guys,

I followed your instructions about making a script to run hdparm at boot time, but still I havent been able to turn dma on automatically :-(. Here is what I did:

1. made a script called hdparm_init

d4500:/mnt/cdrom# more /root/scripts/hdparm_init
#!/bin/bash
/sbin/hdparm -d1 -m16 -c3 -u1 /dev/hda
/sbin/hdparm -d1 -c3 /dev/hdc
/sbin/hdparm -d1 -c3 /dev/hdd

2. made it executable
-rwxr-xr-x 1 root root 115 Nov 22 02:39 /root/scripts/hdparm_init

3. copied it to /etc/init.d/
d4500:/etc/init.d# ls -l hdparm_init
-rwxr-xr-x 1 root root 134 Nov 22 02:50 hdparm_init

4. made links to both rc3 and rc5 directories:
d4500:/etc/rc3.d# ls -l S15hdparm
lrwxrwxrwx 1 root root 23 Nov 22 01:54 S15hdparm -> /etc/init.d/hdparm_init
d4500:/etc/rc5.d# ls -l S15hdparm
lrwxrwxrwx 1 root root 23 Nov 22 01:57 S15hdparm -> /etc/init.d/hdparm_init

When the system boots up, I run hdparm /dev/hda to verify if dma was enabled and I get:
d4500:/mnt/cdrom# hdparm /dev/hda
/dev/hda:
multcount = 0 (off)
I/O support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 0 (off)
keepsettings = 0 (off)
nowerr = 0 (off)
readonly = 0 (off)
readahead = 8 (on)
geometry = 9732/255/63, sectors = 156355584, start = 0
busstate = 1 (on)

And if I run the script manually, it works fine, and this is what I get:
d4500:/mnt/cdrom# /root/scripts/hdparm_init

/dev/hda:
setting 32-bit I/O support flag to 3
setting multcount to 16
setting unmaskirq to 1 (on)
setting using_dma to 1 (on)
multcount = 16 (on)
I/O support = 3 (32-bit w/sync)
unmaskirq = 1 (on)
using_dma = 1 (on)

/dev/hdc:
setting 32-bit I/O support flag to 3
setting using_dma to 1 (on)
I/O support = 3 (32-bit w/sync)
using_dma = 1 (on)

/dev/hdd:
setting 32-bit I/O support flag to 3
setting using_dma to 1 (on)
I/O support = 3 (32-bit w/sync)
using_dma = 1 (on)



so the script seems to be ok
What am I doing wrong?????!!!!!!!
 
Old 11-21-2003, 12:09 PM   #10
llamakc
Member
 
Registered: Nov 2003
Distribution: Debian & Ubuntu
Posts: 402

Rep: Reputation: 31
Check /etc/inittab. You should be booting into Runlevel 2, which is the default. Link to there...
 
Old 11-21-2003, 12:29 PM   #11
reyemarr
Member
 
Registered: Nov 2003
Location: Darwin, Australia
Distribution: Debian,Mandrake
Posts: 33

Original Poster
Rep: Reputation: 15
llamakc
That was right on the money. Thanks. Where can I get more information about what each init level does?

Again thanks
 
Old 11-21-2003, 12:38 PM   #12
llamakc
Member
 
Registered: Nov 2003
Distribution: Debian & Ubuntu
Posts: 402

Rep: Reputation: 31
man init is a great place to start.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
activate DMA for disks at boot time mrosati Linux - Software 1 09-15-2005 07:04 AM
dma problems with the 2.6.6 at boot time rabbit171 Linux - Newbie 1 07-30-2004 10:40 AM
Enable DMA ust Linux - General 1 02-09-2004 01:28 AM
cant enable DMA! hkon Linux - Hardware 1 08-08-2003 03:11 PM
enable DMA? Alinuxnoob Linux - Newbie 1 02-28-2002 03:58 PM


All times are GMT -5. The time now is 02:11 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration