# smartmontools after upgrade to FreeBSD 9.0-RELEASE



## Ajira (Feb 10, 2012)

Ok,

So after upgrading to FreeBSD 9.0-RELEASE, suddenly my disks aren't recognized by Smartmontools anymore.


```
/dev/ada0: No such file or directory
Smartctl: please specify device type with the -d option.
```

Yet, after specifying the device with: `/usr/local/sbin/smartctl -d ata -i /dev/ada0`


```
Smartctl: Device Read Identity Failed: Inappropriate ioctl for device
```

Misc info about the device:


```
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <GB0250C8045 HPG6> ATA-7 SATA 1.x device
ada0: 150.000MB/s transfers (SATA 1.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 238475MB (488397168 512 byte sectors: 16H 63S/T 16383C)
ada0: Previously was known as ad4
```

Under FreeBSD 8.2-RELEASE the device was recognized just fine. Aside from the Operating System and newer version of Smartmontools, the only difference is that under FreeBSD 8.2-RELEASE the device was part of an ICHxx RAID array, and right now it's part of a GRAID based array; but that shouldn't have to make any difference, right?

Does any of you have an idea in what region I should start looking for a solution? Any help would be greatly appreciated.


----------



## Ajira (Feb 10, 2012)

I managed to solve it myself. In my kernel *I* forgot to include

```
device pass
```
I must have overlooked it in the documentation. So this thread may be closed and flagged as "solved"


----------



## Ajira (Feb 11, 2012)

After updating the ports, I'm back to square one. 


```
device pass
```

Is enabled in the kernel configuration, just as before. Yet, using smartctl 5.42, the error messages return. Does this mean the port is bugged, or am I just missing something?


----------



## jb_fvwm2 (Feb 11, 2012)

*I*n /dev, you may find the device different than what you'd expect (particularly, since this is an upgrade and not a fresh v9 install). OTOH, maybe rebuild the port again.  (I did both, and ended up also passing a different /dev to smartctl.)


----------



## kpa (Feb 11, 2012)

Is the port installed using a binary package? The i386 package for 9.0 Release (from packages-9.0-release repository) is broken and the only way to get it working is to compile the port yourself.

`# make -C /usr/ports/sysutils/smartmontools install clean`


----------



## Ajira (Feb 12, 2012)

I never install binary packages. I updated the ports with portsnap and then recompiled all the ports with portmanager.
After it broke again, I recompiled the kernel to make absolutely 100% sure that device pass was enabled. I've also recompiled smartmontools from scratch, but all to no avail.


----------



## wblock@ (Feb 12, 2012)

After rereading the first message (sorry), attempting with those options fails with the same error on 8-STABLE.  But this works:
`# smartctl -a /dev/ada0 | less -S`


----------



## Ajira (Feb 12, 2012)

Unfortunately, on my 9.0-RELASE it doesn't. Allthough currently I'm getting a different message from when I first started the thread:


```
/dev/ada0: Operation not permitted
```

At first I thought it had something to do with the kernel security being too high, but lowering my kern.securelevel to 0 didn't seem to make the slightest difference.


----------



## kpa (Feb 12, 2012)

The default for kern.securelevel is actually -1, see security(7). See if it makes a difference if you set it to -1.


----------



## aragon (Feb 12, 2012)

If you're specifying the device type with -d, you need to use "atacam", not "ata".

Smartmontools is written with FreeBSD in mind though, so it should autodetect the device type correctly. (ie. no need to potentially break things with -d)


----------



## Ajira (Feb 14, 2012)

Unfortunately, setting kern.securelevel to -1, and/or specifying "atacam" as device type doesn't make a difference


----------

