How to obtain hard disk and usb information in Linux

Source: Internet
Author: User

How do I get the hard disk information?
1. Use fdisk-l to obtain the list of installed hard disks and partition information in the system.
[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. How to obtain the hard drive brand and related information
1, smartctl-I/dev/sda
Note: smartctl is a program used to control and monitor smart disks.
-The I parameter is used to display device information.

Example:
[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. Sometimes smartctl cannot get the expected information, for example:
[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
How to deal with this situation:

[Root @ dev ~] # Cat/proc/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. How to obtain information about a usb device
Lsusb
For example:
[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
You can add-v to view details.
Lsusb-v
View a device:
[Root @ localhost lhd] # lsusb-s 00: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 1x4 bytes
BInterval 10
Device Status: 0x0000
(Bus Powered)

  1. Experiment-common LINUX Network Test commands
  2. Development of Linux systems on embedded devices
  3. Linux operation guide (inside Huawei)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.