From owner-freebsd-scsi@freebsd.org Mon Oct 9 18:25:26 2017 Return-Path: Delivered-To: freebsd-scsi@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2E68E3855A for ; Mon, 9 Oct 2017 18:25:26 +0000 (UTC) (envelope-from chuck@tuffli.net) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94F5B7589D for ; Mon, 9 Oct 2017 18:25:26 +0000 (UTC) (envelope-from chuck@tuffli.net) Received: by mail-it0-x22c.google.com with SMTP id g18so13948269itg.5 for ; Mon, 09 Oct 2017 11:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuffli-net.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=xZxbz6ouI+btyP46rHwo4NV8QqB279viB0PoRyAf/c8=; b=i0oPI0QVBovkJRezc3BVeH55W+ecCBqT/Bh7IZfI8W3gW2CTq/ofLqDjJlrKo+j6of idPwr5bS2YtzstveLW63HGtAgzGbt7WJvQqWM9ngkRCxc7GGgMHaBXD9ypzJ1FIyokdL zYJm3ULTecPiCdN/Su0PiC4YRJ+guPIrSuB6K9vQfoEG5hwbWa/pxinUOrHQ/RX33sB3 d4NeghQqYGddrFDj9ZcS7GXfHzqqtPFjK7+crxr5EDQy7akESf9HGsJTKqqh7eK5U/8n d3zWVYhK4DipYIVqBjgiylCneonH72ry5PGu9UI+oC7JVknnfl3Q56Hg0dml4Wax9oGw Pn/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=xZxbz6ouI+btyP46rHwo4NV8QqB279viB0PoRyAf/c8=; b=oA4VEakXRYaoHolW42pzUDcPOeCjsx1zb2i24Pq2BPfppEbCDsUBFCscs8cJNvMfNs IRQPqmT+PEpBXHipJkYrkWtG5xq+ZnO4Khnc1hEJXT4uHhOEgNKQtWu7zHV6ntr6cwZP fhx4bkrCPzjZsj8fMJP05MHWK28KLoSxIov+AphatUXQWRjLepa1x7x2OM0il0h324fn sa4mkjNW28/SL22KKf+KpUj3pIqI1/XzvnA7Nd/7X5H+5gKtd3RM2W93VvMQAAmSCSoQ lDeHNiTWjtRggygpQF7YPm0ToGRM8lNKuanhn/0OpW1PEp97KVhvBX3BiWVpgX7Vun+v vk2A== X-Gm-Message-State: AMCzsaXnTgRcQ67wHKhp3Em2b2aPGK6BHsqA2ifblBtjafnL5je5XymB s1/Ye9qiFzCkmprvKHPHwjk/Z/XL+Nl80uceP8t0RnTp X-Google-Smtp-Source: AOwi7QCAWuNTW+OUpYHPihr0M5SofrG4lCxeUDShXfTjSJaEwOcQ77VjJC2i0Qszh8vKJ5Wrk9B+DE0Z+qf+H5FNdBE= X-Received: by 10.36.141.65 with SMTP id w62mr2343083itd.152.1507573525561; Mon, 09 Oct 2017 11:25:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.92.147 with HTTP; Mon, 9 Oct 2017 11:25:25 -0700 (PDT) From: Chuck Tuffli Date: Mon, 9 Oct 2017 11:25:25 -0700 Message-ID: Subject: [RFC] native SMART library / tool To: freebsd-scsi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 18:25:26 -0000 At AsiaBSDCon 2016, Michael Dexter proposed =E2=80=9Cdiskctl(8): A permissively-licensed S.M.A.R.T. and raw disk command utility framework=E2=80=9D [1]. While the proposal had ambitious goals, I was specifically curious about how to report SMART attributes across SATA, SCSI, and NVMe in a standardized way that might be useful to other applications. After some experimentation and feedback from Michael, I have code [2] that can retrieve SMART attributes from each of the above protocols. The code is functional but not in its final form as I wanted some feedback from the community first. Things which would be useful: - does this work on your drive(s)? - is the output useful? if not, what do you need? - is the library interface useful? if not, what's missing / needed? Keep in mind, the scope of the code is intentionally narrow (i.e. retrieve SMART values), but please mention features you think would be useful. Also note, that retrieving NVMe SMART values requires -CURRENT. [1] https://www.bsdcan.org/2016/schedule/attachments/339_AsiaBSDCon-diskctl= .pdf [2] https://bitbucket.org/ctuffli/smart