设为首页 收藏本站
查看: 554|回复: 0

[经验分享] Linux系统硬件信息

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2014-6-16 13:54:23 | 显示全部楼层 |阅读模式
对于linux系统硬件信息的查看,主要针对cpu、memory、disk,以及网卡,每一种硬件的信息通常会有多种查看方法。

1.cpu

查看/proc/cpuinfo文件 可查看cpu的详细信息。

[iyunv@primary_server ~]# cat /proc/cpuinfo

vendor_id    : GenuineIntel
cpu family    : 15
model        : 4
model name    : Intel(R) Xeon(TM) CPU 2.80GHz
stepping    : 3
cpu MHz        : 2793.385
cache size    : 2048 KB
physical id    : 0
siblings    : 2
core id        : 0
cpu cores    : 1
apicid        : 0
fdiv_bug    : no
hlt_bug        : no
f00f_bug    : no
coma_bug    : no
fpu        : yes
fpu_exception    : yes
cpuid level    : 5
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl cid cx16 xtpr
bogomips    : 5586.77


vendor_id    : GenuineIntel
cpu family    : 15
model        : 4
model name    : Intel(R) Xeon(TM) CPU 2.80GHz
stepping    : 3
cpu MHz        : 2793.385
cache size    : 2048 KB
physical id    : 0
siblings    : 2
core id        : 0
cpu cores    : 1
apicid        : 1
fdiv_bug    : no
hlt_bug        : no
f00f_bug    : no
coma_bug    : no
fpu        : yes
fpu_exception    : yes
cpuid level    : 5
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl cid cx16 xtpr
bogomips    : 5586.40

[iyunv@primary_server ~]# dmidecode -t
dmidecode: option requires an argument -- t
Type number or keyword expected
Valid type keywords are:
  bios
  system
  baseboard
  chassis
  processor
  memory
  cache
  connector
  slot

dmidecode命令功能很全,可以针对bios 系统 cpu 内存 cache等信息进行查看。

[iyunv@primary_server ~]# dmidecode -t processor
# dmidecode 2.11
SMBIOS 2.3 present.

Handle 0x0400, DMI type 4, 40 bytes
Processor Information
    Socket Designation: PROC_1
    Type: Central Processor
    Family: Xeon
    Manufacturer: Intel
    ID: 43 0F 00 00 FF FB EB BF
    Signature: Type 0, Family 15, Model 4, Stepping 3
    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: Not Specified
    Voltage: 1.4 V
    External Clock: 800 MHz
    Max Speed: 3600 MHz
    Current Speed: 2800 MHz
    Status: Populated, Enabled
    Upgrade: ZIF Socket
    L1 Cache Handle: 0x0700
    L2 Cache Handle: 0x0701
    L3 Cache Handle: 0x0702
    Serial Number: Not Specified
    Asset Tag: Not Specified
    Part Number: Not Specified
    Core Count: 1
    Core Enabled: 1
    Thread Count: 2
    Characteristics:
        64-bit capable   


2.内存

[iyunv@primary_server ~]# free -m     //以MB为单位,总共1010MB,不是太大.
             total       used       free     shared    buffers     cached
Mem:          1010        874        135          0        176        570
-/+ buffers/cache:        127        882
Swap:         2047          0       2047

[iyunv@primary_server ~]# cat /proc/meminfo
MemTotal:      1034460 kB
MemFree:        139632 kB
Buffers:        180964 kB
Cached:         584252 kB
SwapCached:          0 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
.....


3.磁盘

查看硬盘和分区的详细信息

[iyunv@primary_server ~]# fdisk -l

Disk /dev/sda: 73.4 GB, 73407820800 bytes
64 heads, 32 sectors/track, 70007 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         100      102384   83  Linux
/dev/sda2             101       70007    71584768   8e  Linux LVM

4.网卡

查看网卡硬件信息

[iyunv@primary_server ~]# ifconfig   // 查看当前所有UP的端口
eth0      Link encap:Ethernet  HWaddr 00:13:72:57:78:18  
          inet addr:61.8.42.250  Bcast:61.8.42.251  Mask:255.255.255.252
          inet6 addr: fe80::213:72ff:fe57:7818/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1873816 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2121831 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:246357050 (234.9 MiB)  TX bytes:513284407 (489.5 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1505716 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1505716 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:209398529 (199.6 MiB)  TX bytes:209398529 (199.6 MiB)

查看系统的所有网络接口

[iyunv@primary_server ~]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:13:72:57:78:18  
          inet addr:61.8.42.250  Bcast:61.8.42.251  Mask:255.255.255.252
          inet6 addr: fe80::213:72ff:fe57:7818/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1874317 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2122385 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:246430249 (235.0 MiB)  TX bytes:513372929 (489.5 MiB)

eth1      Link encap:Ethernet  HWaddr 00:13:72:57:78:19  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1505820 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1505820 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:209409405 (199.7 MiB)  TX bytes:209409405 (199.7 MiB)

sit0      Link encap:IPv6-in-IPv4  
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

查看某个网口的详细信息

[iyunv@primary_server ~]# ethtool eth0
Settings for eth0:
    Supported ports: [ TP ]
    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
    Advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: Twisted Pair
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
    Supports Wake-on: umbg
    Wake-on: d
    Current message level: 0x00000007 (7)
    Link detected: yes
    Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                         100baseT/Half 100baseT/Full
    .....
    Speed: 100Mb/s #现在网卡的速度是100Mb,网卡使用自适应模式,所以推测路由是100Mb,导致网卡从支持千兆,变成要支持百兆
    Duplex: Full   #全双工
    .....
    Link detected: yes    #表示有网线连接,和路由是通的

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-20614-1-1.html 上篇帖子: rsync+inotify实时备份 下篇帖子: RHEL7下的systemd Linux 信息 硬件
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表