jetsung linux 命令行笔记 查看硬盘型号与序号 Model Number就是硬盘型号 Serial Number就是序列号 方式一 先查出硬盘列表: fdisk -l 查看指定的硬盘: sudo hdparm -i /dev/sda (sda 为上述查出的硬盘位置) 结果: /dev/sda: Model=ST1000LM035-1RK172, FwRev=SDM3, SerialNo=WL1JYC5G Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% } RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0 BuffType=unknown, BuffSize=unknown, MaxMultSect=16, MultSect=16 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=1953525168 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 lshw -c disk *-disk:0 description: ATA Disk product: ST1000LM035-1RK1 physical id: 0 bus info: scsi@1:0.0.0 logical name: /dev/sda version: SDM3 serial: WL1JYC5G size: 931GiB (1TB) capabilities: gpt-1.00 partitioned partitioned:gpt configuration: ansiversion=5 guid=017cdcaa-270d-46d7-9c4e-6154df8bf327 logicalsectorsize=512 sectorsize=4096 *-disk:1 description: ATA Disk product: SK hynix SC311 S physical id: 1 bus info: scsi@2:0.0.0 logical name: /dev/sdb version: 0P10 serial: MD88N748311609520 size: 119GiB (128GB) capabilities: gpt-1.00 partitioned partitioned:gpt configuration: ansiversion=5 guid=500e6904-0e74-4420-b372-b6a2a8ef43f5 logicalsectorsize=512 sectorsize=4096
jetsung 获取 CPU ID sudo dmidecode -t 4 | grep ID sudo dmidecode -t 4 | grep ID | sort -u | awk -F ':' '{print $2}'