linux
linux系统的硬盘信息怎么查看?
一、linux系统的硬盘信息怎么查看?
查看Linux系统的硬盘信息的方法有很多,以下为你推荐几种:
使用“df -h”命令。
使用“lsblk”命令。
使用“sudo lshw -class disk”命令。
使用“fdisk -l”命令。
使用“cat /proc/partitions”命令。
使用“lsscsi”命令。
使用“smartctl -a /dev/sda”命令。
使用RAID管理工具查看(如LSI的MegaCli)。
二、Linux下如何获取CPU/内存/硬盘等硬件信息?
dmidecode 是一个工具或命令,以人类可读的格式检索系统硬件的有用信息。dmidecode 可用于所有类似 Linux 的系统 (RHEL, CentOS, Debian 和 SUSE)。dmidecode 代表 DMI (Desktop Management Interface) 它从 DMI 表中读取数据,并以人类可读的格式展示给我们。DMI 表保存了系统硬件的详细信息,如 BIOS,序列号,RAM 和 CPU 详细信息等,除此之外,dmidecode 还可以检索关于系统支持的最大配置的详细信息。
在本文中,我们将介绍 12 个Linux 系统下 dmidecode 相关示例。
1) dmidecode 命令输出
When we run the dmidecode command then it displays the output on the screen, in the output we have the records, each record has 4 different values.
当我们运行 dmidecode 命令时,会在屏幕上输出记录,每个记录有 4 个不同的值。
- Handle – 唯一标识符号
- Type – 它讲述的是硬件组成,在下面的示例中,DMI 类型 38 指的是 IPMI 设备
- Size – 记录大小
- Decoded value – 关于记录类型的信息,在下面的示例中,IPMI 设备的解码值是接口类型,规格版本,基址和寄存器间距
让我们运行 dmidecode 命令
[root@linuxtechi ~]# dmidecode | more
输出如下所示
2) 用于 dmidecode 命令不同的 DMI 类型
以下是 dmidecode 命令中使用的 DMI 类型
Type Information
--------------------------------------------
0 BIOS
1 System
2 Baseboard
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
40 Additional Information
41 Onboard Devices Extended Information
42 Management Controller Host Interface
Keyword Types
------------------------------
bios 0, 13
system 1, 12, 15, 23, 32
baseboard 2, 10, 41
chassis 3
processor 4
memory 5, 6, 16, 17
cache 7
connector 8
slot 9
3) 使用类型 id 显示硬件信息
在 dmidecode 命令中,我们可以使用关键字或类型 id 来获取系统的硬件信息。在例 2 中,我们已经列出了关键字及其类型 id。让我们假设我们想要显示系统的 cache 信息,然后我们可以运行下面的任何命令
[root@linuxtechi ~]# dmidecode -t cache
Or
[root@linuxtechi ~]# dmidecode -t 7
# dmidecode 2.12
SMBIOS 2.5 present.
Handle 0x009C, DMI type 7, 19 bytes
Cache Information
Socket Designation: L1-Cache
Configuration: Enabled, Not Socketed, Level 1
Operational Mode: Write Back
Location: Internal
Installed Size: 192 kB
Maximum Size: 192 kB
Supported SRAM Types:
Synchronous
Installed SRAM Type: Synchronous
Speed: Unknown
Error Correction Type: Single-bit ECC
System Type: Data
Associativity: 8-way Set-associative
Handle 0x009D, DMI type 7, 19 bytes
Cache Information
Socket Designation: L1-Cache
Configuration: Enabled, Not Socketed, Level 1
Operational Mode: Write Back
Location: Internal
Installed Size: 192 kB
Maximum Size: 192 kB
Supported SRAM Types:
Synchronous
Installed SRAM Type: Synchronous
Speed: Unknown
Error Correction Type: Single-bit ECC
System Type: Instruction
Associativity: 4-way Set-associative
…………………………………………………………………………
4) 显示 BIOS 信息
运行 dmidecode 命令后输入 bios 作为类型
[root@linuxtechi ~]# dmidecode --type bios
Or
[root@linuxtechi ~]# dmidecode -t bios
# dmidecode 2.12
SMBIOS 2.5 present.
Handle 0x0005, DMI type 0, 24 bytes
BIOS Information
Vendor: Intel Corp.
Version: QSSC-S4R.QCI.01.00.0037.061120141015
Release Date: 06/11/2014
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 16384 kB
Characteristics:
PCI is supported
PNP is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
EDD is supported
3.5"/2.88 MB floppy services are supported (int 13h)
Print screen service is supported (int 5h)
8042 keyboard services are supported (int 9h)
Serial services are supported (int 14h)
CGA/mono video services are supported (int 10h)
ACPI is supported
USB legacy is supported
LS-120 boot is supported
ATAPI Zip drive boot is supported
Function key-initiated network boot is supported
Targeted content distribution is supported
BIOS Revision: 17.18
Firmware Revision: 0.0
5) 显示机箱硬件信息
执行以下 dmidecode 命令显示机箱信息
[root@linuxtechi ~]# dmidecode -t chassis
# dmidecode 2.12
SMBIOS 2.5 present.
Handle 0x0004, DMI type 3, 22 bytes
Chassis Information
Manufacturer: ..............................
Type: Main Server Chassis
Lock: Not Present
Version: 32S4RCS0010
Serial Number: QTFCVR1110136
Asset Tag: ....................
Boot-up State: Safe
Power Supply State: Safe
Thermal State: Safe
Security Status: Unknown
OEM Information: 0x01000181
Height: 1 U
Number Of Power Cords: 1
Contained Elements: 0
SKU Number: Not Specified
6) 显示底板硬件信息
执行下面的 dmidecode 命令来显示关于系统底板的硬件信息
[root@linuxtechi ~]# dmidecode -t baseboard
# dmidecode 2.12
SMBIOS 2.5 present.
Handle 0x0003, DMI type 2, 16 bytes
Base Board Information
Manufacturer: QCI
Product Name: QSSC-S4R
Version: 31S4RMB00B0
Serial Number: LVR1340271
Asset Tag: ....................
Features:
Board is a hosting board
Board is replaceable
Location In Chassis: Not Specified
Chassis Handle: 0x0004
Type: Motherboard
Contained Object Handles: 0
Handle 0x0027, DMI type 10, 6 bytes
On Board Device Information
Type: Video
Status: Enabled
Description: ServerEngines Pilot II
Handle 0x0028, DMI type 10, 6 bytes
On Board Device Information
Type: Ethernet
Status: Enabled
Description: Intel Dual GbE #1
Handle 0x0029, DMI type 10, 6 bytes
On Board Device Information
Type: Ethernet
Status: Enabled
Description: Intel Dual GbE #2
Handle 0x002A, DMI type 10, 6 bytes
On Board Device Information
Type: SATA Controller
Status: Enabled
Description: ICH10 Integrated SATA Controller
7) 显示系统的硬件信息
要显示有关系统的硬件信息(制造商、产品名称和序列号等),运行以下 dmidecode 命令
[root@linuxtechi ~]# dmidecode -t system
# dmidecode 2.12
SMBIOS 2.5 present.
Handle 0x0002, DMI type 1, 27 bytes
System Information
Manufacturer: QCI
Product Name: QSSC-S4R
Version: ....................
Serial Number: ............
UUID: 2DD583E2-4A58-11E0-A580-00101859A783
Wake-up Type: AC Power Restored
SKU Number: Not Specified
Family: Not Specified
Handle 0x002C, DMI type 12, 5 bytes
System Configuration Options
Option 1: J5C3 2-3: Close to clear Password
Handle 0x002D, DMI type 12, 5 bytes
System Configuration Options
Option 1: J5C2 2-3: Close to clear CMOS
Handle 0x002E, DMI type 12, 5 bytes
System Configuration Options
Option 1: J6D1 2-3: Close for BIOS Recovery
Handle 0x002F, DMI type 12, 5 bytes
System Configuration Options
Option 1: J5C1 2-3: Close to Force ME Update Mode
Handle 0x0030, DMI type 12, 5 bytes
System Configuration Options
Option 1: J9C3: SATA RAID Key
Handle 0x0031, DMI type 12, 5 bytes
System Configuration Options
Option 1: J5A1 2-3: Close to Force BMC Update Mode
Handle 0x0034, DMI type 32, 20 bytes
System Boot Information
Status: No errors detected
8) 显示已安装的内存信息
要显示有关已安装的物理内存(RAM)的信息,请运行以下命令
[root@linuxtechi ~]# dmidecode -t 17
# dmidecode 2.12
SMBIOS 2.5 present.
Handle 0x0043, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0035
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 72 bits
Size: 4096 MB
Form Factor: DIMM
Set: 1
Locator: DIMM_1B
Bank Locator: MEM1 SLOT
Type: DDR3
Type Detail: Synchronous
Speed: 1067 MHz
Manufacturer: 0x0198
Serial Number: 0xA504DB27
Asset Tag: Unknown
Part Number: 9965426-047.A00LF
Handle 0x0045, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0035
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 72 bits
Size: 4096 MB
Form Factor: DIMM
Set: 2
Locator: DIMM_1A
Bank Locator: MEM1 SLOT
Type: DDR3
Type Detail: Synchronous
Speed: 1067 MHz
Manufacturer: 0x830B
Serial Number: 0x6C443023
…………………………………………………………
使用下面的 dmidecode 命令查找系统支持的最大物理内存
[root@linuxtechi ~]# dmidecode -t 16
# dmidecode 2.12
SMBIOS 2.5 present.
Handle 0x0035, DMI type 16, 15 bytes
Physical Memory Array
Location: Proprietary Add-on Card
Use: System Memory
Error Correction Type: Multi-bit ECC
Maximum Capacity: 256 GB
Error Information Handle: Not Provided
Number Of Devices: 8
Handle 0x0037, DMI type 16, 15 bytes
Physical Memory Array
Location: Proprietary Add-on Card
Use: System Memory
Error Correction Type: Multi-bit ECC
Maximum Capacity: 256 GB
Error Information Handle: Not Provided
Number Of Devices: 8
Handle 0x0039, DMI type 16, 15 bytes
Physical Memory Array
Location: Proprietary Add-on Card
Use: System Memory
Error Correction Type: Multi-bit ECC
Maximum Capacity: 256 GB
Error Information Handle: Not Provided
Number Of Devices: 8
……………………………………………………………
9) 显示关于处理器的硬件信息
执行以下 dmidecode 命令显示处理器或 CPU 插座的硬件信息
[root@linuxtechi ~]# dmidecode -t processor
or
[root@linuxtechi ~]# dmidecode -t 4
# dmidecode 2.12
SMBIOS 2.5 present.
Handle 0x009B, DMI type 4, 40 bytes
Processor Information
Socket Designation: CPU1
Type: Central Processor
Family: Xeon MP
Manufacturer: Intel(R) Corporation
ID: E6 06 02 00 FF FB EB BF
Signature: Type 0, Family 6, Model 46, Stepping 6
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (Time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)
CMOV (Conditional move instruction supported)
PAT (Page attribute table)
PSE-36 (36-bit page size extension)
CLFSH (CLFLUSH instruction supported)
DS (Debug store)
ACPI (ACPI supported)
MMX (MMX technology supported)
FXSR (FXSAVE and FXSTOR instructions supported)
SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2)
SS (Self-snoop)
HTT (Multi-threading)
TM (Thermal monitor supported)
PBE (Pending break enabled)
Version: Intel(R) Xeon(R) CPU E7540 @ 2.00GHz
Voltage: 1.2 V
External Clock: 133 MHz
Max Speed: 4000 MHz
Current Speed: 2000 MHz
Status: Populated, Enabled
Upgrade: Socket LGA1567
L1 Cache Handle: 0x009D
L2 Cache Handle: 0x009E
L3 Cache Handle: 0x009F
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified
Core Count: 6
Core Enabled: 6
Thread Count: 12
Characteristics:
64-bit capable
…………………………………………………
10) 显示有关 64 位内存错误的信息
要显示系统的 64 位内存错误信息,请运行以下命令
[root@linuxtechi ~]# dmidecode -t 33
11) 以十六进制输出 DMIDECODE 命令输出
如果您不想解码 dmidecode 命令的输出信息,但希望将其转储为 16 进制格式,则可以在 dmidecode 命令中使用 -u 或 dump 选项,示例如下
[root@linuxtechi ~]# dmidecode -u -t 4
or
[root@linuxtechi ~]# dmidecode --dump -t 4
12 ) 显示 dmidecode 版本
使用下面的 dmidecode 命令显示它的版本
[root@linuxtechi ~]# dmidecode -V
2.12
[root@linuxtechi ~]#
我的开源项目
三、linux 如何查看固态硬盘大小?
在 Linux 系统中,可以使用以下命令来查看固态硬盘 (SSD) 的大小:
lsblk: 使用这个命令可以查看系统中所有块设备的详细信息,包括硬盘的大小,格式,挂载点等。
$ lsblk
fdisk -l :使用这个命令可以查看系统中所有分区的详细信息,包括硬盘的大小,格式,挂载点等。
$ fdisk -l
hdparm -i /dev/sda : 使用这个命令可以查看指定硬盘的详细信息,其中包括硬盘的大小。
$ hdparm -i /dev/sda
df -h :这个命令可以查看所有挂载的文件系统的磁盘使用情况,包括使用量,剩余量和文件系统类型。
$ df -h
cat /proc/mounts: 查看文件系统已经挂载上了哪些位置,看设备名称来判断是哪块磁盘
$ cat /proc/mounts
根据你的需要来选择使用哪个命令,上面的示例中均以/dev/sda为例,你需要根据实际的设备名来进行替换.
四、linux硬盘是否损坏?
判断linux硬盘是否损坏,可以通过hdparm 测试硬盘读写速度的方法。
测试各硬盘读取速度判断硬盘故障,在服务端命令窗口中执行如下命令:
hdparm -t /dev/hda (IDE硬盘)
hdparm -t /dev/sda (SATA、SCSI、硬RAID卡阵列)
hdparm -t /dev/md0 (软RAID设备)
测试结果在空载情况下应 >40M/s ,在负载情况下平均应 > 20M/s 为正常,如测试结果极低则需要进一步使用硬盘专用检测工具测试是否为硬盘故障。
五、linux查看硬盘厂家?
用命令查看
fdisk -l | grep "Disk /dev/sd"
六、linux硬盘扩容命令?
常用命令:
1)df
df是来自于coreutils 软件包,系统安装时,就自带的;我们通过这个命令可以查看磁盘的使用情况以及文件系统被挂载的位置;
df -h
[root@localhost beinan]# df -lh
Filesystem 容量 已用 可用 已用% 挂载点
/dev/hda8 11G 6.0G 4.4G 58% /
/dev/shm 236M 0 236M 0% /dev/shm
/dev/sda1 56G 22G 35G 39% /mnt/sda1
2)fdisk
fdisk 是一款强大的磁盘操作工具,来自util-linux软件包,我们在这里只说他如何查看磁盘分区表及分区结构;参数 -l ,通过-l 参数,能获得机器中所有的硬盘的分区情况。
七、linux硬盘挂载命令?
linux挂载硬盘的命令是mount。具体方法:
1.首先执行【mkdir -p 目录名】命令创建一个挂载点;
2.然后执行【mount -t ntfs /dev/sd 挂载点】命令即可完成挂载。对linux系统而言,USB接口的移动硬盘是当作SCSI设备对待的。插入移动硬盘之前,应先用fdisk –l或more /proc/partitions查看系统的硬盘和硬盘分区情况。
八、Linux硬盘自动休眠?
Windows硬盘自动休眠时,通过个人设置可以修改,如果已经自动休眠,可以进行其他修改,从而改正。
九、Linux硬盘默认名称?
Linux分区的命名--/dev/xxyN /dev/ 这个字串是所有设备文件所在的目录名。因为分区在硬盘上,而硬盘是设备,所以这些文件代表了在/dev/上所有可能的分区。 xx 分区名的前两个字母表明分区所在设备的类型。通常是hd(IDE磁盘)或sd(SCSI磁盘) y 这个字母标明分区所在的设备。例如,/dev/hda(第一个IDE磁盘)或/dev/sdb(第二个SCSI磁盘) N 最后的数字代表分区。前四个(主分区或扩展分区)使用数字从1排列到4.逻辑分区从5开始。 例如,/dev/hda3是在第一个IDE硬盘上的第三个主分区或扩展分区;/dev/sdb6是在第二个SCSI硬盘上的第二个逻辑分区。 所以你说的第二块SCSI硬盘应该是/dev/sdb,数字就要具体分区的情况啦!
十、linux debian硬盘安装?
思路:用U盘引导,系统镜像在硬盘中,网上很多文章都是用grub for dos做安装引导。其实只是引导方法不一样,这个更简单些,使用u盘来引导,硬盘安装debian lenny 1.格式化u盘 在windows下把u盘格式化为fat(2G以下)或fat32(2G以上)格式 2.下载并使用syslinux 下载http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-3.73.tar.gz 解压后,在win32目录里面使用以下命令来“让u盘可以变成bootable” 假设解压到D:盘,“cmd”命令进入D盘,cd命令打开到win32目录。 命令:syslinux.exe -m -a j: (j:为u盘的盘符);即可在优盘中创建一个可启动的文件(是隐藏的)。 3.在u盘中建立此文件syslinux.cfg(用记事本编辑) ,并在里面加入 default vmlinuz append initrd=initrd.gz 4.下载 http://http.us.debian.org/debian/dists/lenny/main/installer-i386/current/images/hd-media/initrd.gz http://http.us.debian.org/debian/dists/lenny/main/installer-i386/current/images/hd-media/vmlinuz 下载你所需的debian的iso文件(只需要CD1可以)。::我放了cd1,cd2,cd3,因为我不知道,装GNOME环境,究竟要用几个镜像) 把这3个文件都放到u盘里面(如果要装双系统,可以把下载的iso文件放在win的fat32分区里,安装的时候会自动扫描你的fat32分区,如果放在u盘里有可能不能识别) 5.重启电脑,在bios中选择u盘启动在安装过程中,我遇到了,找不到镜像,镜像出错等问题,最后还是完成了。
热点信息
-
在Python中,要查看函数的用法,可以使用以下方法: 1. 使用内置函数help():在Python交互式环境中,可以直接输入help(函数名)来获取函数的帮助文档。例如,...
-
一、java 连接数据库 在当今信息时代,Java 是一种广泛应用的编程语言,尤其在与数据库进行交互的过程中发挥着重要作用。无论是在企业级应用开发还是...
-
一、idea连接mysql数据库 php connect_error) { die("连接失败: " . $conn->connect_error);}echo "成功连接到MySQL数据库!";// 关闭连接$conn->close();?> 二、idea连接mysql数据库连...
-
要在Python中安装modbus-tk库,您可以按照以下步骤进行操作: 1. 确保您已经安装了Python解释器。您可以从Python官方网站(https://www.python.org)下载和安装最新版本...