Getting Disk information on FreeBSD

These commands will find any disk attached and recognized by your Kernel with the exception of some raid cards / HBAs. These were run on a FreeBSD-11 machine, some ancient versions of FreeBSD also had ata type tools, but they are no longer applicable. There are other ports that handle disks and disk information, but these are just the ones that I use the most often.

sysctl kern.disks

root@crashbox:~ # sysctl kern.disks  
kern.disks: ada3 ada2 ada1 ada0  

camcontrol devlist note: requires to be logged in as root

root@crashbox:~ # camcontrol devlist  
<WDC WD6000HLHX-01JJPV0 04.05G04>  at scbus0 target 0 lun 0 (pass0,ada0)  
<WDC WD6000HLHX-01JJPV0 04.05G04>  at scbus1 target 0 lun 0 (pass1,ada1)  
<WDC WD15EARS-00MVWB0 51.0AB51>    at scbus2 target 0 lun 0 (pass2,ada2)  
<WDC WD15EARS-00MVWB0 51.0AB51>    at scbus3 target 0 lun 0 (pass3,ada3)

zpool status -- note, this only shows disks in ZFS that are part of an imported pool

root@crashbox:~ # zpool status  
  pool: storage
 state: ONLINE
  scan: none requested
config:

    NAME          STATE     READ WRITE CKSUM
    storage       ONLINE       0     0     0
      mirror-0    ONLINE       0     0     0
        ada2.eli  ONLINE       0     0     0
        ada3.eli  ONLINE       0     0     0

errors: No known data errors

  pool: zroot
 state: ONLINE
  scan: none requested
config:

    NAME            STATE     READ WRITE CKSUM
    zroot           ONLINE       0     0     0
      mirror-0      ONLINE       0     0     0
        ada0p3.eli  ONLINE       0     0     0
        ada1p3.eli  ONLINE       0     0     0

errors: No known data errors  

geom disk list

root@crashbox:~ # geom disk list  
Geom name: ada0  
Providers:  
1. Name: ada0  
   Mediasize: 600127266816 (559G)
   Sectorsize: 512
   Mode: r2w2e4
   descr: WDC WD6000HLHX-01JJPV0
   lunid: 50014ee700009a4c
   ident: WD-WXF1E7AAAJY2
   rotationrate: 10000
   fwsectors: 63
   fwheads: 16

Geom name: ada1  
Providers:  
1. Name: ada1  
   Mediasize: 600127266816 (559G)
   Sectorsize: 512
   Mode: r2w2e4
   descr: WDC WD6000HLHX-01JJPV0
   lunid: 50014ee0adde15f9
   ident: WD-WX41E8AAA909
   rotationrate: 10000
   fwsectors: 63
   fwheads: 16

Geom name: ada2  
Providers:  
1. Name: ada2  
   Mediasize: 1500301910016 (1.4T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   descr: WDC WD15EARS-00MVWB0
   lunid: 50014ee2b02187a1
   ident: WD-WCAZA3AAA825
   rotationrate: unknown
   fwsectors: 63
   fwheads: 16

Geom name: ada3  
Providers:  
1. Name: ada3  
   Mediasize: 1500301910016 (1.4T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   descr: WDC WD15EARS-00MVWB0
   lunid: 50014ee2b0217787
   ident: WD-WCAZA3AAA201
   rotationrate: unknown
   fwsectors: 63
   fwheads: 16

smartctl --scan note: requires to be logged in as root. In ports sysutils/smartmontools

root@crashbox:~ # smartctl --scan  
/dev/ada0 -d atacam # /dev/ada0, ATA device
/dev/ada1 -d atacam # /dev/ada1, ATA device
/dev/ada2 -d atacam # /dev/ada2, ATA device
/dev/ada3 -d atacam # /dev/ada3, ATA device
Show Comments