Profile picture

[Linux] 시스템 구성 정보 확인하기

JaehyoJJAng2024년 12월 05일

개요

이번 게시글에서는 시스템 구성 정보를 확인할 수 있는 여러 명령어를 기록해보려고 합니다!


커널 정보 확인하기

uname -a

Linux arch 6.10.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 12 Sep 2024 17:21:02 +0000 x86_64 GNU/Linux

커널 로그 확인하기

dmesg로 아래 세 가지 내용 확인이 가능합니다.

  • 커널이 메모리를 인식하는 과정
  • 하드웨어를 인식하고 드라이브를 올리는 과정
  • 부팅 시 적용된 커널 파라미터
dmesg | grep -i kernel | more

[    0.017984] Booting paravirtualized kernel on KVM
[    0.022156] Kernel command line: BOOT_IMAGE=/vmlinuz-linux root=/dev/mapper/vg0-lv_root rw loglevel=3 quiet
[    0.022195] Unknown kernel command line parameters "BOOT_IMAGE=/vmlinuz-linux", will be passed to user space.
[    0.042375] Memory: 5903700K/6143456K available (18432K kernel code, 2177K rwdata, 13440K rodata, 3436K init, 3484K bss, 239496K reserved, 0K cma-reserved)
[    0.186447] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations
[    0.186503] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.186574] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.377880] Loaded X.509 cert 'Build time autogenerated kernel key: 0053407a583e4abf791c272ae6ca151222bca233'
[    0.390607] Freeing unused kernel image (initmem) memory: 3436K
[    0.390618] Write protecting the kernel read-only data: 32768k
[    0.390819] Freeing unused kernel image (rodata/data gap) memory: 896K
[    2.153879] systemd[1]: Listening on udev Kernel Socket.
[    2.156875] systemd[1]: Mounting Kernel Debug File System...
[    2.159111] systemd[1]: Mounting Kernel Trace File System...
[    2.163232] systemd[1]: Starting Load Kernel Module configfs...
[    2.166052] systemd[1]: Starting Load Kernel Module dm_mod...
[    2.166602] systemd[1]: Starting Load Kernel Module drm...
[    2.168440] systemd[1]: Starting Load Kernel Module fuse...
[    2.169718] systemd[1]: Starting Load Kernel Module loop...
[    2.186651] systemd[1]: Starting Load Kernel Modules...
[    2.188412] systemd[1]: Starting Generate network units from Kernel command line...
[    2.189422] systemd[1]: Starting Remount Root and Kernel File Systems...
[    2.193902] systemd[1]: Mounted Kernel Debug File System.
[    2.193943] systemd[1]: Mounted Kernel Trace File System.
[    2.195383] systemd[1]: Finished Load Kernel Module configfs.
[    2.195601] systemd[1]: Finished Load Kernel Module dm_mod.
[    2.195791] systemd[1]: Finished Load Kernel Module drm.
[    2.195978] systemd[1]: Finished Load Kernel Module fuse.
[    2.198664] systemd[1]: Mounting Kernel Configuration File System...
[    2.202361] systemd[1]: Finished Load Kernel Module loop.
[    2.202533] systemd[1]: Finished Load Kernel Modules.
[    2.202647] systemd[1]: Mounted Kernel Configuration File System.
[    2.206645] systemd[1]: Starting Apply Kernel Variables...
[    2.213507] systemd[1]: Finished Generate network units from Kernel command line.
[    2.217670] systemd[1]: Finished Apply Kernel Variables.
[    2.219402] systemd[1]: Finished Remount Root and Kernel File Systems.

커널 컴파일 정보 확인하기

cat /boot/config-$(uname -r) | more

Bios 버전 확인하기

sudo dmidecode -t bios

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
        Vendor: American Megatrends International, LLC.
        Version: P1.70
        Release Date: 07/01/2021
        Address: 0xF0000
        Runtime Size: 64 kB
        ROM Size: 16 MB
        Characteristics:
                PCI is supported
        ....
        ....

장치 모델명 / 제조사 확인하기

모델명을 통해서 해당 장비가 어느 정도의 성능을 낼 수 있는지 확인할 수 있어요.

sudo dmidecode -t system

Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: To Be Filled By O.E.M.
        ....
        ....

장비의 CPU 정보 확인하기

dmidecode -t processor

위 명령어뿐만 아니라 아래 파일 및 명령으로도 확인 가능

cat /proc/cpuinfo
lscpu

메모리 정보 확인하기

sudo dmidecode -t memory

디스크 부가적인 정보 확인하기

smartctl -a /dev/<disk_name>

물리 디스크 정보 확인

smartctl -a /dev/sda -d [RAID 컨트롤러가 사용하는 드라이버], [디스크 베이]
...
smartctl -a /dev/sda -d cciss, 0

RAID 컨트롤러 드라이버는 lsmod로 확인 가능


네트워크 정보 확인하기

lspci | grep -i ether

링버퍼 크기 확인해보기

ethtool -g <interface_name>

Ring parameters for enp0s3:
Pre-set maximums: # maximums (하드웨어가 지원하는 최대 ring buffer 크기)
RX:		4096
RX Mini:	0
RX Jumbo:	0
TX:		4096
Current hardware settings: # current (현재 설정된 최대 ring buffer 크기)
RX:		256
RX Mini:	0
RX Jumbo:	0
TX:		256

maximums 값과 current 값이 같도록 설정하는걸 권장하고 있어요.


네트워크 성능 최적화 옵션 확인하기

ethtool -k enp0s3
    Tag -

Loading script...