首页 > 代码库 > linux 下查看硬盘型号、大小等信息(含Raid)
linux 下查看硬盘型号、大小等信息(含Raid)
linux 下查看硬盘型号、大小等信息,机器有没有做Raid有关系
一、普通模式(该机硬盘没有做磁盘阵列)
1、fdisk -l 查看你的硬盘编号,如sda,sdb 等
2、smartctl --all /dev/sda
smartctl --all /dev/sda #该命令centos自带
[root@localhost ~]# smartctl --all /dev/sdasmartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-504.el6.x86_64] (local build)Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net=== START OF INFORMATION SECTION ===Device Model: SanDisk SD6SB1M128G1022ISerial Number: 141218410909LU WWN Device Id: 5 001b44 becdaed9dFirmware Version: X231600User Capacity: 128,035,676,160 bytes [128 GB]Sector Size: 512 bytes logical/physicalDevice is: Not in smartctl database [for details use: -P showall]ATA Version is: 8ATA Standard is: ATA-8-ACS revision 6Local Time is: Fri Jan 16 08:35:48 2015 CSTSMART support is: Available - device has SMART capability.SMART support is: Enabled
从上面可以看出,硬盘型号为SanDisk SD6SB1M128G1022I,容量为128GB
二、磁盘阵列 RAID模式
如果该机有做磁盘阵列,那么运行上述命令会报错,得不到你要的磁盘信息。可以借助MegaCli命令
MegaCli命令系统不自带,需要额外下载,
下载地址:
http://www.lsi.com/downloads/Public/RAID%20Controllers/RAID%20Controllers%20Common%20Files/8.07.14_MegaCLI.zip
下载之后解压,
unzip CSA1.5-MegaCli_REL80571.zip
cd MegaCLI/MegaCli_Linux
rpm -ivh MegaCli-8.05.71-1.noarch.rpm
安装完成
ln -s /opt/MegaRAID/MegaCli/MegaCli64 /usr/bin/
默认安装在/opt下面,建立软链到/usr/bin
[root@localhost bin]# /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -aALLAdapter #0Enclosure Device ID: 32Slot Number: 0Drive's position: DiskGroup: 0, Span: 0, Arm: 0Enclosure position: 1Device Id: 0WWN: 50000C0F02E57BE9Sequence Number: 2Media Error Count: 0Other Error Count: 0Predictive Failure Count: 0Last Predictive Failure Event Seq Number: 0PD Type: SASRaw Size: 279.396 GB [0x22ecb25c Sectors]Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]Coerced Size: 278.875 GB [0x22dc0000 Sectors]Sector Size: 0Firmware state: Online, Spun UpDevice Firmware Level: D1S6Shield Counter: 0Successful diagnostics completion on : N/ASAS Address(0): 0x50000c0f02e57beaSAS Address(1): 0x0Connected Port Number: 0(path0)Inquiry Data: WD WD3001BKHG D1S6WX11E83NU249FDE Capable: Not CapableFDE Enable: DisableSecured: UnsecuredLocked: UnlockedNeeds EKM Attention: NoForeign State: NoneDevice Speed: 6.0Gb/sLink Speed: 6.0Gb/sMedia Type: Hard Disk DeviceDrive Temperature :31C (87.80 F)PI Eligibility: NoDrive is formatted for PI information: NoPI: No PIPort-0 :Port status: ActivePort's Linkspeed: 6.0Gb/sPort-1 :Port status: ActivePort's Linkspeed: UnknownDrive has flagged a S.M.A.R.T alert : NoEnclosure Device ID: 32Slot Number: 1Drive's position: DiskGroup: 0, Span: 0, Arm: 1Enclosure position: 1Device Id: 1WWN: 50000C0F028F32EDSequence Number: 2Media Error Count: 0Other Error Count: 0Predictive Failure Count: 0Last Predictive Failure Event Seq Number: 0PD Type: SASRaw Size: 279.396 GB [0x22ecb25c Sectors]Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]Coerced Size: 278.875 GB [0x22dc0000 Sectors]Sector Size: 0Firmware state: Online, Spun UpDevice Firmware Level: D1S6Shield Counter: 0Successful diagnostics completion on : N/ASAS Address(0): 0x50000c0f028f32eeSAS Address(1): 0x0Connected Port Number: 1(path0)Inquiry Data: WD WD3001BKHG D1S6WX11E83VD242FDE Capable: Not CapableFDE Enable: DisableSecured: UnsecuredLocked: UnlockedNeeds EKM Attention: NoForeign State: NoneDevice Speed: 6.0Gb/sLink Speed: 6.0Gb/sMedia Type: Hard Disk DeviceDrive Temperature :31C (87.80 F)PI Eligibility: NoDrive is formatted for PI information: NoPI: No PIPort-0 :Port status: ActivePort's Linkspeed: 6.0Gb/sPort-1 :Port status: ActivePort's Linkspeed: UnknownDrive has flagged a S.M.A.R.T alert : NoEnclosure Device ID: 32Slot Number: 2Drive's position: DiskGroup: 0, Span: 0, Arm: 2Enclosure position: 1Device Id: 2WWN: 50000C0F02E5B8EDSequence Number: 2Media Error Count: 0Other Error Count: 0Predictive Failure Count: 0Last Predictive Failure Event Seq Number: 0PD Type: SASRaw Size: 279.396 GB [0x22ecb25c Sectors]Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]Coerced Size: 278.875 GB [0x22dc0000 Sectors]Sector Size: 0Firmware state: Online, Spun UpDevice Firmware Level: D1S6Shield Counter: 0Successful diagnostics completion on : N/ASAS Address(0): 0x50000c0f02e5b8eeSAS Address(1): 0x0Connected Port Number: 2(path0)Inquiry Data: WD WD3001BKHG D1S6WX11E83NU081FDE Capable: Not CapableFDE Enable: DisableSecured: UnsecuredLocked: UnlockedNeeds EKM Attention: NoForeign State: NoneDevice Speed: 6.0Gb/sLink Speed: 6.0Gb/sMedia Type: Hard Disk DeviceDrive Temperature :28C (82.40 F)PI Eligibility: NoDrive is formatted for PI information: NoPI: No PIPort-0 :Port status: ActivePort's Linkspeed: 6.0Gb/sPort-1 :Port status: ActivePort's Linkspeed: UnknownDrive has flagged a S.M.A.R.T alert : NoExit Code: 0x00
从上面可以看出,该机有三块硬盘,型号为,
WD WD3001BKHG D1S6WX11E83NU249,容量为300GB。
linux 下查看硬盘型号、大小等信息(含Raid)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。