failed: Inappropriate ioctl for device

Bug #257840 reported by Nitish Mittal
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
hdparm (Ubuntu)
Invalid
Undecided
Unassigned
Nominated for Jaunty by yurikoles
Nominated for Karmic by yurikoles

Bug Description

I am using Ubuntu 8.04. System configuration: pentium4 2.26GHz with intel 845g chipset motherboard. I have an IDE disk of 40 GB

Cannot read DMA status of hard disk nor active DMA.

$ sudo hdparm /dev/sda

/dev/sda:
IO_support = 0 (default)
16-bit)
HDIO_GET_UNMASKINTR failed: Inappropriate ioctl for device
HDIO_GET_DMA failed: Inappropriate ioctl for device
HDIO_GET_KEEPSETTINGS failed: Inappropriate ioctl for device
readonly = 0 (off)
readahead = 256 (on)
geometry = 4870/255/63, sectors = 78242976, start = 0

~$ lspci
00:00.0 Host bridge: Intel Corporation 82845G/GL[Brookdale-G]/GE/PE DRAM Controller/Host-Hub Interface (rev 03)
00:02.0 VGA compatible controller: Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 82)
00:1f.0 ISA bridge: Intel Corporation 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801DB (ICH4) IDE Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 02)
00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 02)
01:05.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

$ sudo fdisk -l
[sudo] password for nitish:

Disk /dev/sda: 40.0 GB, 40060403712 bytes
255 heads, 63 sectors/track, 4870 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb225b225

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20482843+ c W95 FAT32 (LBA)
/dev/sda2 2551 4009 11719417+ c W95 FAT32 (LBA)
/dev/sda3 4010 4799 6345675 83 Linux
/dev/sda4 4800 4870 570307+ 82 Linux swap / Solaris

Revision history for this message
Benjamin Drung (bdrung) wrote :

Thank you for taking the time to report this issue and helping to make Ubuntu better. Examining the information you have given us, this does not appear to be a bug report so we are closing it and converting it to a question in the support tracker. We appreciate the difficulties you are facing, but it would make more sense to raise problems you are having in the support tracker at https://answers.launchpad.net/ubuntu if you are uncertain if they are bugs. For help on reporting bugs, see https://help.ubuntu.com/community/ReportingBugs .

Benjamin Drung (bdrung)
description: updated
Revision history for this message
Benjamin Drung (bdrung) wrote :

I have reverted the question back to an bug report. To shorten the bug report I have thrown all questions out of the report. The bug is that you cannot read the DMA status nor change it. On my system hdparm has an similar output and activating DMA does not work. /dev/sda is a Samsung HD501LJ.

$ sudo hdparm /dev/sda

/dev/sda:
 IO_support = 0 (default)
16-bit)
 HDIO_GET_UNMASKINTR failed: Inappropriate ioctl for device
 HDIO_GET_DMA failed: Inappropriate ioctl for device
 HDIO_GET_KEEPSETTINGS failed: Inappropriate ioctl for device
 readonly = 0 (off)
 readahead = 256 (on)
 geometry = 60801/255/63, sectors = 976773168, start = 0

Revision history for this message
Benjamin Drung (bdrung) wrote :

Sorry, I forgot something: The question was https://answers.launchpad.net/ubuntu/+question/42147 and the output, when I tried to activate DMA:

$ sudo hdparm -d1 /dev/sda

/dev/sda:
 setting using_dma to 1 (on)
 HDIO_SET_DMA failed: Inappropriate ioctl for device
 HDIO_GET_DMA failed: Inappropriate ioctl for device

Revision history for this message
Nitish Mittal (nitish-nit555) wrote :

Hi, sorry for delay.

I have installed ubuntu on an 915p chipset motherboard and pentium4 2.93Ghz

but the problem is same

$ sudo hdparm /dev/sda
[sudo] password for nitish:

/dev/sda:
 IO_support = 0 (default)
16-bit)
 HDIO_GET_UNMASKINTR failed: Inappropriate ioctl for device
 HDIO_GET_DMA failed: Inappropriate ioctl for device
 HDIO_GET_KEEPSETTINGS failed: Inappropriate ioctl for device
 readonly = 0 (off)
 readahead = 256 (on)
 geometry = 10011/255/63, sectors = 160836480, start = 0

and hard disk performance is:

$ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads: 710 MB in 2.00 seconds = 354.58 MB/sec
 Timing buffered disk reads: 26 MB in 3.06 seconds = 8.50 MB/sec

Revision history for this message
Nitish Mittal (nitish-nit555) wrote :

I have also installed blktool. blktool also give me the same answer:

nitish@nitish-desktop:~$ sudo blktool /dev/sda dma
HDIO_GET_DMA: Inappropriate ioctl for device
nitish@nitish-desktop:~$ sudo blktool /dev/sda dma on
HDIO_SET_DMA: Inappropriate ioctl for device

Linux "Damn Small Linux" by using virtualbox on Win Xp shows the better result.

It show the Timing cached reads: 1200 MB in 2.00 seconds.

an I can easily set DMA in DSL by using hdparm command

yet DSL uses kernel-2.4.x.x which i think uses old IDE drivers because it shows my HDD as '/dev/hda'

Revision history for this message
Nitish Mittal (nitish-nit555) wrote :
Revision history for this message
thom (tsk) wrote :

same here

Revision history for this message
worjak (jakob-worm) wrote :

I'm affected too: http://ubuntuforums.org/showthread.php?t=1090841
I believe it has to do with libata: https://bugs.launchpad.net/ubuntu/+bug/228302 which points to: http://linux-ata.org/faq.html#combined

- I just don't understand how to disable the libata-driver?

yurikoles (yurikoles)
Changed in hdparm (Ubuntu):
assignee: nobody → r00t (yurikoles)
Revision history for this message
Eros Zanchetta (eros) wrote :

This affects me too (Karmic x86_64):

root@brooke:~# blktool /dev/sda dma
HDIO_GET_DMA: Inappropriate ioctl for device
root@brooke:~# hdparm /dev/sda

/dev/sda:
 multcount = 16 (on)
 IO_support = 1 (32-bit)
 readonly = 0 (off)
 readahead = 256 (on)
 geometry = 36481/255/63, sectors = 586072368, start = 0

root@brooke:~# uname -a
Linux brooke 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux

I found this bug while trying to figure out why disk performance is so bad on my box (I get an average SATA disk to SATA disk speed of 6 mb/sec). I tried swapping schedulers but I noticed very little change.

Revision history for this message
nascentmind (nascent-mind) wrote :

This bugs effects me too on ubuntu hardy.

hdparm /dev/sda gives

/dev/sda:
 IO_support = 0 (default)
16-bit)
 HDIO_GET_UNMASKINTR failed: Inappropriate ioctl for device
 HDIO_GET_DMA failed: Inappropriate ioctl for device
 HDIO_GET_KEEPSETTINGS failed: Inappropriate ioctl for device
 readonly = 0 (off)
 readahead = 256 (on)
 geometry = 4865/255/63, sectors = 78165360, start = 0

uname -a:
Linux ubuntu 2.6.24-26-generic #1 SMP Tue Dec 1 18:37:31 UTC 2009 i686 GNU/Linux

lspci:

00:00.0 Host bridge: VIA Technologies, Inc. VT8378 [KM400/A] Chipset Host Bridge
00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI Bridge
00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)
00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)
00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)
00:10.3 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 82)
00:11.0 ISA bridge: VIA Technologies, Inc. VT8235 ISA Bridge
00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 50)
00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 74)
01:00.0 VGA compatible controller: VIA Technologies, Inc. VT8378 [S3 UniChrome] Integrated Video (rev 01)

Revision history for this message
Reise (reise-pt) wrote :

I started having this problem in ubuntu after chaging the hard drives. I noticed because copying something thru the network from sda use 4% of a gigabit, copying from the others uses 35% of the network.

sda is connected in IDE
sdb/sdc/sdd are connected to Sata

reise@arcalion:~$ sudo hdparm /dev/sda

/dev/sda:
 IO_support = 0 (default)
16-bit)
 HDIO_GET_UNMASKINTR failed: Inappropriate ioctl for device
 HDIO_GET_DMA failed: Inappropriate ioctl for device
 HDIO_GET_KEEPSETTINGS failed: Inappropriate ioctl for device
 readonly = 0 (off)
 readahead = 256 (on)
 geometry = 20023/255/63, sectors = 321672960, start = 0
reise@arcalion:~$ uname -a
Linux arcalion 2.6.24-27-generic #1 SMP Wed Jan 27 23:54:28 UTC 2010 i686 GNU/Linux
reise@arcalion:~$ lspci
00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller (rev 02)
00:02.0 VGA compatible controller: Intel Corporation 82G33/G31 Express Integrated Graphics Controller (rev 02)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 01)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)
00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)

Revision history for this message
nascentmind (nascent-mind) wrote :

Is there any progress in this? :( . Its killing my hard disk performance!! I am on karmic and still the same.

Revision history for this message
Thomas Herve (therve) wrote :

Apparently, hdparm is not able to get or set dma on SATA drives. It should be activated by default though. The command "grep DMA /var/log/messages" will tell you.

Revision history for this message
Abdusamed Ahmed (sir508) wrote :

/dev/sda:
 setting using_dma to 1 (on)
 HDIO_SET_DMA failed: Inappropriate ioctl for device
 HDIO_GET_DMA failed: Inappropriate ioctl for device

I can confirm this on Ubuntu 10.04.1 Lucid

Linux 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16 19:52:42 UTC 2010 x86_64 GNU/Linux

Revision history for this message
Life-form (life-form) wrote :

Confirmed bug/error for Ubuntu Maverick

/dev/sr0:
 multcount = 0 (off)
 IO_support = 1 (32-bit)
 readonly = 0 (off)
 readahead = 256 (on)
 HDIO_GETGEO failed: Inappropriate ioctl for device

yurikoles (yurikoles)
Changed in hdparm (Ubuntu):
assignee: yurikoles (yurikoles) → nobody
Revision history for this message
arruah (arruah) wrote :

i've same problem

Revision history for this message
garyr (garyrich) wrote :

Same here

############
sudo hdparm -d1 /dev/sda1

/dev/sda1:
 setting using_dma to 1 (on)
 HDIO_SET_DMA failed: Inappropriate ioctl for device
 HDIO_GET_DMA failed: Inappropriate ioctl for device
#############

sudo hdparm -d1 -X udma6 /dev/sda1

/dev/sda1:
 setting using_dma to 1 (on)
 HDIO_SET_DMA failed: Inappropriate ioctl for device
 setting xfermode to 70 (UltraDMA mode6)
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 HDIO_GET_DMA failed: Inappropriate ioctl for device

#############
This is with 12.04 LTS

Trying to track down the source of nasty swapping freezes that lock the system for 10+ minutes while kswapd thrashes with 4G of memory and not much running.

grep DMA /var/log/messages
returns null, I don't really know if that's good or bad.

Revision history for this message
yurikoles (yurikoles) wrote :

This is hardware problem. Just try to use an another distro or even OS for and you will experience same problem.
Please attach a dmesg log.

Changed in hdparm (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Dunkirk (david-davidkrider) wrote :

I found this bug through searching on the error message. My box works great under Windows, my crawls under Linux. (I've been running Linux on my desktop for 20 years, so it's not like this is the first time I've compared operating systems on the same hardward.) Seems like it's still a problem, even after 3 more years.

Revision history for this message
netmag payozon (netmag) wrote :

issue persists on 16.04, but did not get the error on 18.04 (yet), but i've also reformatted hdd and swapped to XFS ... before i was getting the error on 2 harddisks - Toshiba 1TB + WD Caviar Green 1TB. With Windows disks were running fine though. SMARTS do not report any issues.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.