dmesg 명령의 명령은 시스템의 가장 최근에 부팅 이후 커널의 메시지 버퍼의 내용으로
일반적으로 볼 수 없는 시스템 작동 방식과 발생할 수 있는 문제에 대한 많은 세부 정보를 표시합니다.
많은 데이터가 될 수 있지만 그것을 줄이는 몇 가지 방법 안내 입니다.
$ dmesg | grep NIC
[ 21.483886] e1000e 0000:00:19.0 enp0s25: NIC Link is Up 100 Mbps Full Duplex, Flow Control: Rx/Tx
[ 27.504178] e1000e 0000:00:19.0 enp0s25: NIC Link is Down
NIC 정보만 확인.
[ 12.469099]
[274011.884318]
위의 첫 번째 날짜 표시는 시스템이 마지막으로 부팅된 후 약 12.5초 후에 데이터가 기록되었음을 의미합니다.
두 번째 날짜가 3일 이상 지난 날짜임을 알려주는 아래와 같은 계산입니다. 숫자 86400은 하루의 초 수입니다.
$ echo "scale=2; 274011 / 86400" | bc
3.17
날짜/시간 필드를 보는 더 쉬운 방법은 우리가 보던 것과 같은 날짜와 시간으로 변환 하는 -T 또는 -H 옵션을
사용하는 것입니다.
$ dmesg -T | head -3
[Fri Dec 3 08:52:34 2021] microcode: microcode updated early to revision 0xa0b, date = 2010-09-28
[Fri Dec 3 08:52:34 2021] Linux version 5.15.4-101.fc34.x86_64 (mockbuild@bkernel02.iad2.fedoraproject.org) (gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1), GNU ld version 2.35.2-6.fc34) #1 SMP Tue Nov 23 18:58:50 UTC 2021
[Fri Dec 3 08:52:34 2021] Command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.15.4-101.fc34.x86_64 root=UUID=a9e33237-9114-44ae-afd5-8ddb231d301f ro rootflags=subvol=root rhgb quiet
$ dmesg -H | head -4
[Dec 3 08:52] microcode: microcode updated early to revision 0xa0b, date = 2010-09-28
[ +0.000000] Linux version 5.15.4-101.fc34.x86_64 (mockbuild@bkernel02.iad2.fedoraproject.org) (gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1), GNU ld version 2.35.2-6.fc34) #1 SMP Tue Nov 23 18:58:50 UTC 2021
[ +0.000000] Command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.15.4-101.fc34.x86_64 root=UUID=a9e33237-9114-44ae-afd5-8ddb231d301f ro rootflags=subvol=root rhgb quiet
[ +0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
아래 표시된 것과 같은 명령을 사용하여 RAM, 하드 디스크, USB 드라이브 및 직렬 포트와 관련된 세부 정보를 선택할 수 있습니다.
$ dmesg | grep -i memory
$ dmesg | grep -i dma
$ dmesg | grep -i usb
$ dmesg | grep -i tty
Using kern
$ dmesg -f kern | head -2
[ 0.000000] microcode: microcode updated early to revision 0xa0b, date = 2010-09-28
[ 0.000000] Linux version 5.15.4-101.fc34.x86_64 (mockbuild@bkernel02.iad2.fedoraproject.org) (gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1), GNU ld version 2.35.2-6.fc34) #1 SMP Tue Nov 23 18:58:50 UTC 2021
Using user
$ dmesg -f user | head -2
Using mail
$ dmesg -f mail | head -2
Using daemon
$ dmesg -f daemon | head -2
[ 1.772531] systemd[1]: systemd v248.9-1.fc34 running in system mode. (+PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
[ 1.784315] systemd[1]: Detected architecture x86-64.
Using auth
$ dmesg -f auth | head -2
Using syslog
$ dmesg -f syslog | head -2
[ 7.451957] systemd-journald[192]: Received SIGTERM from PID 1 (systemd).
[ 9.575729] systemd-journald[499]: Received client request to flush runtime journal.
Using lpr
$ dmesg -f lpr | head -2
Using news
$ dmesg -f news | head -2
Using levels
The dmesg command also allows you to pull data by log levels. These include:
- emerg - system is unusable
- alert - action must be taken immediately
- crit - critical conditions
- err - error conditions
- warn - warning conditions
- notice - normal but significant condition
- info - informational
- debug - debug-level messages
emerg 메세지
$ dmesg -l emerg | head -2
alert 메세지
$ dmesg -l alert | head -2
crit 메세지
$ dmesg -l crit | head -2
error 메세지
$ dmesg -l err | head -2
[ 6.580237] usb 2-2: device descriptor read/64, error -110
[ 7.875161] sd 4:0:0:0: [sdc] No Caching mode page found
warnning 메세지
$ dmesg -l warn | head -2
[ 0.006843] ACPI BIOS Warning (bug): 32/64X length mismatch in FADT/Pm1aEventBlock: 32/8 (20210730/tbfadt-564)
[ 0.006846] ACPI BIOS Warning (bug): 32/64X length mismatch in FADT/Pm1aControlBlock: 16/8 (20210730/tbfadt-564)
notice 메세지
$ dmesg -l notice | head -2
[ 0.000000] Linux version 5.15.4-101.fc34.x86_64 (mockbuild@bkernel02.iad2.fedoraproject.org) (gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1), GNU ld version 2.35.2-6.fc34) #1 SMP Tue Nov 23 18:58:50 UTC 2021
[ 0.157702] Kernel command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.15.4-101.fc34.x86_64 root=UUID=a9e33237-9114-44ae-afd5-8ddb231d301f ro rootflags=subvol=root rhgb quiet
info 메세지
$ dmesg -l info | head -2
[ 0.000000] microcode: microcode updated early to revision 0xa0b, date = 2010-09-28
[ 0.000000] Command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.15.4-101.fc34.x86_64 root=UUID=a9e33237-9114-44ae-afd5-8ddb231d301f ro rootflags=subvol=root rhgb quiet
debug 메세지
$ dmesg -l debug | head -2
[ 0.000888] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[ 0.000891] e820: remove [mem 0x000a0000-0x000fffff] usable
Dmeseg 는 Linux 에서 많은 정보를 알 수 있는 로그 입니다.
'Linux Tech ' 카테고리의 다른 글
높은 확율로 kdump 생성되게 하기 (0) | 2021.12.07 |
---|---|
Network Time_wait 스크립트 (0) | 2021.12.07 |
Linux History 시간=time 찍기 (0) | 2021.12.06 |
RPM 패키지 - CVE 정보 확인 (0) | 2021.12.06 |
vim 옵션 정리 (0) | 2021.12.06 |