您的位置:首页 > 运维架构 > Linux

Linux内核笔记(2) 内核引导之initrd.img

2011-05-22 20:16 253 查看
从Linux 2.6内核开始,编译生成的initrd.img文件已经不再是loop方式,而是改用了cpio的方式,因此也就不能再使用loop方式来mount了。
会有如下的错误提示。
# mount -o loop initrd-2.6.18-92.el5.img /mnt

mount: you must specify the filesystem type

# file initrd-2.6.18-92.el5.img

initrd-2.6.18-92.el5.img: gzip
compressed data, from Unix, last modified: Tue Mar 24 02:25:06 2009, max compression


可以用下面的方式来解压。
# cp /boot/initrd.img /tmp/initrd.gz

# cd /tmp

# gunzip initrd.gz (生成了initrd)
# file initrd

initrd.img: ASCII cpio
archive (SVR4 with no CRC)

# cpio -i < initrd.img (cpio解压缩)

解压后得到文件系统

bin
sbin
etc
init //POSIX shell script text executable

conf
lib
scripts
http://oss.lzu.edu.cn/modules/lifetype/index.php?op=ViewArticle&articleId=260&blogId=6 这里讲解了怎么***的,但是没看懂什么意思。。。。
慢慢来吧
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: