0

I can see my initrd is occupied almost 90 MB of disk but after extracting it via cpio , it contains only a 30 KB microcode :

$ cpio -it < initrd.img-5.4.0-18-generic 
.
kernel
kernel/x86
kernel/x86/microcode
kernel/x86/microcode/AuthenticAMD.bin
62 blocks

I know that there should be a lot of files and tools which are needed by the kernel in the first stage of booting , but I cannot find anything useful in it.

$ file initrd.img-5.4.0-18-generic 
initrd.img-5.4.0-18-generic: ASCII cpio archive (SVR4 with no CRC)

I took a look at here and here and this question but these are too old and don't work for me.My initrd.img is not a gzip archive .
How to extract that file properly?
I use kernel v.5.4.0

Thanks.

1

initramfs images contain multiple cpio archives; the name of your file suggests you’re using a Ubuntu derivative, so the simplest option for you to list the full contents is to use lsinitramfs:

lsinitramfs initrd.img-5.4.0-18-generic

To extract the contents, use unmkinitramfs:

unmkinitramfs initrd.img-5.4.0-18-generic initramfs

This will extract all the files to the initramfs directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.