Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Dec 2015 08:23:06 -0800
From:      Ravi Pokala <rpokala@mac.com>
To:        "freebsd-scsi@freebsd.org" <freebsd-scsi@freebsd.org>
Subject:   Re: Accessing static drive info w/o ATA identify and lockup with camcontrol identify
Message-ID:  <80BB5907-CC31-4F06-9C70-E6F7834FF28E@panasas.com>

next in thread | raw e-mail | index | archive | help
>Date: Fri, 4 Dec 2015 02:13:31 -0700
>From: Kevin Bowling <kevin.bowling@kev009.com>
>To: freebsd-scsi@freebsd.org
>Subject: Accessing static drive info w/o ATA identify and lockup with
>	camcontrol identify
>Message-ID:
>	<CAK7dMtDw7-eFL0HDik3X6O=QA0jKsbuH9wSOTjDiiQdmJhmKJg@mail.gmail.com>
>Content-Type: text/plain; charset=UTF-8
>
>...
>
>#2 This all came about because I want to poll device information like disk
>model, serial number, speeds, etc.  Common use cases would be configuration
>management systems and inventory databases.  Issuing an ATA identify seems
>a bit much and could trigger unwanted HW errata like above.  I'm wondering
>if it would be better to cache the data on interface change in sysctls or
>something.  The data is static, read only, but we need to account for disk
>swaps.

At least some of it is already available via `geom disk list':

    [daneel:~] rpokala% geom disk list ada5
    Geom name: ada5
    Providers:
    1. Name: ada5
       Mediasize: 2000398934016 (1.8T)
       Sectorsize: 512
       Stripesize: 4096
       Stripeoffset: 0
       Mode: r1w1e1
       descr: WDC WD20EFRX-68EUZN0
       lunid: 50014ee20b9f7c0f
       ident: WD-WCC4M1VN0P7L
       fwsectors: 63
       fwheads: 16



GEOM keeps this data in a "struct disk", which is populated during drive attach. You can see that the drive model ("descr") and serial number ("ident") are already listed by GEOM. "struct disk" also already has a rotation-rate field; if that's what you mean by "speeds", it should be trivial for me to add that to the GEOM output as well.

If by "speeds", you're talking about the connection's bus speed (i.e. 3/6/12Gbps), then that's probably more complicated.

-Ravi (rpokala@)

>Regards,
>Kevin




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?80BB5907-CC31-4F06-9C70-E6F7834FF28E>