LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1040|回复: 7

怎么查看 initrd 呢?

[复制链接]
发表于 2008-10-1 22:39:12 | 显示全部楼层 |阅读模式
首先祝贺大家国庆节快乐

我使用的是默认的安装,在/boot 下面能看到一个 initrd 的文件,但是应该怎么查看它呢?
P.S.
   我尝试过把它加上.gz然后解压,最后还是失败了。
发表于 2008-10-1 22:54:34 | 显示全部楼层
这是个二进制文件吧。你看它作甚?
回复 支持 反对

使用道具 举报

发表于 2008-10-2 01:08:10 | 显示全部楼层
不是二进制文件 , 用CPIO这个命令!! 2.6内核后, 已经换了文件的制作方式了!
回复 支持 反对

使用道具 举报

发表于 2008-10-3 15:55:05 | 显示全部楼层
zcat ../initrd-2.6.25.16-0.1-pae | cpio -i
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-10-7 17:06:44 | 显示全部楼层

这个是正解

Post by huan;1889829
zcat ../initrd-2.6.25.16-0.1-pae | cpio -i


这个是正解但是输出的有一点奇怪

linux-4qqp:/boot # zcat initrd-2.6.25.5-1.1-pae |cpio -i
cpio: bootsplash not created: newer or same age version exists
cpio: boot/03-storage.sh not created: newer or same age version exists
cpio: boot/01-devfunctions.sh not created: newer or same age version exists
cpio: boot/02-start.sh not created: newer or same age version exists
cpio: boot/11-block.sh not created: newer or same age version exists
cpio: boot/84-mount.sh not created: newer or same age version exists
cpio: boot/05-blogd.sh not created: newer or same age version exists
cpio: boot/93-boot.sh not created: newer or same age version exists
cpio: boot/81-kdump.sh not created: newer or same age version exists
cpio: boot/85-remount.sh not created: newer or same age version exists
cpio: boot/11-usb.sh not created: newer or same age version exists
cpio: boot/04-udev.sh not created: newer or same age version exists
cpio: boot/83-resume.kernel.sh not created: newer or same age version exists
   

.......


or same age version exists
cpio: config/storage.sh not created: newer or same age version exists
cpio: config/mount.sh not created: newer or same age version exists
cpio: config/iscsi.sh not created: newer or same age version exists
cpio: config/usb.sh not created: newer or same age version exists
cpio: config/start.sh not created: newer or same age version exists
cpio: config/block.sh not created: newer or same age version exists
cpio: config/splash.sh not created: newer or same age version exists
cpio: config/udev.sh not created: newer or same age version exists
21615 blocks
回复 支持 反对

使用道具 举报

发表于 2008-10-7 19:56:06 | 显示全部楼层
高手!........
回复 支持 反对

使用道具 举报

发表于 2008-10-8 17:11:04 | 显示全部楼层
zcat ../initrd-2.6.25.16-0.1-pae | cpio -i
如果是root下用, 恐怕死路一条。
zcat ../initrd-2.6.25.16-0.1-pae | cpio -i --no-absolute-filenames

find . | cpio --quiet -H newc -o | gzip -9 -n > /boot/imagefile.img
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-10-15 11:10:58 | 显示全部楼层
楼上的是正解,内核2.6以后initrd由cpio来制作。

mkdir ~/initimage
cd !$
zcat ../initrd-2.6.25.16-0.1-pae | cpio -i --no-absolute-filenames   
//首先解压文件然后,复制到当前的文件夹 --no-absolute-filenames 是忽略绝对路径
//然后复制到印象
find . | cpio --quiet -H newc -o | gzip -9 -n > /boot/imagefile.img
//最后查看一下
ls -l |grep imagefile
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表