如何在Linux下得到硬盘及usb信息
创始人
2024-03-21 13:50:15
0
如何得到硬盘的信息?
1,用fdisk -l 可以得到系统中已安装的硬盘列表及分区情况
[root@localhost lhd]# fdisk -l
Disk /dev/sda: 40.0 GB, 40060403712 bytes
255 heads, 63 sectors/track, 4870 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf0b1ebb0
Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1275    10241406    c  W95 FAT32 (LBA)
/dev/sda2            1276        4870    28876837+   f  W95 Ext'd (LBA)
/dev/sda5            1276        2550    10241406    b  W95 FAT32
/dev/sda6            2551        2575      200781   83  Linux
/dev/sda7            2576        4870    18434556   8e  Linux LVM
2,如何得到硬盘的品牌及相关信息
1,smartctl -i /dev/sda
说明: smartctl是用来控制和监视 smart disk的程序
 -i 参数用来显示设备的相关信息
              
例:
[root@localhost lhd]# smartctl -i /dev/sda
smartctl version 5.38 [i386-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF INFORMATION SECTION ===
Device Model:     SAMSUNG MP0402H
Serial Number:    S03WJ10YC01628
Firmware Version: UC100-11
User Capacity:    40,060,403,712 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   7
ATA Standard is:  ATA/ATAPI-7 T13 1532D revision 0
Local Time is:    Wed Jan 28 23:21:47 2009 CST
==> WARNING: May need -F samsung or -F samsung2 enabled; see manual for details.
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
2,有时使用smartctl不能得到我们预期的信息,例如:
[root@dev ~]# smartctl -i /dev/sda
smartctl version 5.36 [i686-redhat-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
Device: Dell     VIRTUAL DISK     Version: 1028
Device type: disk
Local Time is: Wed Jan 28 23:09:50 2009 CST
Device does not support SMART
这种情况如何处理:
    
[root@dev ~]# cat /proc/scsi/scsi                  
Attached devices:                                  
Host: scsi0 Channel: 00 Id: 00 Lun: 00              
Vendor: SEAGATE  Model: ST3146855SS      Rev: S527
Type:   Direct-Access                    ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 01 Lun: 00
Vendor: SEAGATE  Model: ST3146855SS      Rev: S527
Type:   Direct-Access                    ANSI SCSI revision: 05
Host: scsi0 Channel: 01 Id: 00 Lun: 00
Vendor: Dell     Model: VIRTUAL DISK     Rev: 1028
Type:   Direct-Access                    ANSI SCSI revision: 05
   
   
   
   
3,如何得到usb设备的信息
lsusb
例如:
[root@localhost lhd]# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 046d:c00f Logitech, Inc. MouseMan Traveler/Mobile
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
查看详细信息,可以加 -v
lsusb -v
查看某一个设备:
[root@localhost lhd]# lsusb -s 003:002 -v                           
Bus 003 Device 002: ID 046d:c00f Logitech, Inc. MouseMan Traveler/Mobile
Device Descriptor:                                                      
bLength                18                                             
bDescriptorType         1                                             
bcdUSB               2.00                                             
bDeviceClass            0 (Defined at Interface level)                
bDeviceSubClass         0                                             
bDeviceProtocol         0                                             
bMaxPacketSize0         8                                             
idVendor           0x046d Logitech, Inc.                              
idProduct          0xc00f MouseMan Traveler/Mobile                    
bcdDevice           11.10                                             
iManufacturer           1 Logitech                                    
iProduct                2 USB-PS/2 Optical Mouse                      
iSerial                 0                                             
bNumConfigurations      1                                             
Configuration Descriptor:                                             
bLength                 9                                           
bDescriptorType         2                                           
wTotalLength           34                                           
bNumInterfaces          1                                           
bConfigurationValue     1                                           
iConfiguration          0                                           
bmAttributes         0xa0                                           
(Bus Powered)                                                     
Remote Wakeup
MaxPower               98mA
Interface Descriptor:
bLength                 9
bDescriptorType         4
bInterfaceNumber        0
bAlternateSetting       0
bNumEndpoints           1
bInterfaceClass         3 Human Interface Device
bInterfaceSubClass      1 Boot Interface Subclass
bInterfaceProtocol      2 Mouse
iInterface              0
HID Device Descriptor:
bLength                 9
bDescriptorType        33
bcdHID               1.10
bCountryCode            0 Not supported
bNumDescriptors         1
bDescriptorType        34 Report
wDescriptorLength      52
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength                 7
bDescriptorType         5
bEndpointAddress     0x81  EP 1 IN
bmAttributes            3
Transfer Type            Interrupt
Synch Type               None
Usage Type               Data
wMaxPacketSize     0x0004  1x 4 bytes
bInterval              10
Device Status:     0x0000
(Bus Powered)

【编辑推荐】

  1. 实验——LINUX常用网络测试命令
  2. 嵌入式设备上的Linux系统开发
  3. Linux 操作指导专题(华为内部)

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...
德国电信门户网站可实时显示全球... 德国电信周三推出一个门户网站,直观地实时提供其安装在全球各地的传感器网络检测到的网络攻击状况。该网站...
为啥国人偏爱 Mybatis,... 关于 SQL 和 ORM 的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行...
《非诚勿扰》红人闫凤娇被曝厕所... 【51CTO.com 综合消息360安全专家提醒说,“闫凤娇”、“非诚勿扰”已经被黑客盯上成为了“木...
2012年第四季度互联网状况报... [[71653]]  北京时间4月25日消息,据国外媒体报道,全球知名的云平台公司Akamai Te...