1

I have been using Arch Linux for a while and studying about the initramfs. I thought of looking into the contents of the file to get a clear idea of it. I googled for various ways to peek through the file but I was not able to.

Initially, I checked the file type of initramfs using the below command and got the following output:

file /boot/initramfs-linux.img
/boot/initramfs-linux.img: Zstandard compressed data (v0.8+), Dictionary IS: None

I found that the file was Zstandard compressed and used the zstd tool to fetch the content of the file as follows:

zstd -d /boot/initramfs-linux.img -o SOME_FILE_NAME

That yielded gibberish result. I gave a file name as it's argument since it complained when I gave a directory.

I thought that the initramfs file contains the initial root file system (set of files and directories).

I am naive to Arch Linux and it's internals. Kindly help me through this.

Thanks.

Panther Coder
  • 368
  • 3
  • 8

1 Answers1

0

Thanks to Artem S. Tashkinov for guiding.

I did a file command on the extracted file. The output was a ASCII cpio archive.

Now I used the following command to extract the contents of the cpio archive

cpio -idv < FILE_NAME

Finally, I could get the contents of initramfs archive.

Panther Coder
  • 368
  • 3
  • 8