How to extract the contents of initramfs image on RHEL7?

Solution Verified - Updated -

Issue

  • In RHEL6 and older, contents of initramfs image could be extracted using cpio as shown below:
# ls
initramfs-2.6.32-431.el6.x86_64.img

# zcat initramfs-2.6.32-431.el6.x86_64.img | cpio -id
96748 blocks

# ls
bin      dracut-004-335.el6  init                initqueue-settled                    lib    pre-pivot    proc  sysroot  var
cmdline  emergency           initqueue           initqueue-timeout                    lib64  pre-trigger  sbin  tmp
dev      etc                 initqueue-finished  initramfs-2.6.32-431.el6.x86_64.img  mount  pre-udev     sys   usr
  • However it does not work when I try to extract the contents of initramfs image on RHEL7 as shown below:
# zcat initramfs-3.10.0-229.4.2.el7.x86_64.img | cpio -id

gzip: initramfs-3.10.0-229.4.2.el7.x86_64.img: not in gzip format
cpio: premature end of archive

# file  initramfs-3.10.0-229.4.2.el7.x86_64.img 
initramfs-3.10.0-229.4.2.el7.x86_64.img: ASCII cpio archive (SVR4 with no CRC)
  • How to extract the contents of initramfs image on RHEL7?

Environment

  • Red Hat Enterprise Linux 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.