You are on page 1of 9

LAB – TOPIC 3 : BOOT AND SHUTTING DOWN LINUX

1. Boot Manager với Grubby


1.1 Kiểm tra các thông tin Kernel của hệ thống

Grubby là một công cụ dòng lệnh được sử dụng để hiển thị và cập nhật thông tin cho các bộ nạp khởi động
lilo, elilo, zipl, yaboot và grub.

Nó thường được sử dụng để thực hiện các thay đổi đối với grub.cfg. Grubby có thể được sử dụng để:

 Sửa đổi các mục khởi động kernel


 Kiểm tra và thay đổi kernel mặc định
 Liệt kê kernel đã cài đặt hoạt động
 Thêm / xóa đối số khỏi mục menu GRUB2

Boot entries được định nghĩa là một tập hợp các tùy chọn được lưu trữ trong một tệp cấu hình thường
được gắn với một phiên bản hạt nhân cụ thể (phiên bản Kernel, hình ảnh đĩa ram ban đầu và biến môi
trường lựa chọn kernel, v.v. thường được lưu trữ tại /boot/loader/entries/

[root@tuandq1-pnh2 grub]# grubby --info ALL


index=0
kernel="/boot/vmlinuz-4.18.0-348.7.1.el8_5.x86_64"
args="ro console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto co
nsole=tty0 console=ttyS0,115200 no_timer_check nofb nomodeset gfxpayload=text $t
uned_params"
root="LABEL=cloudimg-rootfs"
initrd="/boot/initramfs-4.18.0-348.7.1.el8_5.x86_64.img $tuned_initrd"
title="CentOS Linux (4.18.0-348.7.1.el8_5.x86_64) 8"
id="198551dfd334453e95a6ef2bdd0f5a59-4.18.0-348.7.1.el8_5.x86_64"
index=1
kernel="/boot/vmlinuz-0-rescue-198551dfd334453e95a6ef2bdd0f5a59"
args="ro console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto co
nsole=tty0 console=ttyS0,115200 no_timer_check nofb nomodeset gfxpayload=text"
root="LABEL=cloudimg-rootfs"
initrd="/boot/initramfs-0-rescue-198551dfd334453e95a6ef2bdd0f5a59.img"
title="CentOS Linux (0-rescue-198551dfd334453e95a6ef2bdd0f5a59) 8"
id="198551dfd334453e95a6ef2bdd0f5a59-0-rescue"
index=2
kernel="/boot/vmlinuz-4.18.0-240.15.1.el8_3.x86_64"
args="ro console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto co
nsole=tty0 console=ttyS0,115200 no_timer_check nofb nomodeset gfxpayload=text $t
uned_params"
root="LABEL=cloudimg-rootfs"
initrd="/boot/initramfs-4.18.0-240.15.1.el8_3.x86_64.img $tuned_initrd"
title="CentOS Linux (4.18.0-240.15.1.el8_3.x86_64) 8"
id="96733cf550ab4411a657b474a4ff6d32-4.18.0-240.15.1.el8_3.x86_64"
index=3
kernel="/vmlinuz-0-rescue-96733cf550ab4411a657b474a4ff6d32"
args="ro console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto co
nsole=tty0 console=ttyS0,115200 no_timer_check nofb nomodeset gfxpayload=text"
root="LABEL=cloudimg-rootfs"
initrd="/initramfs-0-rescue-96733cf550ab4411a657b474a4ff6d32.img"
title="CentOS Linux (0-rescue-96733cf550ab4411a657b474a4ff6d32) 8"
id="96733cf550ab4411a657b474a4ff6d32-0-rescue"
index=4
kernel="/boot/vmlinuz-4.18.0-240.1.1.el8_3.x86_64"
args="ro console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto co
nsole=tty0 console=ttyS0,115200 no_timer_check nofb nomodeset gfxpayload=text $t
uned_params"
root="LABEL=cloudimg-rootfs"
initrd="/boot/initramfs-4.18.0-240.1.1.el8_3.x86_64.img $tuned_initrd"
title="CentOS Linux (4.18.0-240.1.1.el8_3.x86_64) 8"
id="6bdfa40330b14232b9c78e13592904be-4.18.0-240.1.1.el8_3.x86_64"
index=5
kernel="/vmlinuz-0-rescue-6bdfa40330b14232b9c78e13592904be"
args="ro console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto co
nsole=tty0 console=ttyS0,115200 no_timer_check nofb nomodeset gfxpayload=text"
root="LABEL=cloudimg-rootfs"
initrd="/initramfs-0-rescue-6bdfa40330b14232b9c78e13592904be.img"
title="CentOS Linux (0-rescue-6bdfa40330b14232b9c78e13592904be) 8"
id="6bdfa40330b14232b9c78e13592904be-0-rescue"
[root@tuandq1-pnh2 grub]# ls -l /boot/loader/entries/
total 24
-rw-r--r--. 1 root root 398 Feb 14 2022 198551dfd334453e95a6ef2bdd0f5a59-0-rescue.conf
-rw-r--r--. 1 root root 356 Feb 14 2022 198551dfd334453e95a6ef2bdd0f5a59-4.18.0-
348.7.1.el8_5.x86_64.conf
-rw-r--r--. 1 root root 388 Dec 4 2020 6bdfa40330b14232b9c78e13592904be-0-rescue.conf
-rw-r--r--. 1 root root 356 Dec 4 2020 6bdfa40330b14232b9c78e13592904be-4.18.0-
240.1.1.el8_3.x86_64.conf
-rw-r--r--. 1 root root 388 Mar 12 2021 96733cf550ab4411a657b474a4ff6d32-0-rescue.conf
-rw-r--r--. 1 root root 361 Mar 12 2021 96733cf550ab4411a657b474a4ff6d32-4.18.0-
240.15.1.el8_3.x86_64.conf
[root@tuandq1-pnh2 grub]# cat /boot/loader/entries/96733cf550ab4411a657b474a4ff6d32-4.18.0-
240.15.1.el8_3.x86_64.conf
title CentOS Linux (4.18.0-240.15.1.el8_3.x86_64) 8
version 4.18.0-240.15.1.el8_3.x86_64
linux /boot/vmlinuz-4.18.0-240.15.1.el8_3.x86_64
initrd /boot/initramfs-4.18.0-240.15.1.el8_3.x86_64.img $tuned_initrd
options $kernelopts $tuned_params
id centos-20210301172437-4.18.0-240.15.1.el8_3.x86_64
grub_users $grub_users
grub_arg --unrestricted
grub_class kernel
Ý nghĩa một số tham số:

- title: Tiêu đề của HĐH trên menu boot.

- kernel: Đường dẫn chỉ đến kernel image.

- initrd: Cho phép load kernel modules từ một image.

1.2 Thêm một kernel mới vào boot menu:

[root@tuandq1-pnh2 grub]# grubby --info=ALL | grep ^kernel


kernel="/boot/vmlinuz-4.18.0-348.7.1.el8_5.x86_64"
kernel="/boot/vmlinuz-0-rescue-198551dfd334453e95a6ef2bdd0f5a59"
kernel="/boot/vmlinuz-4.18.0-240.15.1.el8_3.x86_64"
kernel="/vmlinuz-0-rescue-96733cf550ab4411a657b474a4ff6d32"
kernel="/boot/vmlinuz-4.18.0-240.1.1.el8_3.x86_64"
kernel="/vmlinuz-0-rescue-6bdfa40330b14232b9c78e13592904be"
[root@tuandq1-pnh2 grub]# grubby --grub2 --add-kernel=/boot/vmlinuz-4.18.0-348.7.1.el8_5.x86_64 --
title="Linux_Test_Kernel" --initrd=/boot/initramfs-4.18.0-348.7.1.el8_5.x86_64.img --copy-default
An entry for kernel 4.18.0-348.7.1.el8_5.x86_64 already exists, adding
/boot/loader/entries/198551dfd334453e95a6ef2bdd0f5a59-4.18.0-348.7.1.el8_5.x86_64.0~custom.conf
[root@tuandq1-pnh2 grub]# ll /boot/loader/entries/
total 28
-rw-r--r--. 1 root root 398 Feb 14 2022 198551dfd334453e95a6ef2bdd0f5a59-0-rescue.conf
-rw-r--r-- 1 root root 315 Aug 30 07:51 198551dfd334453e95a6ef2bdd0f5a59-4.18.0-
348.7.1.el8_5.x86_64.0~custom.conf
-rw-r--r--. 1 root root 356 Feb 14 2022 198551dfd334453e95a6ef2bdd0f5a59-4.18.0-
348.7.1.el8_5.x86_64.conf
-rw-r--r--. 1 root root 388 Dec 4 2020 6bdfa40330b14232b9c78e13592904be-0-rescue.conf
-rw-r--r--. 1 root root 356 Dec 4 2020 6bdfa40330b14232b9c78e13592904be-4.18.0-
240.1.1.el8_3.x86_64.conf
-rw-r--r--. 1 root root 388 Mar 12 2021 96733cf550ab4411a657b474a4ff6d32-0-rescue.conf
-rw-r--r--. 1 root root 361 Mar 12 2021 96733cf550ab4411a657b474a4ff6d32-4.18.0-
240.15.1.el8_3.x86_64.conf

1.3 Thay đổi kernel mặc định của hệ thống

Thực hiện liệt kê thông tin và chỉ số index của kernel mặc định đang sử dụng:

[root@tuandq1-pnh2 grub]# grubby --default-kernel


/boot/vmlinuz-4.18.0-348.7.1.el8_5.x86_64
[root@tuandq1-pnh2 grub]# grubby --default-index
1
[root@tuandq1-pnh2 grub]# grubby --default-title
CentOS Linux (4.18.0-348.7.1.el8_5.x86_64) 8
Có hai phương pháp có thể sử dụng để thực hiện thay đổi đối với kernel mặc định

 Phương pháp 1: sử dụng kernel path

[root@tuandq1-pnh2 grub]# grubby --set-default /boot/vmlinuz-4.18.0-240.15.1.el8_3.x86_64


The default is /boot/loader/entries/96733cf550ab4411a657b474a4ff6d32-4.18.0-240.15.1.el8_3.x86_64.conf
with index 3 and kernel /boot/vmlinuz-4.18.0-240.15.1.el8_3.x86_64
[root@tuandq1-pnh2 grub]# grubby --default-kernel
/boot/vmlinuz-4.18.0-240.15.1.el8_3.x86_64
Sau khi thực hiện các bước trên sẽ thay đổi kernel mặc định của hệ thống từ kernel vmlinuz-4.18.0-
348.7.1.el8_5.x86_64 sang kernel vmlinuz-4.18.0-240.15.1.el8_3.x86_64

 Phương pháp 2: sử dụng kernel index

[root@tuandq1-pnh2 grub]# grubby --info=ALL | grep -E "^kernel|^index"


index=0
kernel="/boot/vmlinuz-4.18.0-348.7.1.el8_5.x86_64"
index=1
kernel="/boot/vmlinuz-4.18.0-348.7.1.el8_5.x86_64"
index=2
kernel="/boot/vmlinuz-0-rescue-198551dfd334453e95a6ef2bdd0f5a59"
index=3
kernel="/boot/vmlinuz-4.18.0-240.15.1.el8_3.x86_64"
index=4
kernel="/vmlinuz-0-rescue-96733cf550ab4411a657b474a4ff6d32"
index=5
kernel="/boot/vmlinuz-4.18.0-240.1.1.el8_3.x86_64"
index=6
kernel="/vmlinuz-0-rescue-6bdfa40330b14232b9c78e13592904be"
[root@tuandq1-pnh2 grub]# grubby - --default-index
0
[root@tuandq1-pnh2 grub]# grubby --set-default-index=1
The default is /boot/loader/entries/198551dfd334453e95a6ef2bdd0f5a59-4.18.0-
348.7.1.el8_5.x86_64.conf with index 1 and kernel /boot/vmlinuz-4.18.0-348.7.1.el8_5.x86_64

Sau đó thực hiện reboot để hệ thống khởi động chạy với kernel mới: reboot –i

Kiểm tra thông tin của kernel bằng cách:

[root@tuandq1-pnh2 grub]# grubby --info=ALL


index=0
kernel="/boot/vmlinuz-4.18.0-348.7.1.el8_5.x86_64"
args="ro console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto console=tty0
console=ttyS0,115200 no_timer_check nofb nomodeset gfxpayload=text $tuned_params"
root="LABEL=cloudimg-rootfs"
initrd="/boot/initramfs-4.18.0-348.7.1.el8_5.x86_64.img"
title="Linux_Test_Kernel"
id="198551dfd334453e95a6ef2bdd0f5a59-4.18.0-348.7.1.el8_5.x86_64.0~custom"
index=1
kernel="/boot/vmlinuz-4.18.0-348.7.1.el8_5.x86_64"
args="ro console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto console=tty0
console=ttyS0,115200 no_timer_check nofb nomodeset gfxpayload=text $tuned_params"
root="LABEL=cloudimg-rootfs"
initrd="/boot/initramfs-4.18.0-348.7.1.el8_5.x86_64.img $tuned_initrd"
title="CentOS Linux (4.18.0-348.7.1.el8_5.x86_64) 8"
id="198551dfd334453e95a6ef2bdd0f5a59-4.18.0-348.7.1.el8_5.x86_64"
index=2
kernel="/boot/vmlinuz-0-rescue-198551dfd334453e95a6ef2bdd0f5a59"
args="ro console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto console=tty0
console=ttyS0,115200 no_timer_check nofb nomodeset gfxpayload=text"
root="LABEL=cloudimg-rootfs"
initrd="/boot/initramfs-0-rescue-198551dfd334453e95a6ef2bdd0f5a59.img"
title="CentOS Linux (0-rescue-198551dfd334453e95a6ef2bdd0f5a59) 8"
id="198551dfd334453e95a6ef2bdd0f5a59-0-rescue"
index=3
kernel="/boot/vmlinuz-4.18.0-240.15.1.el8_3.x86_64"
args="ro console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto console=tty0
console=ttyS0,115200 no_timer_check nofb nomodeset gfxpayload=text $tuned_params"
root="LABEL=cloudimg-rootfs"
initrd="/boot/initramfs-4.18.0-240.15.1.el8_3.x86_64.img $tuned_initrd"
title="CentOS Linux (4.18.0-240.15.1.el8_3.x86_64) 8"
id="96733cf550ab4411a657b474a4ff6d32-4.18.0-240.15.1.el8_3.x86_64"
index=4
kernel="/vmlinuz-0-rescue-96733cf550ab4411a657b474a4ff6d32"
args="ro console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto console=tty0
console=ttyS0,115200 no_timer_check nofb nomodeset gfxpayload=text"
root="LABEL=cloudimg-rootfs"
initrd="/initramfs-0-rescue-96733cf550ab4411a657b474a4ff6d32.img"
title="CentOS Linux (0-rescue-96733cf550ab4411a657b474a4ff6d32) 8"
id="96733cf550ab4411a657b474a4ff6d32-0-rescue"
index=5
kernel="/boot/vmlinuz-4.18.0-240.1.1.el8_3.x86_64"
args="ro console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto console=tty0
console=ttyS0,115200 no_timer_check nofb nomodeset gfxpayload=text $tuned_params"
root="LABEL=cloudimg-rootfs"
initrd="/boot/initramfs-4.18.0-240.1.1.el8_3.x86_64.img $tuned_initrd"
title="CentOS Linux (4.18.0-240.1.1.el8_3.x86_64) 8"
id="6bdfa40330b14232b9c78e13592904be-4.18.0-240.1.1.el8_3.x86_64"
index=6
kernel="/vmlinuz-0-rescue-6bdfa40330b14232b9c78e13592904be"
args="ro console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto console=tty0
console=ttyS0,115200 no_timer_check nofb nomodeset gfxpayload=text"
root="LABEL=cloudimg-rootfs"
initrd="/initramfs-0-rescue-6bdfa40330b14232b9c78e13592904be.img"
title="CentOS Linux (0-rescue-6bdfa40330b14232b9c78e13592904be) 8"
id="6bdfa40330b14232b9c78e13592904be-0-rescue"

1.4 Xóa một kernel không dùng

Trong trường hợp bạn muốn xóa một mục Kernel nào đó, hãy sử dụng cú pháp:

grubby --remove-kernel=old_kernel
grubby --remove-kernel=menu_index

2. Quản lý các dịch vụ khi khởi động

Kiểm tra danh sách các service được nạp vào khi khởi động

[root@tuandq1-pnh2 grub]# systemctl list-units --type=service


UNIT LOAD ACTIVE SUB DESCRIPTION
acpid.service loaded active running ACPI Event Daemon
auditd.service loaded active running Security Auditing Service
chronyd.service loaded active running NTP client/server
cloud-config.service loaded active exited Apply the settings specified in cloud-config
cloud-final.service loaded active exited Execute cloud user/final scripts
cloud-init-local.service loaded active exited Initial cloud-init job (pre-networking)
cloud-init.service loaded active exited Initial cloud-init job (metadata service crawler)
crond.service loaded active running Command Scheduler
dbus.service loaded active running D-Bus System Message Bus
dracut-shutdown.service loaded active exited Restore /run/initramfs on shutdown
getty@tty1.service loaded active running Getty on tty1
gssproxy.service loaded active running GSSAPI Proxy Daemon
import-state.service loaded active exited Import network configuration from initramfs
irqbalance.service loaded active running irqbalance daemon
iscsi-shutdown.service loaded active exited Logout off all iSCSI sessions on shutdown
kdump.service loaded active exited Crash recovery kernel arming
kmod-static-nodes.service loaded active exited Create list of required static device nodes for the
current kernel
NetworkManager-wait-online.service loaded active exited Network Manager Wait Online
NetworkManager.service loaded active running Network Manager
nginx.service loaded active running The nginx HTTP and reverse proxy server
nis-domainname.service loaded active exited Read and set NIS domainname from
/etc/sysconfig/network
polkit.service loaded active running Authorization Manager
qemu-guest-agent.service loaded active running QEMU Guest Agent
rc-local.service loaded active exited /etc/rc.d/rc.local Compatibility
rngd-wake-threshold.service loaded active exited Hardware RNG Entropy Gatherer Wake threshold
service
rngd.service loaded active running Hardware RNG Entropy Gatherer Daemon
rpc-statd-notify.service loaded active exited Notify NFS peers of a restart
rpcbind.service loaded active running RPC Bind
rsyslog.service loaded active running System Logging Service
serial-getty@ttyS0.service loaded active running Serial Getty on ttyS0
sshd.service loaded active running OpenSSH server daemon
sssd.service loaded active running System Security Services Daemon
sysstat.service loaded active exited Resets System Activity Logs
systemd-fsck-root.service loaded active exited File System Check on Root Device
systemd-journal-flush.service loaded active exited Flush Journal to Persistent Storage
systemd-journald.service loaded active running Journal Service
systemd-logind.service loaded active running Login Service
systemd-random-seed.service loaded active exited Load/Save Random Seed
systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
systemd-sysctl.service loaded active exited Apply Kernel Variables
systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev
systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories
systemd-udev-trigger.service loaded active exited udev Coldplug all Devices
systemd-udevd.service loaded active running udev Kernel Device Manager
systemd-update-utmp.service loaded active exited Update UTMP about System Boot/Shutdown
systemd-user-sessions.service loaded active exited Permit User Sessions
tuned.service loaded active running Dynamic System Tuning Daemon
user-runtime-dir@0.service loaded active exited User runtime directory /run/user/0
user@0.service loaded active running User Manager for UID 0
yppasswdd.service loaded active running NIS/YP (Network Information Service) Users Passwords
Change Server
ypserv.service loaded active running NIS/YP (Network Information Service) Server
ypxfrd.service loaded active running NIS/YP (Network Information Service) Maps Transferring
Accelerator

LOAD = Reflects whether the unit definition was properly loaded.


ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.

52 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

Kiểm tra các service đang active/runing

[root@tuandq1-pnh2 grub]# systemctl list-units --type=service --state=active


UNIT LOAD ACTIVE SUB DESCRIPTION
acpid.service loaded active running ACPI Event Daemon
auditd.service loaded active running Security Auditing Service
chronyd.service loaded active running NTP client/server
cloud-config.service loaded active exited Apply the settings specified in cloud-config
cloud-final.service loaded active exited Execute cloud user/final scripts
cloud-init-local.service loaded active exited Initial cloud-init job (pre-networking)
cloud-init.service loaded active exited Initial cloud-init job (metadata service crawler)
crond.service loaded active running Command Scheduler
dbus.service loaded active running D-Bus System Message Bus
dracut-shutdown.service loaded active exited Restore /run/initramfs on shutdown
getty@tty1.service loaded active running Getty on tty1
gssproxy.service loaded active running GSSAPI Proxy Daemon
import-state.service loaded active exited Import network configuration from initramfs
irqbalance.service loaded active running irqbalance daemon
iscsi-shutdown.service loaded active exited Logout off all iSCSI sessions on shutdown
kdump.service loaded active exited Crash recovery kernel arming
kmod-static-nodes.service loaded active exited Create list of required static device nodes for the
current kernel
NetworkManager-wait-online.service loaded active exited Network Manager Wait Online
NetworkManager.service loaded active running Network Manager
nginx.service loaded active running The nginx HTTP and reverse proxy server
nis-domainname.service loaded active exited Read and set NIS domainname from
/etc/sysconfig/network
polkit.service loaded active running Authorization Manager
qemu-guest-agent.service loaded active running QEMU Guest Agent
rc-local.service loaded active exited /etc/rc.d/rc.local Compatibility
rngd-wake-threshold.service loaded active exited Hardware RNG Entropy Gatherer Wake threshold
service
rngd.service loaded active running Hardware RNG Entropy Gatherer Daemon
rpc-statd-notify.service loaded active exited Notify NFS peers of a restart
rpcbind.service loaded active running RPC Bind
rsyslog.service loaded active running System Logging Service
serial-getty@ttyS0.service loaded active running Serial Getty on ttyS0
sshd.service loaded active running OpenSSH server daemon
sssd.service loaded active running System Security Services Daemon
sysstat.service loaded active exited Resets System Activity Logs
systemd-fsck-root.service loaded active exited File System Check on Root Device
systemd-journal-flush.service loaded active exited Flush Journal to Persistent Storage
systemd-journald.service loaded active running Journal Service
systemd-logind.service loaded active running Login Service
systemd-random-seed.service loaded active exited Load/Save Random Seed
systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
systemd-sysctl.service loaded active exited Apply Kernel Variables
systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev
systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories
systemd-udev-trigger.service loaded active exited udev Coldplug all Devices
systemd-udevd.service loaded active running udev Kernel Device Manager
systemd-update-utmp.service loaded active exited Update UTMP about System Boot/Shutdown
systemd-user-sessions.service loaded active exited Permit User Sessions
tuned.service loaded active running Dynamic System Tuning Daemon
user-runtime-dir@0.service loaded active exited User runtime directory /run/user/0
user@0.service loaded active running User Manager for UID 0
yppasswdd.service loaded active running NIS/YP (Network Information Service) Users Passwords
Change Server
ypserv.service loaded active running NIS/YP (Network Information Service) Server
ypxfrd.service loaded active running NIS/YP (Network Information Service) Maps Transferring
Accelerator

LOAD = Reflects whether the unit definition was properly loaded.


ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
Kiểm tra thời gian booting OS

[root@tuandq1-pnh2 grub]# systemd-analyze


Startup finished in 1.334s (kernel) + 3.346s (initrd) + 11.652s (userspace) = 16.333s
multi-user.target reached after 6.579s in userspace

Kiểm tra chi tiết thời gian chạy của từng process

[root@tuandq1-pnh2 grub]# systemd-analyze blame


5.405s kdump.service
2.730s cloud-init.service
1.807s cloud-init-local.service
1.312s cloud-final.service
1.167s initrd-switch-root.service
1.039s cloud-config.service
875ms dracut-cmdline.service
695ms sssd.service
636ms tuned.service
458ms dracut-pre-udev.service
325ms polkit.service
319ms rsyslog.service
307ms NetworkManager-wait-online.service
305ms dracut-initqueue.service
284ms initrd-parse-etc.service
275ms dracut-pre-pivot.service
244ms dnf-makecache.service
175ms rc-local.service
163ms auditd.service
142ms chronyd.service
128ms sysroot.mount
125ms yppasswdd.service
113ms systemd-udevd.service
100ms gssproxy.service
96ms rngd-wake-threshold.service
93ms ypserv.service
91ms ypxfrd.service
86ms systemd-tmpfiles-setup-dev.service
85ms rpcbind.service
84ms systemd-vconsole-setup.service
84ms systemd-tmpfiles-setup.service
83ms systemd-udev-trigger.service
82ms iscsiuio.service
80ms sshd.service
74ms rpc-statd-notify.service
70ms systemd-fsck-root.service
65ms NetworkManager.service
61ms unbound-anchor.service
61ms initrd-cleanup.service
60ms sysstat-summary.service
58ms systemd-journald.service
56ms systemd-logind.service
53ms dracut-pre-trigger.service
51ms sys-kernel-debug.mount
50ms nis-domainname.service
43ms kmod-static-nodes.service
43ms systemd-update-utmp-runlevel.service
42ms systemd-user-sessions.service
39ms dev-hugepages.mount
38ms sysstat.service
37ms systemd-sysctl.service
37ms dev-mqueue.mount
34ms import-state.service
34ms systemd-remount-fs.service
33ms systemd-journal-flush.service
30ms user@0.service
30ms systemd-update-utmp.service
28ms nginx.service
24ms systemd-random-seed.service
18ms proc-sys-fs-binfmt_misc.mount
17ms iscsid.service
16ms systemd-tmpfiles-clean.service
15ms sys-kernel-config.mount
12ms user-runtime-dir@0.service
12ms iscsi-shutdown.service
10ms sysstat-collect.service
8ms initrd-udevadm-cleanup-db.service
5ms dracut-shutdown.service

You might also like