How to view the decompressed initramfs memory image

In some cases, it may be necessary to uncompress the initramfs image file to check the built-in file information. Unlike previous versions, on RHEL7, using the cpio command on an initramfs image file will not decompress all files directly, and will give some errors. For example:

# ls -la /boot/initramfs-$(uname -r).img

-rw------- 1 root root 19602671 Feb 4 2016 /boot/initramfs-3.10.0-229.el7.x86_64.img

# file initramfs-3.10.0-229.el7.x86_64.img

initramfs-3.10.0-229.el7.x86_64.img: gzip compressed data, from Unix, last modified: Thu Feb 4 16:02:04 2016, max compression

# gzip -dc initramfs-3.10.0-229.el7.x86_64.img | cpio -id — will not decompress all files directly, will give some errors.

1. View the initramfs image

If you want to list the contents of the initramfs image file, you can use the lsinitrd command:

# lsinitrd /boot/initramfs-3.10.0-229.el7.x86_64.img | more

Image: /boot/initramfs-3.10.0-229.el7.x86_64.img: 19M

================================&

Guess you like

Origin blog.csdn.net/taoxicun/article/details/131308017