This Blog is intended to collect information of my various Intrests,pen my opinion on the information gathered and not intended to educate any one of the information posted,but are most welcome to share there view on them

Monday, January 23, 2012

How to View, Modify and Recreate initrd.img

Question: How do I view, modify and recreate the new initrd.img on Ubuntu, Debian, CentOS, Fedora, Red-Hat, Arch Linux, or SUSE distributions?

1. How To View Content Of initrd.img file?

initrd.img is in gzip format. So move initrd.img to initrd.gz as shown below.

After unziping the initrd.gz file, the initrd is further in cpio ‘newc’ format. So extract the files from initrd using cpio ‘newc’ format as shown below.Note:info cpio will give more information about ‘newc’ format.

# mkdir tmp2
# cd tmp2/
# cpio -id < ../initrd
16524 blocks

Now you can view the content of initrd.img file

# ls
bin dev etc init modules proc sbin selinux sys tmp var

2. How To Modify Content of Image and Recreate New Image?

After extracting the file as shown below, make appropriate modification to any of those files. Then pack the files back into the archive using the following commands. Pack the modified files back to cpio ‘newc’ format.

Redmi 4

About Me

Hi This is Suresh Kumar Pakalapati . I am a person who is positive about every aspect of life. There are many things I like to do, to see, and to experience. I like to feel the music flowing on my face, I like good books and romantic, action,cartoon movies. I like the land and the nature, And, I like to keep smile on my face. I always wanted to be a great and successful person in the world and I know it is needed More and More education, More work, Success Never come in a short Time.....