dev c++怎么设置断点_linux操作系统引导与启动——内核启动和初始化(二)断点...

一、回到上一篇

linux initramfs启动过程:

6ef080513181a2ef8277c8078ac0c432.png

从systemd的角度,将模块和断点左右排序:

d6a1d52c5f39b9d5dc3ed6c3fd470c89.png

右边是dracut留在initramfs的debug hooks,也就是grub中我们可以指定的rd.break=?时,内核初始化中断退出到shell的地方。

二、断点设置

grub 菜单中 e,进入编辑模式

1689be48e510cda41c62f4cc9e51c736.png

设置rd.break

1.cmdline的启动结果

系统    启动到了 cmdline#

然后查看 vi /run/initramfs/rdsosreport.txt:

f4ab64dcb96a0a707dde5fc022c04331.png

——在dev下创建静态节点,然后进入 emergency shell;

2、pre_udev的启动结果:

f7ef5f395a09305bee6bd82c34acd1a7.png

f0c89c7db946535dfc0be16c7bdcd704.png

——与rd.break=cmdline的结果(initramfs启动到的位置)几乎一样。

3、rd.break=pre-trigger

7039daf61b644af9202e568a3c2279a1.png

66ea0e43127f37b35e59a4d55a769c07.png

rdsosreport.txt中多出的步骤:(1759行 dm-devel是上一步启动到达的地方,从此往下是新的日志):

f62a5481502d3b669a2f3ae2d796cffb.png

d4fb826ad71ea7d9d1180ef8c2a74026.png

——到了 started udev kernel device manager (上图中行1769)

4、rd.break=initqueue

087fc707c47943f08683869c80de44e4.png

0b3df5fcc21157855eabbf93153d7b7e.png

f4db003829df6d444e0e1e67ca305741.png

——网卡,raid卡 物理设备初始化。

5、rd.break=pre-mount

11f6b13a681f5d032c8e4fb064e1f2e2.png

0761bfc2eb9fcbb26070212e685dc2ae.png

9d53d74dc55531fdb4320d2d88ee3738.png

——网络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:

30e69d87598a3953cdeb5bc110db978f.png

后来在网上找了找,似乎在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部分印证上面的描述:

  1. Jul  1 16:25:25 isibos systemd: Starting dracut initqueue hook...     》》》》rd.break=initqueue hook初始化。

  2. Jul  1 16:25:25 isibos kernel: megaraid_sas: loading out-of-tree module taints kernel.

  3. Jul  1 16:25:25 isibos kernel: megaraid_sas: module verification failed: signature and/or required key missing - tainting kernel

  4. Jul  1 16:25:25 isibos systemd: Started Show Plymouth Boot Screen.

  5. Jul  1 16:25:25 isibos systemd: Reached target Paths.

  6. Jul  1 16:25:25 isibos kernel: megasas: 07.707.03.00

  7. Jul  1 16:25:25 isibos systemd: Starting Paths.

  8. Jul  1 16:25:25 isibos systemd: Started Forward Password Requests to Plymouth Directory Watch.

  9. Jul  1 16:25:25 isibos systemd: Starting Forward Password Requests to Plymouth Directory Watch.

  10. Jul  1 16:25:25 isibos systemd: Reached target Basic System.    

  11. Jul  1 16:25:25 isibos kernel: megaraid_sas 0000:01:00.0: FW now in Ready state

  12. Jul  1 16:25:25 isibos kernel: megaraid_sas 0000:01:00.0: 64 bit DMA mask and 32 bit consistent mask

  13. Jul  1 16:25:25 isibos kernel: megaraid_sas 0000:01:00.0: firmware supports msix#011: (0)

  14. Jul  1 16:25:25 isibos kernel: megaraid_sas 0000:01:00.0: current msix/online cpus#011: (1/32)

  15. Jul  1 16:25:25 isibos kernel: megaraid_sas 0000:01:00.0: RDPQ mode#011: (disabled)     》》》》rd.break=initqueue到达的地方。

  16. Jul  1 16:25:25 isibos systemd: Starting Basic System.

下一篇,作为linux操作系统引导与启动系列的终章,将列出一次完整的RHEL启动日志以及日志的注释。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值