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.
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
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
...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
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.