這次遇到硬碟損毀(Raid 1), 想買同型號的硬碟來換掉, 但是之前都沒留下任何記錄, 不知道要買哪顆硬碟, 如何不拆機器的狀況下, 直接查詢硬體、型號等詳細資訊呢?
於 Linux 如何查看 詳細的硬體資訊、型號
先記錄硬碟的部份, 有下述幾種指令可以使用:
- sudo smartctl -i /dev/sda # 顯示硬碟型號及規格, apt-get install smartmontools
Model Family: Seagate Barracuda 7200.14 (AF)
Device Model: ST2000DM001-1CH164
Serial Number: Z1E3NQMJ
LU WWN Device Id: 5 000c50 050533951
Firmware Version: CC24
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 7200 rpm
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS T13/1699-D revision 4
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s) - sudo hdparm -i /dev/sda1 # apt-get install hdparm
/dev/sda1:
Model=ST2000DM001-1CH164, FwRev=CC29, SerialNo=Z340PKFV
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
BuffType=unknown, BuffSize=unknown, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=3907029168
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
AdvancedPM=yes: unknown setting WriteCache=enabled
Drive conforms to: Reserved: ATA/ATAPI-4,5,6,7* signifies the current active mode
- sudo hdparm -I /dev/sda1 # 更詳細的資訊
要看機器的其他硬體資訊, 有下述程式命令可以使用, 在此就不詳細介紹:
- sudo dmidecode -t # 後面可以接下述的參數
bios
system
baseboard
chassis
processor
memory
cache
connector
slot - ex: sudo dmidecode -t memory # 列出 memory 詳細資訊
- sudo dmidecode -t baseboard # 連主機板型號都會列出來
- lshw
- lspci # list all PCI devices
- lspci -vv
- lspci -nn
- lsusb
- dmesg # print or control the kernel ring buffer
- lsusb # list USB devices
- /proc : process information pseudo-file system
- tree -d /sys/devices