Информация об устройствах в Linux

Несколько стандартных команд, которые помогут идентифицировать устройства в машине в операционных системах семейства Linux.

Информация о процессоре

команда:

# cat /proc/cpuinfo

ответ:

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 112
model name      : AMD A6-9225 RADEON R4, 5 COMPUTE CORES 2C+3G
stepping        : 0
microcode       : 0x6000626
cpu MHz         : 2595.132
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch ssbd vmmcall fsgsbase avx2 arat nrip_save flushbyasid decodeassists
bugs            : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 5192.52
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 112
model name      : AMD A6-9225 RADEON R4, 5 COMPUTE CORES 2C+3G
stepping        : 0
microcode       : 0x6000626
cpu MHz         : 2595.132
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch ssbd vmmcall fsgsbase avx2 arat nrip_save flushbyasid decodeassists
bugs            : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 5192.52
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management:

команда:

# lscpu

ответ:

Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   48 bits physical, 48 bits virtual
CPU(s):                          2
On-line CPU(s) list:             0,1
Thread(s) per core:              1
Core(s) per socket:              2
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       AuthenticAMD
CPU family:                      21
Model:                           112
Model name:                      AMD A6-9225 RADEON R4, 5 COMPUTE CORES 2C+3G
Stepping:                        0
CPU MHz:                         2595.132
BogoMIPS:                        5192.52
Virtualization:                  AMD-V
Hypervisor vendor:               KVM
Virtualization type:             full
L1d cache:                       64 KiB
L1i cache:                       128 KiB
L2 cache:                        2 MiB
NUMA node0 CPU(s):               0,1
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full AMD retpoline, STIBP disabled, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mm
                                 x fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm constant_tsc rep_good nopl
                                  nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 cx16 sse4_1 sse4
                                 _2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm cmp_legacy svm cr8_
                                 legacy abm sse4a misalignsse 3dnowprefetch ssbd vmmcall fsgsbase avx2 arat nrip_sa
                                 ve flushbyasid decodeassists

Модель материнской платы

команда:

# cat /sys/devices/virtual/dmi/id/board_{vendor,name,version}

Оперативная память

команда:

# free -m

ответ:

               total        used        free      shared  buff/cache   available
Mem:            1985          48        1876           0          60        1832

команда:

# cat /proc/meminfo

ответ:

MemTotal:        2033392 kB
MemFree:         1921056 kB
MemAvailable:    1876588 kB
Buffers:           11076 kB
Cached:            36488 kB
SwapCached:            0 kB
Active:            31548 kB
Inactive:          21628 kB
Active(anon):        172 kB
Inactive(anon):     5812 kB
Active(file):      31376 kB
Inactive(file):    15816 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       2097148 kB
SwapFree:        2097148 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:          5620 kB
Mapped:            10344 kB
Shmem:               376 kB
KReclaimable:      14624 kB
Slab:              25948 kB
SReclaimable:      14624 kB
SUnreclaim:        11324 kB
KernelStack:        1488 kB
PageTables:          596 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     3113844 kB
Committed_AS:      27524 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       25492 kB
VmallocChunk:          0 kB
Percpu:              496 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:         0 kB
FilePmdMapped:         0 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:       67520 kB
DirectMap2M:     2029568 kB

Информация о жёстких дисках и разделах

команда:

# fdisk -l

ответ:

Disk /dev/sda: 18 GiB, 19327352832 bytes, 37748736 sectors
Disk model: VBOX HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xcffc93c1

Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *       2048   526335   524288  256M 83 Linux
/dev/sda2        526336  4720639  4194304    2G 83 Linux
/dev/sda3       4720640 37748735 33028096 15.7G 83 Linux

команда:

# blkid

ответ:

/dev/sr0: BLOCK_SIZE="2048" UUID="2021-04-21-23-21-25-49" LABEL="Gentoo amd64 20210421T214502Z" TYPE="iso9660" PTUUID="7def7287" PTTYPE="dos"
/dev/sda1: UUID="c8d715ec-ca89-42b0-b6be-13bbea9ecde7" BLOCK_SIZE="1024" TYPE="ext4" PARTUUID="cffc93c1-01"
/dev/sda2: UUID="7ad2f666-d5d8-4f94-b828-80ff5df210e2" TYPE="swap" PARTUUID="cffc93c1-02"
/dev/sda3: UUID="8549f1c3-0209-46a0-a336-770b11646e11" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="cffc93c1-03"

команда:

# lsblk

ответ:

AME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   18G  0 disk
├─sda1   8:1    0  256M  0 part /boot
├─sda2   8:2    0    2G  0 part [SWAP]
└─sda3   8:3    0 15.7G  0 part /
sr0     11:0    1  419M  0 rom

команда:

# df -h

ответ:

Filesystem      Size  Used Avail Use% Mounted on
none            993M  380K  993M   1% /run
udev             10M     0   10M   0% /dev
tmpfs           993M     0  993M   0% /dev/shm
/dev/sda3        16G  6.7G  8.0G  46% /
cgroup_root      10M     0   10M   0% /sys/fs/cgroup
/dev/sda1       240M   38M  186M  17% /boot

Информация о примонтированных устройствах

команда:

# mount | column -t

ответ:

proc         on  /proc                      type  proc         (rw,nosuid,nodev,noexec,relatime)
none         on  /run                       type  tmpfs        (rw,nosuid,nodev,relatime,mode=755,inode64)
udev         on  /dev                       type  devtmpfs     (rw,nosuid,relatime,size=10240k,nr_inodes=251827,mode=755,inode64)
devpts       on  /dev/pts                   type  devpts       (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs        on  /dev/shm                   type  tmpfs        (rw,nosuid,nodev,inode64)
sysfs        on  /sys                       type  sysfs        (rw,nosuid,nodev,noexec,relatime)
/dev/sda3    on  /                          type  ext4         (rw,noatime)
securityfs   on  /sys/kernel/security       type  securityfs   (rw,nosuid,nodev,noexec,relatime)
debugfs      on  /sys/kernel/debug          type  debugfs      (rw,nosuid,nodev,noexec,relatime)
selinuxfs    on  /sys/fs/selinux            type  selinuxfs    (rw,relatime)
pstore       on  /sys/fs/pstore             type  pstore       (rw,nosuid,nodev,noexec,relatime)
cgroup_root  on  /sys/fs/cgroup             type  tmpfs        (rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755,inode64)
openrc       on  /sys/fs/cgroup/openrc      type  cgroup       (rw,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc)
none         on  /sys/fs/cgroup/unified     type  cgroup2      (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cpuset       on  /sys/fs/cgroup/cpuset      type  cgroup       (rw,nosuid,nodev,noexec,relatime,cpuset)
cpu          on  /sys/fs/cgroup/cpu         type  cgroup       (rw,nosuid,nodev,noexec,relatime,cpu)
cpuacct      on  /sys/fs/cgroup/cpuacct     type  cgroup       (rw,nosuid,nodev,noexec,relatime,cpuacct)
blkio        on  /sys/fs/cgroup/blkio       type  cgroup       (rw,nosuid,nodev,noexec,relatime,blkio)
memory       on  /sys/fs/cgroup/memory      type  cgroup       (rw,nosuid,nodev,noexec,relatime,memory)
devices      on  /sys/fs/cgroup/devices     type  cgroup       (rw,nosuid,nodev,noexec,relatime,devices)
freezer      on  /sys/fs/cgroup/freezer     type  cgroup       (rw,nosuid,nodev,noexec,relatime,freezer)
net_cls      on  /sys/fs/cgroup/net_cls     type  cgroup       (rw,nosuid,nodev,noexec,relatime,net_cls)
perf_event   on  /sys/fs/cgroup/perf_event  type  cgroup       (rw,nosuid,nodev,noexec,relatime,perf_event)
net_prio     on  /sys/fs/cgroup/net_prio    type  cgroup       (rw,nosuid,nodev,noexec,relatime,net_prio)
hugetlb      on  /sys/fs/cgroup/hugetlb     type  cgroup       (rw,nosuid,nodev,noexec,relatime,hugetlb)
pids         on  /sys/fs/cgroup/pids        type  cgroup       (rw,nosuid,nodev,noexec,relatime,pids)
rdma         on  /sys/fs/cgroup/rdma        type  cgroup       (rw,nosuid,nodev,noexec,relatime,rdma)
mqueue       on  /dev/mqueue                type  mqueue       (rw,nosuid,nodev,noexec,relatime)
binfmt_misc  on  /proc/sys/fs/binfmt_misc   type  binfmt_misc  (rw,nosuid,nodev,noexec,relatime)
/dev/sda1    on  /boot                      type  ext4         (rw,noatime)

Информация о сетевом интерфейсе

команда:

# mii-tool -v enp0s3

ответ:

enp0s3: no autonegotiation, 1000baseT-FD flow-control, link ok
  product info: Yukon 88E1011 rev 4
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD

Информация о PCI-устройствах

команда:

# lspci

ответ:

00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:02.0 VGA compatible controller: VMware SVGA II Adapter
00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
00:04.0 System peripheral: InnoTek Systemberatung GmbH VirtualBox Guest Service
00:05.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01)
00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:08.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
00:0d.0 SATA controller: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] (rev 02)

Информация о системных ресурсах

# top

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *