Linux查看设备信息—lsscsi命令

网友投稿 2378 2022-11-06

本站部分文章、图片属于网络上可搜索到的公开信息,均用于学习和交流用途,不能代表睿象云的观点、立场或意见。我们接受网民的监督,如发现任何违法内容或侵犯了您的权益,请第一时间联系小编邮箱jiasou666@gmail.com 处理。

Linux查看设备信息—lsscsi命令

1、简介

列出scsi/sata设备信息,比如硬盘驱动器,光盘驱动器。

2、安装

[root@baremetal-3-77 ~]# yum install iscsi*

3、lsscsi命令常用格式

[root@baremetal-3-77 ~]# man lsscsi -s : 显示容量大小。 -c : 用全称显示默认的信息。 -d : 显示设备主,次设备号。 -g : 显示对应的sg设备名。 -H : 显示主机控制器列表,-Hl,-Hlv。 -l : 显示相关属性,-ll,-lll=-L。 -v : 显示设备属性所在目录。 -x : 以16进制显示lun号。 -p : 输出DIF,DIX 保护类型。 -P : 输出有效的保护模式信息。 -i : 显示udev相关的属性 -w : 显示WWN

4、设备及其属性

[root@baremetal-3-77 ~]# lsscsi  [0:2:0:0]   disk   DELL     PERC H330 Mini   4.25 dev/sda  ----------------------------------------------------------------------------------------- 第一列 : SCSI设备id:host, channel,id,lun。 第二列 : 设备类型。 第3,4、5、6,7列 : 设备厂商,型号,版本信息。 最后一列 : 设备主节点名。

5、显示磁盘容量

[root@baremetal-3-77 ~]# lsscsi -s [0:2:0:0]   disk   DELL     PERC H330 Mini   4.25 dev/sda   1.19TB

6、显示SCSI设备(主机)的附加信息

[root@baremetal-3-77 ~]# lsscsi -l [0:2:0:0]   disk   DELL     PERC H330 Mini   4.25 dev/sda   state=running queue_depth=256scsi_level=6type=0device_blocked=0timeout=90

7、显示设备主,次设备号

[root@baremetal-3-77 ~]# lsscsi -d [0:2:0:0]   disk   DELL     PERC H330 Mini   4.25 dev/sda [8:0]

8、输出SCSI通用设备文件名,注意如果sg驱动程序是一个模块,它可能需要加载

[root@baremetal-3-77 ~]# lsscsi -g [0:2:0:0]   disk   DELL     PERC H330 Mini   4.25 dev/sda   dev/sg0

9、重新以只读方式挂载所有已挂载的文件系统

[root@baremetal-3-77 ~]# lsscsi -u lsscsi: invalid option --'u' Usage: lsscsi   [--classic] [--device] [--generic] [--help] [--hosts] [--kname] [--list] [--lunhex] [--long] [--protection] [--scsi_id] [--size] [--sysfsroot=PATH] [--transport] [--verbose] [--version] [--wwn] [] where:    --classic|-c     alternate output similar to 'cat proc/scsi/scsi'    --device|-d       show device node's major + minor numbers    --generic|-g     show scsi generic device name    --help|-h         this usage information    --hosts|-H       lists scsi hosts rather than scsi devices    --kname|-k       show kernel name instead of device nodename    --list|-L         additional information output one                      attribute=value per line    --long|-l         additional information output    --lunhex|-x       show LUN part of tuple as hex number inT10 format;                     use twice to getfull 16digit hexadecimal LUN    --protection|-p   show target and initiator protection information    --protmode|-P     show negotiated protection information mode    --scsi_id|-i     show udev derived dev/disk/by-id/scsi* entry    --size|-s         show disk size    --sysfsroot=PATH|-y PATH    setsysfs mount point to PATH (def: sys)    --transport|-t   transport information fortarget or, if'--hosts'                     given, forinitiator    --verbose|-v     output path names where data is found    --version|-V     output version string and exit    --wwn|-w         output WWN fordisks (from dev/disk/by-id/wwn*)           filter output list (def: '*:*:*:*'(all))  List SCSI devices or hosts, optionally with additional information

10、哪些是固态硬盘(SSD),哪些是SATA盘,哪些是FC盘

[root@baremetal-3-77 ~]# lsscsi -L -t [0:0:0:0]   disk   spi:0                           dev/sda   transport=spi  target_id=0  max_offset=127  max_width=1  min_period=25  offset=0  period=1020  width=0 [2:0:0:0]    cd/dvd ata:                           dev/sr0   transport=ata

11、查看CPU信息

[root@baremetal-3-77 ~]# lscpu  Architecture:         x86_64 CPU op-mode(s):        32-bit, 64-bit Byte Order:           Little Endian CPU(s):                48 On-line CPU(s) list:   0-47 Thread(s) per core:    2 Core(s) per socket:    12 座:                2 NUMA 节点:        2 厂商 ID:          GenuineIntel CPU 系列:         6 型号:             63 型号名称:      Intel(R) Xeon(R) CPU E5-2678 v3 @ 2.50GHz 步进:             2 CPU MHz:            1418.304 CPU max MHz:           3300.0000 CPU min MHz:           1200.0000 BogoMIPS:           4999.85 虚拟化:          VT-x L1d 缓存:        32K L1i 缓存:        32K L2 缓存:          256K L3 缓存:          30720K NUMA 节点0 CPU:   0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46 NUMA 节点1 CPU:   1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47 Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts md_clear spec_ctrl intel_stibp flush_l1d

12、查看USB接口设备信息

[root@baremetal-3-77 ~]# lsusb Bus 001Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001Device 002: ID 8087:800a Intel Corp. Bus 002Device 002: ID 8087:8002 Intel Corp. Bus 003Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003Device 002: ID 04d9:1603 Holtek Semiconductor, Inc. Keyboard Bus 003Device 003: ID 045e:0084 Microsoft Corp. Basic Optical Mouse Bus 003Device 004: ID 413c:a001 Dell Computer Corp. Hub

13、查看块设备信息

[root@baremetal-3-77 ~]# lsblk  NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda      8:0    0 1.1T  0disk  ├─sda1   8:1    0400M  0part /boot ├─sda2   8:2    0  16G  0part [SWAP] └─sda3   8:3    0 1.1T  0part /

扫码

上一篇:Linux检查硬件错误工具—mcelog命令
下一篇:软件测试培训之设计评审
相关文章

 发表评论

暂时没有评论,来抢沙发吧~