免费论文网 首页

linux,dmidecode

时间:2018-11-09 11:31 来源:免费论文网

篇一:查看BIOS 提供的硬件信息工具 dmidecode

查看BIOS 提供的硬件信息工具: dmidecode

下载地址:

http://download.savannah.gnu.org/releases/dmidecode/

http://download.chinaunix.net/download/0003000/2304.shtml

在本地保存路径:

1,10.50.44.89:/mnt/sda1/software/linux/other/dmidecode

2,172.19.148.202:/home/software/dmidecode

安装:

解压:

[root@sz-ms-meil-linux dmidecode]# tar -xzvf dmidecode-2.8.tar.gz dmidecode-2.8/

dmidecode-2.8/man/

dmidecode-2.8/man/biosdecode.8

dmidecode-2.8/man/dmidecode.8

dmidecode-2.8/man/ownership.8

dmidecode-2.8/man/vpddecode.8

dmidecode-2.8/AUTHORS

dmidecode-2.8/CHANGELOG

dmidecode-2.8/LICENSE

dmidecode-2.8/Makefile

dmidecode-2.8/README

dmidecode-2.8/biosdecode.c

dmidecode-2.8/config.h

dmidecode-2.8/dmidecode.c

dmidecode-2.8/dmidecode.h

dmidecode-2.8/dmiopt.c

dmidecode-2.8/dmiopt.h

dmidecode-2.8/ownership.c

dmidecode-2.8/types.h

dmidecode-2.8/util.c

dmidecode-2.8/util.h

dmidecode-2.8/version.h

dmidecode-2.8/vpddecode.c

dmidecode-2.8/vpdopt.c

dmidecode-2.8/vpdopt.h

可以看到文件如下:

# ll

total 460

-rw-r--r--1 root root 1147 Dec 30 10:23 AUTHORS

-rwxr-xr-x1 root root 12336 Dec 30 10:23 biosdecode

-rw-r--r--1 root root 13754 Dec 30 10:23 biosdecode.c

-rw-r--r--1 root root 8368 Dec 30 10:23 biosdecode.o

-rw-r--r--1 root root 30647 Dec 30 10:23 CHANGELOG -rw-r--r--1 root root226 Dec 30 10:23 config.h

-rwxr-xr-x1 root root 56364 Dec 30 10:23 dmidecode

-rw-r--r--1 root root 88653 Dec 30 10:23 dmidecode.c

-rw-r--r--1 root root991 Dec 30 10:23 dmidecode.h

-rw-r--r--1 root root 65572 Dec 30 10:23 dmidecode.o

-rw-r--r--1 root root 7738 Dec 30 10:23 dmiopt.c

-rw-r--r--1 root root 1369 Dec 30 10:23 dmiopt.h

-rw-r--r--1 root root 6740 Dec 30 10:23 dmiopt.o

-rw-r--r--1 root root 18009 Dec 30 10:23 LICENSE

-rw-r--r--1 root root 3228 Dec 30 10:23 Makefile

drwxr-xr-x2 root root 4096 Dec 30 10:23 man

-rwxr-xr-x1 root root 7734 Dec 30 10:23 ownership

-rw-r--r--1 root root 4584 Dec 30 10:23 ownership.c

-rw-r--r--1 root root 2684 Dec 30 10:23 ownership.o

-rw-r--r--1 root root 6546 Dec 30 10:23 README

-rw-r--r--1 root root 1628 Dec 30 10:23 types.h

-rw-r--r--1 root root 3464 Dec 30 10:23 util.c

-rw-r--r--1 root root147 Dec 30 10:23 util.h

-rw-r--r--1 root root 1616 Dec 30 10:23 util.o

-rw-r--r--1 root root 22 Dec 30 10:23 version.h

-rwxr-xr-x1 root root 13822 Dec 30 10:23 vpddecode

-rw-r--r--1 root root 12295 Dec 30 10:23 vpddecode.c

-rw-r--r--1 root root 7972 Dec 30 10:23 vpddecode.o

-rw-r--r--1 root root 3882 Dec 30 10:23 vpdopt.c

-rw-r--r--1 root root 1338 Dec 30 10:23 vpdopt.h

-rw-r--r--1 root root 3828 Dec 30 10:23 vpdopt.o

对于这样有Makefile的文件,直接install:

[root@sz-ms-meil-linux dmidecode-2.8]# make install

install -m 755 -d /usr/local/sbin

install -m 755 dmidecode /usr/local/sbin

install -m 755 biosdecode /usr/local/sbin

install -m 755 ownership /usr/local/sbin

install -m 755 vpddecode /usr/local/sbin

install -m 755 -d /usr/local/share/man/man8

install -m 644 man/dmidecode.8 /usr/local/share/man/man8

install -m 644 man/biosdecode.8 /usr/local/share/man/man8

install -m 644 man/ownership.8 /usr/local/share/man/man8

install -m 644 man/vpddecode.8 /usr/local/share/man/man8

install -m 755 -d /usr/local/share/doc/dmidecode

install -m 644 README /usr/local/share/doc/dmidecode

install -m 644 CHANGELOG /usr/local/share/doc/dmidecode

install -m 644 AUTHORS /usr/local/share/doc/dmidecode

[root@sz-ms-meil-linux dmidecode-2.8]#

可以看到上面有四个可执行文件分别是:dmidecode、biosdecode、ownership、v pddecode。我们最常用的是前两个命令。用dmidecode可以显示非常详细的硬件信息(包括bios、cpu、内存等信息)。

Presentation

Dmidecode reports information about your system's hardware as described in your system BIOS according to the standard (see a This information typically includes system manufacturer, model name, serial number, BIOS version, asset tag as well as a lot of other details of varying level of interest and reliability depending on the manufacturer. This will often include usage status for the CPU sockets, expansion slots (e.g. AGP, PCI, ISA) and memory module slots, and the list of I/O ports (e.g. serial, parallel, USB). enable or disable specific portions of code depending on the specific hardware. Thus, one use of dmidecode is for kernel developers to detect system "signatures" and add them to the kernel source code when needed.

Beware that DMI data have proven to be too ueliable to be blindly trusted. Dmidecode does not scan your hardware, it only reports what the BIOS told it to.

Three additional tools come with dmidecode:

biosdecode prints all BIOS related information it can find

ownership retrieves the "ownership tag" that can be set on Compaq computers;

vpddecode prints the "vital product data" information that can be found in almost all IBM computers (see a sample output).

[root@sz-ms-meil-linux dmidecode-2.8]# biosdecode

# biosdecode 2.8

SYSID present.

Revision: 0

Structure Table Address: 0x000F0411

Number Of Structures: 1

SMBIOS 2.3 present.

Structure Table Length: 2245 bytes

Structure Table Address: 0x000F0450

Number Of Structures: 69

Maximum Structure Size: 234 bytes

PNP BIOS 1.0 present.

Event Notification: Not Supported

Real Mode 16-bit Code Address: F000:E2F1

Real Mode 16-bit Data Address: 0040:0000

16-bit Protected Mode Code Address: 0x000FE2F4

16-bit Protected Mode Data Address: 0x00000040

PCI Interrupt Routing 1.0 present.

Router ID: 00:1f.0

Exclusive IRQs: None

Compatible Router: 8086:24d0

Slot Entry 1: ID 00:1f, on-board

Slot Entry 2: ID 00:1d, on-board

Slot Entry 3: ID 00:02, on-board

Slot Entry 4: ID 01:00, on-board

Slot Entry 5: ID 01:0c, on-board

Slot Entry 6: ID 01:07, slot number 1

Slot Entry 7: ID 01:08, slot number 2

Slot Entry 8: ID 01:09, slot number 3

Slot Entry 9: ID 01:0a, slot number 4

ACPI 1.0 present.

OEM Identifier: DELL

RSD Table 32-bit Address: 0x000FD196

BIOS32 Service Directory present.

Revision: 0

Calling Interface Address: 0x000FFE90

实例:

查机器的序列号:

[root@sz-ms-meil-linux dmidecode-2.8]# dmidecode | grep 'Serial Number' Serial Number:

Serial Number: ..CN1374047Q00OJ.

Serial Number:

[root@sz-ms-meil-linux dmidecode-2.8]#

篇二:linux查看硬件信息的命令详解

linux查看硬件信息命令和教程详解

众所周知,Linux大部分操作是通过命令实现的,并不像windows那么直观。linux查看硬件信息也是需要通过linux查看硬件信息命令查询的,下面小编来分享一下linux查看硬件信息的方法和命令写法。

cpu

lscpu命令,查看的是cpu的统计信息.

blue@blue-pc:~$ lscpu

Architecture: i686#cpu架构

CPU op-mode(s): 32-bit, 64-bit

Byte Order:Little Endian#小尾序

CPU(s): 4#总共有4核

On-line CPU(s) list:0-3

Thread(s) per core: 1#每个cpu核,只能支持一个线程,即不支持超线程 Core(s) per socket: 4#每个cpu,有4个核

Socket(s): 1#总共有1一个cpu

Vendor ID: GenuineIntel #cpu产商 intel

CPU family:6

Model: 42

Stepping: 7

CPU MHz:1600.000

BogoMIPS: 5986.12

Virtualization: VT-x#支持cpu虚拟化技术

L1d cache: 32K

L1i cache: 32K

L2 cache: 256K

L3 cache: 6144K

查看/proc/cpuinfo,可以知道每个cpu信息,如每个CPU的型号,主频等。 #cat /proc/cpuinfo

processor : 0

vendor_id : GenuineIntel

cpu family : 6

model : 42

model name : Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz

.....

上面输出的是第一个cpu部分信息,还有3个cpu信息省略了。

内存

概要查看内存情况

free -m

total used free shared buffers cached

Mem: 3926 3651 274 012 404

-/+ buffers/cache: 3235 691

Swap:953631 9505

这里的单位是MB,总共的内存是3926MB。

查看内存详细使用

# cat /proc/meminfo

MemTotal: 4020868 kB

MemFree: 230884 kB

Buffers:7600 kB

Cached: 454772 kB

SwapCached: 836 kB

.....

查看内存硬件信息

dmidecode -t memory

# dmidecode 2.11

SMBIOS 2.7 present.

Handle 0x0008, DMI type 16, 23 bytes

Physical Memory Array

Location: System Board Or Motherboard

....

Maximum Capacity: 32 GB

....

Handle 0x000A, DMI type 17, 34 bytes

....

Memory Device

Array Handle: 0x0008

Error Information Handle: Not Provided

Total Width: 64 bits

Data Width: 64 bits

Size: 4096 MB

.....

我的主板有4个槽位,只用了一个槽位,上面插了一条4096MB的内存。

磁盘

查看硬盘和分区分布

# lsblk

NAMEMAJ:MIN RMSIZE RO TYPE MOUNTPOINT

sda8:0 0 465.8G 0 disk

├—sda18:1 0 1G 0 part /boot

├—sda28:2 09.3G 0 part [SWAP]

├—sda38:3 0 74.5G 0 part /

├—sda48:4 0 1K 0 part

├—sda58:5 0 111.8G 0 part /home

└—sda68:6 0 269.2G 0 part

显示很直观

如果要看硬盘和分区的详细信息

# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 4096 bytes

I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk identifier: 0x00023728

Device BootStartEndBlocksId System

/dev/sda1* 2048 2148351 107315283 Linux

/dev/sda22148352 21680127 976588882 Linux swap / Solaris /dev/sda3 21680128177930239 7812505683 Linux

/dev/sda4 177932286976771071399419393 5 Extended/dev/sda5 17793228841230540711718656083 Linux

/dev/sda6 41230745697677107128223180883 Linux

网卡

查看网卡硬件信息

# lspci | grep -i 'eth'

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)

查看系统的所有网络接口

# ifconfig -a

eth0Link encap:以太网 硬件地址 b8:97:5a:17:b3:8f

.....

lo Link encap:本地环回

.....

或者是

ip link show

1: lo: <LOOPBACK> mtu 16436 qdisc noqueue state DOWN

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000

link/ether b8:97:5a:17:b3:8f brd ff:ff:ff:ff:ff:ff

如果要查看某个网络接口的详细信息,例如eth0的详细参数和指标

# ethtool eth0

Settings for eth0:

Supported ports: [ TP MII ]

Supported link modes:10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full

1000baseT/Half 1000baseT/Full #支持千兆半双工,全双工模式

Supported pause frame use: No

Supports auto-negotiation: Yes #支持自适应模式,一般都支持

Advertised link modes: 10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full

1000baseT/Half 1000baseT/Full

Advertised pause frame use: Symmetric Receive-only

Advertised auto-negotiation: Yes #默认使用自适应模式

Link partner advertised link modes: 10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full

.....

Speed: 100Mb/s #现在网卡的速度是100Mb,网卡使用自适应模式,所以推测路由是100Mb,导致网卡从支 持千兆,变成要支持百兆

Duplex: Full#全双工

.....

Link detected: yes #表示有网线连接,和路由是通的

其他

查看pci信息,即主板所有硬件槽信息。

lspci

00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09) #主板芯片

00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) #显卡

00:14.0 USB controller: Intel Corporation Panther Point USB xHCI Host Controller (rev 04) #usb控制器

00:16.0 Communication controller: Intel Corporation Panther Point MEI Controller #1 (rev 04)

00:1a.0 USB controller: Intel Corporation Panther Point USB Enhanced Host Controller #2 (rev 04)

00:1b.0 Audio device: Intel Corporation Panther Point High Definition Audio Controller (rev 04) #声卡

00:1c.0 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 1 (rev c4) #pci 插槽

00:1c.2 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 3 (rev c4)

00:1c.3 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 4 (rev c4)

篇三:如何查看LINUX 硬件配置信息

如何查看LINUX 硬件配置信息

1.查看机器所有硬件信息: dmidecode |more dmesg |more

这2个命令出来的信息都非常多,所以建议后面使用"|more"便于查看 2.查看CPU信息 方法一:

Linux下CPU相关的参数保存在 /proc/cpuinfo 文件里 cat /proc/cpuinfo |more 方法二:

采用命令 dmesg | grep CPU 可以查看到相关CPU的启动信息 查看CPU的位数: getconf LONG_BIT 3.查看Mem信息

cat /proc/meminfo |more (注意输出信息的最后一行:MachineMem:41932272 kB) free -m top

4.查看磁盘信息 方法一:

fdisk -l 可以看到系统上的磁盘(包括U盘)的分区以及大小相关信息。 方法二: 直接查看 cat /proc/partitions 5.查看网卡信息 方法一:

ethtool eth0 采用此命令可以查看到网卡相关的技术指标 (不一定所有网卡都支持此命令) ethtool -i eth1 加上 -i 参数查看网卡驱动 可以尝试其它参数查看网卡相关技术参数 方法二:

也可以通过dmesg | grep eth0 等看到网卡名字(厂家)等信息

通过查看 /etc/sysconfig/network-scripts/ifcfg-eth0 可以看到当前的网卡配置包括IP、网关地址等信息。 当然也可以通过ifconfig命令查看。 6.如何查看主板信息? lspci

7.如何挂载ISO文件 8.如何查看光盘相关信息 方法一:

插入CD光碟后,在本人的RHEL5系统里,光碟文件是 /dev/cdrom, 因此只需 mount /dev/cdrom mount_point 即可。 [root@miix tmp]# mount /dev/cdrom

mount_point

mount: block device /dev/cdrom is write-protected, mounting read-only 其实仔细看一下,光驱的设备文件是 hdc [root@miix tmp]# ls -l /dev/cdrom*

lrwxrwxrwx 1 root root 3 01-08 08:54 /dev/cdrom -> hdc lrwxrwxrwx 1 root root 3 01-08 08:54 /dev/cdrom-hdc -> hdc 因此我们也可以这样 mount /dev/hdc mount_point

如果光驱里没放入有效光盘,则报错: [root@miix tmp]# mount /dev/hdc mount_point mount: 找不到介质 9.如何查看USB设备相关 方法一:

其实通过 fdisk -l 命令可以查看到接入的U盘信息,本人的U盘信息如下: Disk /dev/sda: 2012 MB, 2012217344 bytes 16 heads, 32 sectors/track, 7676 cylinders Units = cylinders of 512 * 512 = 262144 bytes Device BootStartEndBlocksId System /dev/sda1* 16 7676 1961024 b W95 FAT32 U盘的设备文件是 /dev/sda,2G大小,FAT32格式。 如果用户登陆的不是Linux图形界面,U盘不会自动挂载上来。 此时可以通过手工挂载(mount): mount /dev/sda1 mount_point

以上命令将U盘挂载到当前目录的 mount_point 目录,注意挂的是 sda1 不是 sda。

卸载命令是 umount mount_point

Linux默认没有自带支持NTFS格式磁盘的驱动,但对FAT32支持良好,挂载的时候一般不需要 -t vfat 参数 。

如果支持ntfs,对ntfs格式的磁盘分区应使用 -t ntfs 参数。 如果出现乱码情况,可以考虑用 -o iocharset=字符集 参数。可以通过 lsusb 命令查看 USB 设备信息哦:

[root@miix tmp]# lsusb

Bus 001 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000 Bus 003 Device 001: ID 0000:0000

Bus 004 Device 002: ID 0951:1613 Kingston Technology Bus 004 Device 001: ID 0000:0000


linux,dmidecode
由:免费论文网互联网用户整理提供,链接地址:
http://m.csmayi.cn/meiwen/28150.html
转载请保留,谢谢!
相关阅读
最近更新
推荐专题