获取linux 硬盘的信息,如型号,大小,SN号 等等

http://blog.chinaunix.net/uid-10744505-id-67006.html

如果没用硬raid阵列

用hdpalm 查看 ,如下例

[root@stationX ~]# hdparm -I /dev/hda

/dev/hda:

ATA device, with  non-removable media
         Model Number:       Maxtor 6Y080L0                            
         Serial Number:      Y23QGDGC             
         Firmware Revision:  YAR41BW0
Standards:
        Used: ATA/ATAPI-7 T13 1532D revision  0 
        Supported: 7 6 5 4 
Configuration:
        Logical         max      current
        cylinders       16383    16383
        heads            16      16
        sectors/track   63       63
        --
        CHS current addressable sectors:    16514064
        LBA    user addressable sectors:   156250000
        device size with M = 1024*1024:        76293 MBytes
        device size with M = 1000*1000:        80000 MBytes (80 GB)
Capabilities:
        LBA, IORDY(can be disabled)
        Standby timer values: spec'd by Standard,  no device specific minimum
        R/W multiple sector transfer: Max = 16   Current = 16
        Advanced power management level: unknown  setting (0x0000)
        Recommended acoustic management value:  192, current value: 254
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2  udma3 udma4 *udma5 udma6 
             Cycle time: min=120ns  recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4 
             Cycle time: no flow  control=120ns  IORDY flow control=120ns
Commands/features:
        Enabled Supported:
           *    SMART feature  set
                Security Mode  feature set
           *    Power Management  feature set
           *    Write cache
           *    Look-ahead
           *    Host Protected Area  feature set
           *    WRITE_VERIFY  command
           *    WRITE_BUFFER  command
           *    READ_BUFFER  command
           *    NOP cmd
           *     DOWNLOAD_MICROCODE
                Advanced Power  Management feature set
                SET_MAX  security extension
           *    Automatic Acoustic  Management feature set
           *    Device  Configuration Overlay feature set
           *    Mandatory  FLUSH_CACHE
           *     FLUSH_CACHE_EXT
           *    SMART error  logging
           *    SMART  self-test
Security: 
        Master password revision code =  65534
                 supported
        not     enabled
        not     locked
        not     frozen
        not     expired: security  count
        not     supported: enhanced  erase
HW reset results:
        CBLID- above Vih
        Device num = 0 determined by CSEL
Checksum: correct



有lsi阵列卡的 查看硬盘信息:
[hmp734@dbcsb01 ~]$ sudo /opt/MegaRAID/MegaCli/MegaCli64 -PdList  -aALL
                                      
Adapter #0

Enclosure Device ID: 252
Slot Number: 0
Device Id: 11
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 279.396 GB [0x22ecb25c Sectors]
Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]
Coerced Size: 278.875 GB [0x22dc0000 Sectors]
Firmware state: Online
SAS Address(0): 0x5000c5001ad5671d
SAS Address(1): 0x0
Connected Port Number: 3(path0) 
Inquiry Data: SEAGATE ST9300603SS     00066SE0A7CW             
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Foreign State: None 
Device Speed: Unknown 
Link Speed: Unknown 
Media Type: Hard Disk Device

Enclosure Device ID: 252
Slot Number: 1
Device Id: 10
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 279.396 GB [0x22ecb25c Sectors]
Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]
Coerced Size: 278.875 GB [0x22dc0000 Sectors]
Firmware state: Online
SAS Address(0): 0x5000c5001ad56641
SAS Address(1): 0x0
Connected Port Number: 2(path0) 
Inquiry Data: SEAGATE ST9300603SS     00066SE0AMAK             
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Foreign State: None 
Device Speed: Unknown 
Link Speed: Unknown 
Media Type: Hard Disk Device

Enclosure Device ID: 252
Slot Number: 2
Device Id: 9
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 279.396 GB [0x22ecb25c Sectors]
Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]
Coerced Size: 278.875 GB [0x22dc0000 Sectors]
Firmware state: Online
SAS Address(0): 0x5000c5001ad5e911
SAS Address(1): 0x0
Connected Port Number: 1(path0) 
Inquiry Data: SEAGATE ST9300603SS     00066SE0CA7L             
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Foreign State: None 
Device Speed: Unknown 
Link Speed: Unknown 
Media Type: Hard Disk Device

Enclosure Device ID: 252
Slot Number: 3
Device Id: 8
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 279.396 GB [0x22ecb25c Sectors]
Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]
Coerced Size: 278.875 GB [0x22dc0000 Sectors]
Firmware state: Online
SAS Address(0): 0x5000c5001ad55811
SAS Address(1): 0x0
Connected Port Number: 0(path0) 
Inquiry Data: SEAGATE ST9300603SS     00066SE0A82B             
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Foreign State: None 
Device Speed: Unknown 
Link Speed: Unknown 
Media Type: Hard Disk Device

Enclosure Device ID: 252
Slot Number: 4
Device Id: 12
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 279.396 GB [0x22ecb25c Sectors]
Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]
Coerced Size: 278.875 GB [0x22dc0000 Sectors]
Firmware state: Online
SAS Address(0): 0x5000c5001ad565c1
SAS Address(1): 0x0
Connected Port Number: 4(path0) 
Inquiry Data: SEAGATE ST9300603SS     00066SE0AL6V             
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Foreign State: None 
Device Speed: Unknown 
Link Speed: Unknown 
Media Type: Hard Disk Device

Enclosure Device ID: 252
Slot Number: 5
Device Id: 13
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 279.396 GB [0x22ecb25c Sectors]
Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]
Coerced Size: 278.875 GB [0x22dc0000 Sectors]
Firmware state: Online
SAS Address(0): 0x5000c5001ad5670d
SAS Address(1): 0x0
Connected Port Number: 5(path0) 
Inquiry Data: SEAGATE ST9300603SS     00066SE0AAVC             
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Foreign State: None 
Device Speed: Unknown 
Link Speed: Unknown 
Media Type: Hard Disk Device

Enclosure Device ID: 252
Slot Number: 6
Device Id: 14
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 279.396 GB [0x22ecb25c Sectors]
Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]
Coerced Size: 278.875 GB [0x22dc0000 Sectors]
Firmware state: Online
SAS Address(0): 0x5000c5001ad5e8c1
SAS Address(1): 0x0
Connected Port Number: 6(path0) 
Inquiry Data: SEAGATE ST9300603SS     00066SE09HFF             
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Foreign State: None 
Device Speed: Unknown 
Link Speed: Unknown 
Media Type: Hard Disk Device

Enclosure Device ID: 252
Slot Number: 7
Device Id: 16
Sequence Number: 3
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 279.396 GB [0x22ecb25c Sectors]
Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]
Coerced Size: 278.875 GB [0x22dc0000 Sectors]
Firmware state: Rebuild
SAS Address(0): 0x5000c5000439653d
SAS Address(1): 0x0
Connected Port Number: 7(path0) 
Inquiry Data: SEAGATE ST9300603SS     00043SE0RRBF             
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Foreign State: None 
Device Speed: Unknown 
Link Speed: Unknown 
Media Type: Hard Disk Device


Exit Code: 0x00

你可能感兴趣的:(获取linux 硬盘的信息,如型号,大小,SN号 等等)