Disk Information

最後更新: 2019-11-04

目錄


lsblk

 

# Centos Package: util-linux-ng

# Produces information about all block devices, such as hard disks, DVD readers and more.

NAME                       MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                          8:0    0 931.5G  0 disk
└─sda1                       8:1    0 931.5G  0 part
sdb                          8:16   0 232.9G  0 disk
├─sdb1                       8:17   0  18.6G  0 part /ssd/xpenology
└─sdb3                       8:19   0  65.2G  0 part /ssd/admin
sdc                          8:32   0 931.5G  0 disk
├─sdc1                       8:33   0    94M  0 part /boot
├─sdc2                       8:34   0  11.2G  0 part /
├─sdc3                       8:35   0 793.3G  0 part
│ ├─myvg-kvm (dm-0)        252:0    0   400G  0 lvm  /kvm
│ ├─myvg-nginx (dm-1)      252:1    0    10G  0 lvm
│ ├─myvg-data (dm-2)       252:2    0    20G  0 lvm
..........

Other OPTS:

-f, --fs                # equivalent to "-o NAME,FSTYPE,LABEL,MOUNTPOINT"

NAME   FSTYPE LABEL UUID                                 MOUNTPOINT
sda
├─sda1 vfat         5FED-8B1E                            /boot/efi
├─sda2 xfs          10b62f98-51fc-4f7d-a752-301b1dabd55f /boot
...

-t, --topology      # equivalent to "-o NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,RQ-SIZE,RA,WSAME"

NAME   ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED    RQ-SIZE  RA WSAME
sda            0   4096      0    4096     512    0 deadline     128 128    0B
├─sda1         0   4096      0    4096     512    0 deadline     128 128    0B
....

lsscsi

 

# Uses information in sysfs (Linux kernel series 2.6 and later) to list SCSI devices (or hosts) currently attached to the system.

[1:0:0:0]    disk    ATA      WDC WD10EAVS-00D 01.0  /dev/sda
[2:0:0:0]    disk    ATA      Samsung SSD 850  EMT0  /dev/sdb
[3:0:0:0]    disk    ATA      WDC WD10EZEX-08R 80.0  /dev/sdc
[10:0:0:0]   disk    ASMT     2105             0     /dev/sdd

# List the SCSI hosts currently attached to the system.

lsscsi -H

[0]    ahci
[1]    ahci
[2]    ahci
[3]    ahci
[10]    usb-storage

# <attribute_name>=<value> pairs

lsscsi -L

[1:0:0:0]    disk    ATA      WDC WD10EAVS-00D 01.0  /dev/sda
  device_blocked=0
  iocounterbits=32
  iodone_cnt=0xfc84c2
  ioerr_cnt=0x2
  iorequest_cnt=0xfc86d6
  queue_depth=31
  queue_type=simple
  scsi_level=6
  state=running
  timeout=30
  type=0

Useful opts

  • -d                 # SCSI device name, the  device node major and minor (/dev/sda [8:0])
[0:2:0:0]    disk    LSI      RAID 5/6 SAS 6G  2.13  /dev/sdd [8:48]
  • -s                 # size
[0:2:0:0]    disk    LSI      RAID 5/6 SAS 6G  2.13  /dev/sdd   6.00TB