How to get the dmesg output in initramfs (debian)

I tried to install 2.6.18 kernel in my Debian 5.10, but it could not boot normally. It ended up in initramfs. There was something wrong with my SATA controller driver.  /root device cannot be detected or mounted. 

 in initramfs, we can use dmesg to check the boot message. However, the screen size is too limited. It only displayed the message in the tail.  Plus, the less command is not found. 

Solution: 

Move the dmesg output to a usb device. 

1.  dmesg > /tmp/do

2. format a usb device in another computer first. You don't need a partition in the device. Just fill the usb with all zeros.  The process will take a while.

3. After the formating is done,  plug in the empty usb device into the problematic machine (debian 5.10, in my case). 

4. it will display the usb drive as /dev/sda. 

5.  write the dmesg output to the usb using cmd:\

      dd if=/tmp/do of=/dev/sda

6.  it will be done very shortly.  Then remove the usb and plug it in another computer.

7.  Don't mount it.  Use 

cat /dev/sdb > dmesg_output 

to put all the output to the file.  Remember to just press ctrl+c to end this command quickly. Otherwise it will fill the dmesg_output file with all zero and the file size will be huge. 


Finally you have the dmesg_output with you! You can figure out what it is going on there. 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值