The file shows 56 blocks as the size. I am using the system Ubuntu 16.04 and I need a solution that does not require me to update the kernel.

1 Answer 1


Although it may be named initrd, it is actually an initramfs. That means, it can be a concatenation of multiple cpio archives, each of which may or may not be compressed. You may have managed to extract just the first part.

Proper procedure for extracting an initramfs file

More specifically, the first cpio part is usually an "early microcode update", which for Intel processors has a pathname kernel/x86/microcode/GenuineIntel.bin. If you just run cpio -iv /boot/initrd.img-<kernel version>, this is all you get extracted. (The microcode is typically not compressed because it's encrypted and so won't compress much at all.)

To fully extract a modern initramfs in a Debian/Ubuntu system, you should use the unmkinitramfs command.

If that command is not available for some reason, you can do it manually like this:

mkdir /some/temporary/directory
cd /some/temporary/directory
cat /boot/initrd.img-$(uname -r) | (cpio -iv; zcat | cpio -iv; file -)

assuming that the initramfs has only two parts.

The idea is that the cat command will output the contents from the beginning to the end to the commands within the parentheses. Within them, the first cpio will take the beginning of the file and extract the early microcode update. Once it finishes, the next command will pick up from where the first command left off. When the second, compressed cpio archive ends, the file - command checks to see whether or not there is still more to come.

If the last line of extraction output is not

/dev/stdin: empty

...then you'll know there is a further part in the initramfs file, and the file command output tells you whether it's compressed or not. Then add another cpio -iv; or zcat | cpio -iv; element within the parentheses just before the filecommand.

For example, to extract a three-part initramfs with two compressed parts after the early microcode update:

cat /boot/initrd.img-$(uname -r) | (cpio -iv; zcat | cpio -iv; zcat | cpio -iv; file -)

If your initrd is really only 56 blocks in size

In this case, the initrd creation process may have failed. You can use

sudo update-initramfs -u

to tell the system to regenerate it based on your current kernel and modules. This is also a good command to run after any configuration changes that may affect things that need to happen early in the system start-up, before the real root filesystem is mounted.

  • For nitpickers: sure, technically this is an "useless use of cat command", but making it explicit that the initramfs file is read only once might make it easier to understand what is going on.
    – telcoM
    Commented Apr 8, 2019 at 12:41
  • Thank you for responding! The command 'unmkinitramfs' works fine when executed on Ubuntu 18.04, but not in 16.04. Also, for the command above, I'm getting error saying 'gzip: stdin: not in gzip format' and 'cpio: premature end of archive'
    – priyalsoni
    Commented Apr 9, 2019 at 5:47
  • Interesting... perhaps the initramfs file creation process has indeed failed, or maybe Ubuntu uses a different compression; try just cpio -iv; file - inside the parentheses.
    – telcoM
    Commented Apr 9, 2019 at 7:03
  • Oh no, It's still pulling just the kernel module
    – priyalsoni
    Commented Apr 9, 2019 at 7:24
  • 1
    Quick sidenote: If zcat errors out with “gzip: stdin: not in gzip format”, it might be a good idea to run cat /boot/initrd.img-$(uname -r) | (cpio -iv; file -) and choose the decompression tool accordingly. My initrd (Debian 11) was compressed using Zstandard, so I had to use zstdcat instead of zcat.
    – Joja
    Commented Jan 13, 2023 at 21:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .