一、回到上一篇
linux initramfs启动过程:
从systemd的角度,将模块和断点左右排序:
右边是dracut留在initramfs的debug hooks,也就是grub中我们可以指定的rd.break=?时,内核初始化中断退出到shell的地方。
二、断点设置
grub 菜单中 e,进入编辑模式
设置rd.break
1.cmdline的启动结果
系统 启动到了 cmdline#
然后查看 vi /run/initramfs/rdsosreport.txt:
——在dev下创建静态节点,然后进入 emergency shell;
2、pre_udev的启动结果:
——与rd.break=cmdline的结果(initramfs启动到的位置)几乎一样。
3、rd.break=pre-trigger
rdsosreport.txt中多出的步骤:(1759行 dm-devel是上一步启动到达的地方,从此往下是新的日志):
——到了 started udev kernel device manager (上图中行1769)
4、rd.break=initqueue
——网卡,raid卡 物理设备初始化。
5、rd.break=pre-mount
——网络eth,scsi盘target ,实际上是为了找”/’啊 文件系统啊。
三、日志收集
节选 man:
man dracut:
If you are dropped to an emergency shell, while booting your initramfs, the file rdsosreport.txt is created, which can be saved to a (to be mounted by hand) partition (usually /boot) or a USB stick. Additional debugging info can be produced by adding rd.debug to the kernel command line. /run/initramfs/rdsosreport.txt contains all logs and the output of some tools. It should be attached to any report about dracut problems.
可知,在initrd的各个阶段,会生成 rdsosreport 文件。
但是该文件怎么copy出来啊?在vmware station中的虚机进行测试,在rd.break的时候根本没有usb的设备文件。
switchroot下的disk by-id:
后来在网上找了找,似乎在uefi下是可以导出的,也就是通过 efi分区做为一个缓冲,copy出这个rdsosoreport文件:
How to copy/move files between filesystems using UEFI shell
1
How can we move files between filesystems using UEFI shell. If i try:
fs0:> mv somefile fs1:
I get an error that source and destination should be on the same filesystem. How can we workaround this?
uefi
How can we workaround this?
The answer is in the very title of your question:
fs0:> cp somefile fs1: fs0:> rm somefile
shareimprove this answer
uefi:
[root@localhost ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda4 18145280 4293012 13852268 24% /
devtmpfs 926612 0 926612 0% /dev
tmpfs 935108 0 935108 0% /dev/shm
tmpfs 935108 9004 926104 1% /run
tmpfs 935108 0 935108 0% /sys/fs/cgroup
/dev/sda2 508588 110120 398468 22% /boot
/dev/sda1 204580 9744 194836 5% /boot/efi
——实在不不行就mount /dev/sda1吧,copy到efi空间然后再到bios uefi中cp吧。
另外从上一篇以及本篇的记过可以初步看出,若出现dracut或initqueue错误:
dracut一般指向了initrd;
initqueue timeout一般指向了initrd中,初始化 与“/”文件系统相关的 硬盘或raid卡或pxe网卡超时;
再引用引用message中,os启动时initqueue部分印证上面的描述:
Jul 1 16:25:25 isibos systemd: Starting dracut initqueue hook... 》》》》rd.break=initqueue hook初始化。
Jul 1 16:25:25 isibos kernel: megaraid_sas: loading out-of-tree module taints kernel.
Jul 1 16:25:25 isibos kernel: megaraid_sas: module verification failed: signature and/or required key missing - tainting kernel
Jul 1 16:25:25 isibos systemd: Started Show Plymouth Boot Screen.
Jul 1 16:25:25 isibos systemd: Reached target Paths.
Jul 1 16:25:25 isibos kernel: megasas: 07.707.03.00
Jul 1 16:25:25 isibos systemd: Starting Paths.
Jul 1 16:25:25 isibos systemd: Started Forward Password Requests to Plymouth Directory Watch.
Jul 1 16:25:25 isibos systemd: Starting Forward Password Requests to Plymouth Directory Watch.
Jul 1 16:25:25 isibos systemd: Reached target Basic System.
Jul 1 16:25:25 isibos kernel: megaraid_sas 0000:01:00.0: FW now in Ready state
Jul 1 16:25:25 isibos kernel: megaraid_sas 0000:01:00.0: 64 bit DMA mask and 32 bit consistent mask
Jul 1 16:25:25 isibos kernel: megaraid_sas 0000:01:00.0: firmware supports msix#011: (0)
Jul 1 16:25:25 isibos kernel: megaraid_sas 0000:01:00.0: current msix/online cpus#011: (1/32)
Jul 1 16:25:25 isibos kernel: megaraid_sas 0000:01:00.0: RDPQ mode#011: (disabled) 》》》》rd.break=initqueue到达的地方。
Jul 1 16:25:25 isibos systemd: Starting Basic System.
下一篇,作为linux操作系统引导与启动系列的终章,将列出一次完整的RHEL启动日志以及日志的注释。