# error sending CAMIOCOMMAND ioctl: Inappropriate ioctl for de



## elimelech007 (Mar 21, 2022)

```
root@A9t:/home/luba # smartctl /dev/ada0
smartctl 7.2 2021-09-14 r5236 [FreeBSD 13.1-BETA2 i386] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

error sending CAMIOCOMMAND ioctl: Inappropriate ioctl for device
Unable to get CAM device list
/dev/ada0: Unable to detect device type
Please specify device type with the -d option.

Use smartctl -h to get a usage summary

root@A9t:/home/luba # camcontrol devlist
<HTS421260H9AT00 HA2OA70S>         at scbus1 target 0 lun 0 (ada0,pass0)
```


----------



## ralphbsz (Mar 22, 2022)

Read the man page for smartctl. Then use the correct -d option.


----------



## David the Swarfer (Apr 1, 2022)

Ever since the upgrade to 12.3 I cannot use smartctl, despite giving the correct -d option (tried both 'ata' and 'atacam', both fail).  All drives are SATA.


```
smartctl  -a -d ata  -T permissive /dev/ada3
smartctl 7.3 2022-02-28 r5338 [FreeBSD 12.3-RELEASE-p2 i386] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

Read Device Identity failed: Inappropriate ioctl for device

If this is a USB connected device, look at the various --device=TYPE variants
=== START OF INFORMATION SECTION ===
Device Model:     [No Information Found]
Serial Number:    [No Information Found]
Firmware Version: [No Information Found]
Device is:        Not in smartctl database 7.3/5319
ATA Version is:   [No Information Found]
Local Time is:    Fri Apr  1 12:06:57 2022 SAST
SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 82-83 don't show if SMART supported.
SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 85-87 don't show if SMART is enabled.
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
```

I have been using smartctl on these devices (all 8 in the box fail like this) for years, but 12.3 has a problem.
On another box the '-d atacam' solved this, but on this box nothing I have tried has resulted in useful detection of the drives.  Is this a bug in the underlying CAM or GEOM modules?


----------



## SirDice (Apr 1, 2022)

Is SMART turned on in the BIOS/UEFI? Sometimes you can switch this on or off there.


----------



## David the Swarfer (Apr 1, 2022)

SirDice said:


> Is SMART turned on in the BIOS/UEFI? Sometimes you can switch this on or off there.


nope, nothing has changed in the BIOS, only an upgrade from 12.2 to 12.3


----------



## SirDice (Apr 1, 2022)

Which disk controller does the machine have?


----------



## grahamperrin@ (Apr 3, 2022)

```
% sudo smartctl /dev/ada0
smartctl 7.3 2022-02-28 r5338 [FreeBSD 14.0-CURRENT amd64] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

ATA device successfully opened

Use 'smartctl -a' (or '-x') to print SMART (and more) information

% sudo smartctl -a /dev/ada0 | grep ATA
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 6
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
=== START OF READ SMART DATA SECTION ===
% sudo smartctl -d ata -a /dev/ada0
smartctl 7.3 2022-02-28 r5338 [FreeBSD 14.0-CURRENT amd64] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

Read Device Identity failed: Inappropriate ioctl for device

If this is a USB connected device, look at the various --device=TYPE variants
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
% pkg query %v smartmontools
7.3
% pkg -vv | grep -e url -e enabled
    url             : "pkg+http://pkg0.pkt.freebsd.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    url             : "https://alpha.pkgbase.live/current/FreeBSD:14:amd64/latest",
    enabled         : no,
    url             : "file:///usr/local/poudriere/data/packages/main-default",
    enabled         : yes,
% uname -aKU
FreeBSD mowa219-gjp4-8570p-freebsd 14.0-CURRENT FreeBSD 14.0-CURRENT #7 main-n253861-92e6b4712b5-dirty: Sat Mar 19 02:40:21 GMT 2022     root@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 1400053 1400053
%
```


----------



## grahamperrin@ (Apr 3, 2022)

elimelech007 said:


> smartctl 7.2 2021-09-14 r5236 [FreeBSD 13.1-BETA2 i386] (local build)



Reproducible with 13.1-RC1?

sysutils/smartmontools can you build 7.3 on i386?


----------



## David the Swarfer (Apr 4, 2022)

SirDice said:


> Which disk controller does the machine have?


It is an Intel® Server Board S3420GP

6 SATA ports onboard
and a PCIe  2 port SATA card from SiS

Mar  9 10:19:40 iwr kernel: siis0: <SiI3132 SATA controller> port 0x2000-0x207f mem 0xf1a04000-0xf1a0407f,0xf1a00000-0xf1a03fff irq 16 at device 0.0 on pci1
Mar  9 10:19:40 iwr kernel: ahci0: <Intel Ibex Peak AHCI SATA controller> port 0x3068-0x306f,0x3074-0x3077,0x3060-0x3067,0x3070-0x3073,0x3020-0x303f mem 0xf1b20000-0xf1b207ff irq 18 at device 31.2 on pci0

for a total of 8 SATA disks plugged in.  Boot device is a gmirror of 2x500GB drives.

smartctl fails on all of them, so what they are and where they are plugged in does not appear to matter.

ada7 is not part of a mirror or raid3, so lets try that

```
smartctl  -a /dev/ada7
smartctl 7.3 2022-02-28 r5338 [FreeBSD 12.3-RELEASE-p2 i386] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

error sending CAMIOCOMMAND ioctl: Inappropriate ioctl for device
Unable to get CAM device list
/dev/ada7: Unable to detect device type
Please specify device type with the -d option.

Use smartctl -h to get a usage summary
```

adding a type identifier does not help

```
smartctl -d ata  -a /dev/ada7
smartctl 7.3 2022-02-28 r5338 [FreeBSD 12.3-RELEASE-p2 i386] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

Read Device Identity failed: Inappropriate ioctl for device

If this is a USB connected device, look at the various --device=TYPE variants
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
```


----------



## elimelech007 (Apr 7, 2022)

grahamperrin said:


> Reproducible with 13.1-RC1?
> 
> sysutils/smartmontools can you build 7.3 on i386?


yes, work.
I reinstalled from the ports, and everything worked. Thank you!


----------



## grahamperrin@ (Apr 8, 2022)

elimelech007 said:


> I reinstalled from the ports, and everything worked. Thank you!



Thanks, you can add the _Solved_ prefix.


----------

