smartctl: Unrecognized command 13

Andriy Gapon avg at freebsd.org
Mon Jul 27 12:16:20 UTC 2009


on 25/07/2009 11:48 Andriy Gapon said the following:
> This is stable/7 i386:
> 
> $ smartctl -t select,568157535-568159000 /dev/ad10
> ...
> Unrecognized command 13 in ata_command_interface()
> Please contact smartmontools-support at lists.sourceforge.net
> Error Write Selective Self-Test Log failed: Function not implemented
> 
> In smartmontools sources this is command WRITE_LOG.
> Is this something that can be patched in smartmontools or does it require
> additional support from ata driver?

I think the patch like the following could do the trick:
--- os_freebsd.cpp.orig	2008-03-05 00:09:47.000000000 +0200
+++ os_freebsd.cpp	2009-07-27 14:02:38.948144118 +0300
@@ -341,6 +340,15 @@
     request.count=512;
     copydata=1;
     break;
+  case WRITE_LOG:
+    memcpy(buff, data, 512);
+    request.u.ata.feature=ATA_SMART_WRITE_LOG_SECTOR;
+    request.u.ata.lba=select|(0xc24f<<8);
+    request.u.ata.count=1;
+    request.flags=ATA_CMD_WRITE;
+    request.data=(char *)buff;
+    request.count=512;
+    break;
   case IDENTIFY:
     request.u.ata.command=ATA_IDENTIFY_DEVICE;
     request.flags=ATA_CMD_READ;

-- 
Andriy Gapon


More information about the freebsd-stable mailing list