从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
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
# cd /tmp
# gunzip initrd.gz (生成了initrd)
# file initrd
initrd.img: ASCII cpio archive (SVR4 with no CRC)
# cpio -i < initrd.img (cpio解压缩)
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
这里讲解了怎么制作的,但是没看懂什么意思。。。。
慢慢来吧